Linux: Finding useful serial port names (i.e. NOT /dev/ttyUSB0!)Sun 03 April 2016
I was recently working on a project where I used USB-to-RS232 adapters to talk
to some devices via serial. We started with just one device, and referenced it
/dev/ttyUSB0. Big mistake!
Later, we added another serial device. It got plugged in first, and –
you guessed it – got assigned to
/dev/ttyUSB0. It took a wee bit of
time to figure out why the first device was spewing so much nonsense when I
Thankfully, there is a better way. The devices show up in
under a unique ID hardcoded into the device. All I had to do was plug in a
ls /dev/serial/by-id to find out a much more useful serial port
name, that would be the same whenever I used the same device. Hooray!