udev configuration ros

Display device has links

lsusb

Display mount point

ls /dev/ttyACM* /dev/ttyUSB*

You can see ttyUSB0and ttyUSB1which corresponds to a device uncertain, therefore, we need a way to ensure that after each boot unique device mount point corresponds to a certain device, so that our program can manipulate the correct corresponding USB device .

To /etc/udev/rules.dfolder create a .rulesfile, for example, called car.rules
such as adding content about

KERNEL=="ttyUSB*", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="666", SYMLINK+="car"

ATTRS for the device number, is lsusb see. MODE rights, SYMLINK mount called the car, so the program calls the /dev/carget the actual device, so that they will correspond ttyUSB *. So that regardless of the insertion port can be identified.

Get that done when it restart udev

sudo service udev reload
sudo service udev restart

Finally plug the device to see if the binding is successful

ls -l /dev/car

Guess you like

Origin www.cnblogs.com/wjundong/p/11109639.html