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?

  • 4
    This question appears to be off-topic because it is about linux in general, probably better in a linux stackexchange?
    – kolin
    Jun 3 '14 at 8:55
  • Agreed, but chaining multiple UART converters is a common task on a Pi. It's a super simple way of connecting multiple MCU's to the Pi without the hassles of networking an UART bus. Jun 3 '14 at 13:16

A partial solution is to use the links under /dev/serial:

$ lsusb
Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
$ ls /dev/ttyUSB*
$ ls /dev/serial/by-id/
$ ls /dev/serial/by-path

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.

  • I have FTDI adapters, so I might swap some of the PL2303's. Thanks for the pointers. Jun 3 '14 at 13:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.