Laurence Schenk | 1 Dec 02:36 2004
Picon

Need advice starting owfs

Gretings:

I have owfs running on a RedHat Linux box.  It works wonderfully when I 
start it.  I can not get to the file system when I start it with my 
/etc/rc.d/rc.local script at startup.  Is there a was to start owfs 
automatically at boot?

Thanks

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
Paul Alfille | 1 Dec 02:41 2004
Picon
Picon

Re: Need advice starting owfs

Off hand I wonder if there isn't a problem with the startup order.
Perhaps not all processes are available.

owfs should need: syslog (for error and informational messages) and the
fuse module. Check the syslog (? var/log/messages).

Another thought is that the startup environment is different when
rc.local is being run. What user are you running as? Are you using fully
qualified paths? can you run rc.local explicitly after system startup to
get owfs going?

Please report when you get it running, so we can add this to the FAQ.

Paul Alfille

On Tue, 2004-11-30 at 20:36, Laurence Schenk wrote:
> Gretings:
> 
> I have owfs running on a RedHat Linux box.  It works wonderfully when I 
> start it.  I can not get to the file system when I start it with my 
> /etc/rc.d/rc.local script at startup.  Is there a was to start owfs 
> automatically at boot?
> 
> Thanks
> 
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
(Continue reading)

Peter Kropf | 1 Dec 04:11 2004
Picon

Re: Need advice starting owfs

Here's the debian startup script I used on a project recently that used
owfs:

#! /bin/sh
# $Id: owfs.init 18 2004-07-21 20:24:25Z peter $

PATH=/opt/owfs/bin:/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/opt/owfs/bin/owfs
PIDFILE=/var/run/owfs.pid

# Arguments to owfs
#
MOUNT_POINT="/1-wire"
ARGS="-F -u $MOUNT_POINT"

test -x $DAEMON || exit 0

case "$1" in
  start)
    echo -n "Starting owfs"
    start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
-- $ARGS
    echo "."
    ;;
  stop)
    echo -n "Stopping owfs"
    umount $MOUNT_POINT
    echo "."
    ;;
  restart)
(Continue reading)

Paul Alfille | 1 Dec 03:15 2004
Picon
Picon

Re: Need advice starting owfs

Beautiful. I didn't realize that you could kill owfs gracefully by
unmounting the directory.

On Tue, 2004-11-30 at 22:11, Peter Kropf wrote:
> Here's the debian startup script I used on a project recently that used
> owfs:
> 
> 
> #! /bin/sh
> # $Id: owfs.init 18 2004-07-21 20:24:25Z peter $
> 
> PATH=/opt/owfs/bin:/bin:/usr/bin:/sbin:/usr/sbin
> DAEMON=/opt/owfs/bin/owfs
> PIDFILE=/var/run/owfs.pid
> 
> # Arguments to owfs
> #
> MOUNT_POINT="/1-wire"
> ARGS="-F -u $MOUNT_POINT"
> 
> test -x $DAEMON || exit 0
> 
> case "$1" in
>   start)
>     echo -n "Starting owfs"
>     start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
> -- $ARGS
>     echo "."
>     ;;
>   stop)
(Continue reading)

Serg Oskin | 1 Dec 09:38 2004
Picon

Re: Need advice starting owfs

"PK" == Peter Kropf wrote:

 PK> Here's the debian startup script I used on a project recently that used
 PK> owfs:

I too have made a similar script, but it supports many adapters (see attach's). :)

 PK> The only problem that I encountered was from the physical world. The
 PK> project had two temperature sensors mounted on a vehicle and accessed
 PK> though a ds9490 (USB) adapter. The problem was that the adapter would
 PK> bounce around as the vehicle moved and this would cause the USB
 PK> subsystem to see it as a removal followed by an insertion. When that
 PK> happened, owfs would be really unhappy and wouldn't see the devices. A
 PK> simple work around was to have the code that was reading the sensors
 PK> check that the sensor directory entries were in the 1-wire directory. If
 PK> they weren't, then the owfs.init script would be restarted.

I have written daemon oweventd which to watch appearance of devices in the
directory alarm/ and fulfils the indicated external program. Also oweventd
periodically checks appearance of new devices and disappearance of old
devices. At appearance of new devices oweventd can start the external
program for initialization of the new device. If all disappear 1-wire
devices, oweventd too can start the separate external program for this
case. oweventd and some external programs it is possible to look here:
ftp://oskin.ru/pub/linux/1wire/
It is the preliminary (working) version, it is written on tcl. Now I write
the new version with usage threads. It will have two main features: support
of several controllers (mountpoints) and through addressing of
devices without mountpoints.

(Continue reading)

Vadim Tkachenko | 2 Dec 07:56 2004

Re: Re: Segmentation fault when attempting to execute complied owhttpd and owfs with USB interface

Serg Oskin wrote:

[re: 1-wire code in the kernel]

>"PK" == Peter Kropf wrote:
>
>IMHO it will be clone OWFS, only in a kernel...
>  
>
For whatever it's worth, I think that this is not a good idea to put 
1-Wire support into kernel space. It introduces another, not necessarily 
correct or complete, not to mention very difficult to work with, level 
of indirection between the hardware and the API user. Things like that 
should be confined to userspace.

Just my $0.02: ignore the kernel code and make the API user unload the 
kernel module if it is detected...

>Serg.
>  
>
--vt

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
Serg Oskin | 2 Dec 08:40 2004
Picon

Re: Re: Segmentation fault when attempting to execute complied owhttpd and owfs with USB interface

"VT" == Vadim Tkachenko wrote:

 VT> Serg Oskin wrote:
 VT> [re: 1-wire code in the kernel]

 >> "PK" == Peter Kropf wrote:
 >> 
 >> IMHO it will be clone OWFS, only in a kernel...
 >> 
 >> 
 VT> For whatever it's worth, I think that this is not a good idea to put
 VT> 1-Wire support into kernel space. It introduces another, not
 VT> necessarily correct or complete, not to mention very difficult to work
 VT> with, level of indirection between the hardware and the API
 VT> user. Things like that should be confined to userspace.

 VT> Just my $0.02: ignore the kernel code and make the API user unload the
 VT> kernel module if it is detected...

I too so think.

To Paul: Forward, pls., my answer to you on this theme, I it accidentally
have not saved...

--

-- 
        Serg (http://oskin.ru/)
~
~
:q!

(Continue reading)

Geo Carncross | 2 Dec 22:00 2004
Picon

Re: Re: Segmentation fault when attempting to execute complied owhttpd and owfs with USB interface

On Mon, 2004-11-29 at 18:44 -0800, Peter Kropf wrote:
> I'll try to answer your questions inline to keep context...
> 
> On Mon, 2004-11-29 at 19:46 -0500, Geo Carncross wrote:
> > You seem to be able to use gdb, can you break on usb_open and usb_reset,
> > record the contents of global devusb after return from usb_open, and
> > before entering usb_reset?
> > 
> > If they match, there may be a problem with your libusb installation.
> > 
> > If they don't, there might be something more nefarious going on...
> 
> Looks like there's something more nefarious going on:
{snip}
> Breakpoint 3, 0xb7fa3a26 in usb_open () from /lib/libusb-0.1.so.4
> (gdb) print devusb
> $1 = (usb_dev_handle *) 0x0
> (gdb) c
> Continuing.
> 
> Breakpoint 4, 0xb7fa6902 in usb_reset () from /lib/libusb-0.1.so.4
> (gdb) print devusb
> $2 = (usb_dev_handle *) 0x0
> (gdb) c
> Continuing.

No... they match!

libusb isn't working on your system.

(Continue reading)

Peter Kropf | 2 Dec 23:04 2004
Picon

Re: Re: Segmentation fault when attempting to execute complied owhttpd and owfs with USB interface

I tend to agree. Unfortunately, it doesn't look like we have any say
over the matter since the code is already in 2.6.9 and the work is being
done by someone else...

- Peter

On Wed, 2004-12-01 at 23:56 -0700, Vadim Tkachenko wrote:
> Serg Oskin wrote:
> 
> [re: 1-wire code in the kernel]
> 
> >"PK" == Peter Kropf wrote:
> >
> >IMHO it will be clone OWFS, only in a kernel...
> >  
> >
> For whatever it's worth, I think that this is not a good idea to put 
> 1-Wire support into kernel space. It introduces another, not necessarily 
> correct or complete, not to mention very difficult to work with, level 
> of indirection between the hardware and the API user. Things like that 
> should be confined to userspace.
> 
> Just my $0.02: ignore the kernel code and make the API user unload the 
> kernel module if it is detected...
> 
> >Serg.
> >  
> >
> --vt
> 
(Continue reading)

Peter Kropf | 2 Dec 23:07 2004
Picon

Re: Re: Segmentation fault when attempting to execute complied owhttpd and owfs with USB interface

Yup, better now. At least the program doesn't crash.

Any thoughts on how to notify the user that owfs isn't working? When I'm
running a service, finding information through syslog works just fine.
But when I'm initially setting up the environment or tinkering, I tend
to want to see problem / error / whatever messages on screen.

- Peter

On Tue, 2004-11-30 at 13:49 -0500, Paul Alfille wrote:
> Any better now? We now exit gracefully if USB cannot be opened.
> 
> Paul
> 
> On Mon, 2004-11-29 at 23:24, Peter Kropf wrote:
> > Ok, more digging. The code in DS9490_detect_low() that calls usb_open()
> > is failing. When it fails, the code sends a message to syslog to
> > indicate that it was unable to open the usb device and then continues
> > along. Can I suggest that the code exit somehow when the ds9490 cannot
> > be opened?
> > 
> 
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now. 
> http://productguide.itmanagersjournal.com/
(Continue reading)


Gmane