Distinguishing between different FTDI devices

Just a short note for myself and everybody who will find this via google ūüėČ

At work I needed to distinguish between five tty devices in linux, which in this case were almost identical FTDI to TTL UART adapters.

I thought of using udev rules for it and give each one a specific name in the file system based on the FTDI device id/serial number. Fortunately I found an easier solution: you can access the device not via /dev/ttyUSB0 through /dev/ttyUSB4 but via /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AD023MTX-if00-port0, which is a symbolic link to the corresponding /dev/ttyUSB*.

To match the tty device to the physical device I needed to collect all serial numbers of the adapters. In the above example this is¬†AD023MTX.¬†I found this serial number out via executing¬†udevadm info –name=/dev/ttyUSB0 –attribute-walk, where you need to look for a line beginning with¬†ATTRS{serial}.