Ubuntu article——How to bind the serial port of the peripheral when the peripheral has the same driver and the id is the same

For example: A and B have the same driver. When they are plugged into the computer, lsusb finds that the id is the same, and the serial port cannot be bound by the way of binding id.

At this time, it can be realized by binding the USB physical interface, and the two devices AB and AB are plugged into the fixed USB port.

specific method:

1. Check which ttyUSB* corresponds to A and B by ls /dev (unplug the device and see which ttyUSB* is missing).

ls /dev

2. Use the following command to find the devpath corresponding to A or B (assuming it is ttyUSB0).

udevadm info --attribute-walk --name=/dev/ttyUSB0

Find the ATTRS{devpath} field in the device information, such as ATTRS{devpath}=="5"

3. Add a serial port rule file in the /etc/udev/rules.d directory, such as port1.rules, and edit its content as follows (permission is required for editing)

KERNEL=="tty*", ATTRS{devpath}=="5",MODE="0666", GROUP:="dialout",  SYMLINK+="port1"

ps: Just change the port1 in the content to the name you need

4. Unplug the device, refresh the serial port rules, and then plug in the device to correctly bind it to the name you want

sudo service udev reload
sudo service udev restart

Guess you like

Origin blog.csdn.net/u011391361/article/details/128331593