You are right... The kernel thinks the usb adapter is physically
removed and then inserted again and get a new device number.
This problem is very fatal and question is if such thing should
be handled by owfs. It could of course be added to detect a new
1-wire adapter if it disappears, but strange things can happen.
Have you heard about any printer or scanner driver which solve the
issue of a disconnected device?

Let say you have 2 DS9490 adapters. (Called A & B)
Start: owfs -p19160 -u /var/1wire
/var/1wire/system/adapter/name.0 = DS9490  (The first found adapter A)

If adapter A get a hard error (like you) or is physically removed and
inserted, the second adapter B will easily replace the first adapter
which disappeared. It's perhaps possible to solve in some way, but I
hope you understand this issue I see as a problem.

My usb-adapter have a unique id 81.01010101010101 which could be used to
find the same adapter when re-connected, but does every adapter have
a unique id?  I thought there where old adapters without this feature...

Paul, do you have any idea how to solve it in a good way?

/Christian


On Thu, 2005-06-30 at 20:26, Jan Kandziora wrote:
> Am Montag, 27. Juni 2005 13:17 schrieb Christian Magnusson:
> 
> > Try the latest cvs again... I have fixed a missing
> 
> > usb_release_interface() and some other statistics from those errors.
> 
> >
> 
> > /Christian
> 
> >
> 
> Sorry for the delay. I had my business partners here, which messed up
> things a lot.
> 
> I've done some testing with the owfs-2005-06-29.tar.gz daily
> configured package. Again, no luck. I've done
> 
> $ /opt/owfs/bin/owserver -p19160 -u1 --foreground --error_level 9
> 
> and started the owtcl test skript:
> 
> package require ow
> 
> OW::init localhost:19160
> 
> set DEVICES [ OW::get ]
> 
> set DEVICE [ lindex $DEVICES [ lsearch -glob $DEVICES {12.*} ] ]
> 
> puts $DEVICE
> 
> set STATE 0
> 
> for { set I 0 } { 1 } { incr I } \
> 
> {
> 
> set STATE [ expr 1-$STATE ]
> 
> puts "$I: OW::put ${DEVICE}PIO.A $STATE"
> 
> if [ catch { OW::put ${DEVICE}PIO.A $STATE } message ] \
> 
> {
> 
> puts $message
> 
> puts $errorCode
> 
> puts $errorInfo
> 
> }
> 
> after 500
> 
> }
> 
> The log of owserver:
> 
> INFO: PARSENAME path=(null)
> 
> : Success
> 
> ERR: Opened USB DS9490 adapter at 001/016.
> 
> : Permission denied
> 
> INFO: PARSENAME path=
> 
> : Success
> 
> INFO: PARSENAME path=/12.869736000000
> 
> : Success
> 
> INFO: PARSENAME path=/12.159736000000
> 
> : Success
> 
> INFO: PARSENAME path=/81.198C24000000
> 
> : Success
> 
> INFO: PARSENAME path=12.869736000000/PIO.A
> 
> : Success
> 
> The last two lines continue with every switch of PIO.A
> 
> Then I turned the mains switch, and got log lines like this:
> 
> ERR: Closed USB DS9490 adapter at 001/016.
> 
> : Protocol error
> 
> ERR: Failed to configure/claim interface on USB DS9490 adapter at
> 001/016.
> 
> : Protocol error
> 
> ERR: Failed to reconnect USB DS9490 adapter!
> 
> : Protocol error
> 
> ERR: BUS_reconnect, returned error = -5
> 
> : Protocol error
> 
> INFO: PARSENAME path=12.869736000000/PIO.A
> 
> : Success
> 
> ERR: Failed to open USB DS9490 adapter at 001/016.
> 
> : Permission denied
> 
> ERR: Failed to reconnect USB DS9490 adapter!
> 
> : Permission denied
> 
> ERR: Failed to open USB DS9490 adapter at 001/016.
> 
> : Permission denied
> 
> ERR: Failed to reconnect USB DS9490 adapter!
> 
> : Permission denied
> 
> ERR: BUS_reconnect, returned error = -5
> 
> : Permission denied
> 
> INFO: PARSENAME path=12.869736000000/PIO.A
> 
> : Success
> 
> The last block has been printed again with every attempt to switch
> PIO.A.
> 
> In the meantime, I got from dmesg USB error messages like this: 
> 
> usb 1-1: new full speed USB device using uhci_hcd and address 15
> 
> 0: addr=81, size=32, dir=IN, type=3
> 
> 1: addr=2, size=16, dir=OUT, type=2
> 
> 2: addr=83, size=16, dir=IN, type=2
> 
> usb 1-1: USB disconnect, address 15
> 
> usb 1-1: new full speed USB device using uhci_hcd and address 16
> 
> 0: addr=81, size=32, dir=IN, type=3
> 
> 1: addr=2, size=16, dir=OUT, type=2
> 
> 2: addr=83, size=16, dir=IN, type=2
> 
> usb 1-1: usbfs: USBDEVFS_CONTROL failed cmd owserver rqt 64 rq 2 len 0
> ret -71
> 
> usb 1-1: USB disconnect, address 16
> 
> usb 1-1: new full speed USB device using uhci_hcd and address 17
> 
> 0: addr=81, size=32, dir=IN, type=3
> 
> 1: addr=2, size=16, dir=OUT, type=2
> 
> 2: addr=83, size=16, dir=IN, type=2
> 
> I think the problem is the usb adapter gets enumerated automatically,
> and gets address 17 instead of 16, so it can't be found by the
> reconnect function.
> 
> Hope that helps.
> 
> Jan
> 
> -- 
> 
> "I'm not a programmer, but I play one at Microsoft."
> 



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to