Multi-serial USB Device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First, please point me where I should be asking if this is not the
place.  Thanks.

I've got a number of USB devices I need to connect to a data-logging
machine.  Each device presents as 3 USB serial ports which are
properly recognized and setup as ttyUSB[0-2] once I added the right
vendor and product numbers to the module loader configs.  When I
connect the second device, I get ttyUSB[3-5].  I've been able to setup
udev rules that recognize the serial numbers for each of the devices
and can setup symlinks; i.e. ttyLogger1USB[0-2] -> ttyUSB?.
Something like so...

    KERNEL=="ttyUSB*", SYSFS{serial}=="111", SYMLINK+="ttyLogger1USB%n"
    KERNEL=="ttyUSB*", SYSFS{serial}=="222", SYMLINK+="ttyLogger2USB%n"
    KERNEL=="ttyUSB*", SYSFS{serial}=="333", SYMLINK+="ttyLogger3USB%n"

My hitch is that the %n values on the end of the SYMLINK setting
result in 0-2 for the first logger found, 3-5 for the second, etc.  I
really want them to be 0-2 for all of the loggers.  But, looking at
the udevinfo for the 3 ports on one logger, they're identical.

I tried adding a PROGRAM setting to run a little script that looked to
count the /dev/ttyLogger1USB* devices had already been created and it
always returned 0.  Are the device files and symlinks created in
parallel or in bulk at the end and thus this approach wouldn't work?

I tried another PROGRAM that opened the port and polled the logger to
see what port this was (that's supported by the device's protocol) but
the device file didn't exist yet.  Is there a way to trigger this
approach after the device file has been created? Is there a way to
temporarily create the device in the script instead?

Anyone got a suggestion on how to solve this?

Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux