I have searched the net for this issue but either this is too stupid or I was unable to find ist. So I ended up here.
Problem. I am using kamikaze 8.09.1 on an ASUS WL500P and I want to connect multiple serial converter by using the USB adapters. There ougth to be one single instance of a daemon prog per serial adapter that connects it to the outer world by using ethernet.
I am trying now to launch the daemon automagically when the serial device (FTDI) is plugged in. As long as I connect only one device, there is no problem as it always seem to use /dev/tts/0. But when I plug in the next, it uses /dev/tts/1 (who wonders) But now the problem.
On reboot of the box, coldplug finds e.g. two serial adapters and calls my hotplug script. Problem is: "How do I determine the device that has been assigned to the adapter just plugged in?" I tried dmesg of course but at the moment the hotplug script is called, dmesg already contains both events.
hub.c: USB hub found
hub.c: 4 ports detected
hub.c: new USB device 00:03.1-1.1.1, assigned address 4
usbserial.c: FTDI FT232BM Compatible converter detected
usbserial.c: FTDI FT232BM Compatible converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
hub.c: new USB device 00:03.1-1.1.2, assigned address 5
usbserial.c: FTDI FT232BM Compatible converter detected
usbserial.c: FTDI FT232BM Compatible converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
---- 1. hotplug appears here ---
I also checked /proc/bus/usb/device but did not find any clue of determing the device address fram that information.
How do I then determine the assigned device address that I do need to pass to my daemon program in my hotplug script?
Any tips are very much appreciated, really!!
Thanks for answering on this, Peter