Welcome to the new Linux Foundation Forum!

Usb devices need fixed name in /dev/

Hi,



I'm currently having the following problem:



We have a c++ application that expects fixed device names for usb devices. For example /dev/ttyU1, /dev/ttyU2, ... .

A certainty we have is that we know for sure that each usb device is always connected to the same usb port.



- We try to accomplish to have the fixed device names by writing a udev rule for each device. We write the rule based on the KERNELS attribute which is in fact the pci bus topology

Example: KERNEL=="ttyUSB*", KERNELS=="3-4:1.0", SYMLINK+="ttyU1"



The problem here is that the pci bus id sometimes changes after a reboot. So the rule doens't work in that case



- Another attempt was using Vendor Id, serial, etc.



The problem here is that we cannot uniquely identify all devices. The usb to serial converters that we have been using for years have the same serial number.





So basically I have 2 questions:

- What is the best appraoch to communicate to a device that is always connected to the same Usb port?

- Is there a way I can force the pci bus enumeration to be constant over reboot?

Sign In or Register to comment.