I have several RS232 to TTL UART converters plugged into my Pi. The problem is that their device assignments change sporadically. Sometimes the first device gets /dev/ttyUSB0, and another time /dev/ttyUSB1 and so on. Is there a way to either hardcode these device assignments, or programmatically identify the device? I was thinking about parsing "lsusb -v" output, but maybe there's a simpler method?
A partial solution is to use the links under
$ lsusb … Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port $ ls /dev/ttyUSB* /dev/ttyUSB0 $ ls /dev/serial/by-id/ usb-067b_2303-if00-port0 $ ls /dev/serial/by-path platform-bcm2708_usb-usb-0:1.3:1.0-port0
I say partial, because some drivers aren't very good at identifying themselves as separate devices. Prolific adaptors are particularly bad at this; two or more PL2303 devices may swap ID at times. FTDI ones are better.