Did you know that --usb=ALL and --i2c=ALL:ALL will do the scanning for you?
I think the serial hasn't actually hung, it's just a very long sequence (minutes). The code certainly wasn't tuned for efficiently finding bad port, but rather finding the right settings for configuration problems. So there is a long timeout for each attempt (5 seconds) and we try many times with both harware flow control and not. We could have a "quick test" option, or even better, a little utility that just tests whether a serial bus master is available. (just tries and returns the answer, could even try the ports in parallel). Paul Alfille On Mon, Aug 15, 2011 at 9:13 AM, Jan Kandziora <j...@gmx.de> wrote: > Hello, > > in my application, I have an auto-detection scheme to find out which host > adapter(s) the machine has. Basically I probe each /dev/i2c-*, /dev/ttyS*, > /dev/ttyUSB* and usb one after another to find out if there is a onewire > host > on that port. > > That works fine with USB and I²C, but with serial ports, owfs hangs. No > timeout. Tested with latest cvs. > > ------tcl source------ > package require ow > ow open /dev/ttyS0 > ...hanging... > > strace shows me something is going on during this "hanging", but I don't > find > the place in the source where that endless loop happens. > > -------strace------- > open("/dev/ttyS0", O_RDWR|O_NOCTTY|O_NONBLOCK|O_LARGEFILE) = 3 > ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo > ...}) = 0 > ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo > ...}) = 0 > ioctl(3, SNDCTL_TMR_CONTINUE or TCSETSF, {B9600 -opost -isig -icanon -echo > ...}) = 0 > ioctl(3, TCFLSH, 0x2) = 0 > ioctl(3, TCSBRK, 0) = 0 > select(4, NULL, [3], NULL, {5, 0}) = 1 (out [3], left {4, 999986}) > write(3, "\301", 1) = 1 > ioctl(3, TCSBRK, 0x1) = 0 > nanosleep({0, 4000000}, 0xbfa6b2d0) = 0 > ioctl(3, TCFLSH, 0x2) = 0 > select(4, [3], NULL, NULL, {0, 1000}) = 0 (Timeout) > ioctl(3, TCFLSH, 0x2) = 0 > nanosleep({0, 5000000}, 0xbfa6b220) = 0 > select(4, NULL, [3], NULL, {5, 0}) = 1 (out [3], left {4, 999992}) > write(3, "q", 1) = 1 > ioctl(3, TCSBRK, 0x1) = 0 > nanosleep({0, 5000000}, 0xbfa6b220) = 0 > ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo > ...}) = 0 > ioctl(3, SNDCTL_TMR_CONTINUE or TCSETSF, {B9600 -opost -isig -icanon -echo > ...}) = 0 > ioctl(3, TCFLSH, 0x2) = 0 > nanosleep({0, 5000000}, 0xbfa6b220) = 0 > select(4, [3], NULL, NULL, {0, 1000}) = 0 (Timeout) > select(4, NULL, [3], NULL, {5, 0}) = 1 (out [3], left {4, 999992}) > write(3, "\17", 1) = 1 > ioctl(3, TCSBRK, 0x1) = 0 > select(4, [3], NULL, NULL, {5, 0}) = 0 (Timeout) > ioctl(3, TCSBRK, 0x1) = 0 > ioctl(3, TCFLSH, 0x2) = 0 > nanosleep({0, 5000000}, 0xbfa6b220) = 0 > select(4, NULL, [3], NULL, {5, 0}) = 1 (out [3], left {4, 999991}) > write(3, "q", 1) = 1 > ioctl(3, TCSBRK, 0x1) = 0 > nanosleep({0, 5000000}, 0xbfa6b220) = 0 > ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo > ...}) = 0 > ioctl(3, SNDCTL_TMR_CONTINUE or TCSETSF, {B9600 -opost -isig -icanon -echo > ...}) = 0 > ioctl(3, TCFLSH, 0x2) = 0 > nanosleep({0, 5000000}, 0xbfa6b220) = 0 > select(4, [3], NULL, NULL, {0, 1000}) = 0 (Timeout) > select(4, NULL, [3], NULL, {5, 0}) = 1 (out [3], left {4, 999992}) > write(3, "\17", 1) = 1 > ioctl(3, TCSBRK, 0x1) = 0 > select(4, [3], NULL, NULL, {5, 0}) = 0 (Timeout) > ioctl(3, TCSBRK, 0x1) = 0 > ioctl(3, TCFLSH, 0x2) = 0 > select(4, NULL, [3], NULL, {5, 0}) = 1 (out [3], left {4, 999991}) > write(3, "\305", 1) = 1 > ioctl(3, TCSBRK, 0x1) = 0 > select(4, [3], NULL, NULL, {5, 0} <unfinished ...> > -------end strace------- > > Any pointers? > > Kind regards > > Jan > > > ------------------------------------------------------------------------------ > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Owfs-developers mailing list > Owfs-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/owfs-developers >
------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers