I am reading data from multiple identical USB-serial adapters under Ubuntu 10.1.
On occasion, their /dev/tty path changes (eg if other USB devices are connected on startup).
I need a way of repeatedly referring to the same adapter through any such changes.
The devices all have the same serial numbers, according to udevadm.
I think the most likely option is to identify an adapter by which port it is connected to (they don't get moved around).
I can find all sorts of interesting /dev paths that might work, but despite all the discussion about udev online, I can't locate a definitive statement about whether some of these paths are static if the device is plugged into a static port.
Best Answer
There is a solution. It's better late then never ;)
Use the following
udev
rule to map/dev/ttyUSB{?}
devices into the/dev/usb-ports/%bus_id-%port_id
link.Here is my
/etc/udev/rules.d/usb-parse-devpath.rules:
And the
usb-parse-devpath.pm
script:As you can see this helps us to create named links to
/dev/ttyUSB{?}
devices and place them at/dev/usb-ports
in the following format:bus_id-port_id
.For example, the next command gives me the following:
So, the
bus_id
is3
andport_id
is1
and now I have following in my/dev/usb-ports
:Regards.