USB device file names not consistent
Posted: 26 Jan 2021, 12:40
We have an application where we connect one type of sensor to a external USB-RS485-adapter and another type of sensor connected to the RS485-port of our Connect+ module.
Our problem is that the device file names representing the ports doesn't stay the same at all system boots. Most of the time is the external USB-adapter represented by the device file name ttyUSB2 but sometimes it is represented by ttyUSB0 instead. The RS485 port is usually represented by the device file name ttyRS485 which is a symbolic link to the device file ttyUSB0. When the external USB adapter is represented by ttyUSB0 is the RS485 port represented by ttyRS485 which links to ttyUSB1.
It seems to me that the device file names are assigned in the order the USB devices are configured. Is there a way to avoid this race condition and ensure that the USB devices always are represented with the same device file names?
With regards,
Our problem is that the device file names representing the ports doesn't stay the same at all system boots. Most of the time is the external USB-adapter represented by the device file name ttyUSB2 but sometimes it is represented by ttyUSB0 instead. The RS485 port is usually represented by the device file name ttyRS485 which is a symbolic link to the device file ttyUSB0. When the external USB adapter is represented by ttyUSB0 is the RS485 port represented by ttyRS485 which links to ttyUSB1.
It seems to me that the device file names are assigned in the order the USB devices are configured. Is there a way to avoid this race condition and ensure that the USB devices always are represented with the same device file names?
With regards,