I'd like to be able to access my Arduino that uses an FTDI USB-Serial device with a unique path. However, the order of /dev/ttyUSB devices depends on which device is plugged in first or USB bus initialization during the boot order. I'd like consistent paths across reboots so that I can use those paths in my launch files.
If you are running Ubuntu (or another flavor of Linux that uses udev), you can use a udev rule to get this result.
If you run the following as root
echo 'SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="sensors/ftdi_%s{serial}"' > /etc/udev/rules.d/52-ftdi.rules
you'll get a brand new udev rule that will create symlinks in /dev/sensors based on the unique serial numbers burned into the FTDI chip's EEPROM. You'll have to restart udev (or your entire PC) in order for this rule to take effect.
For example, if your Arduino's FTDI chip had a serial number of abc123, if you are using this udev rule after you plug the Arduino in, you will have a symlink of /dev/sensors/ftdi_abc123 that links to /dev/ttyUSB0 (or whichever /dev/ttyUSB device is appropriate if you have more than one). This way, you can use the path /dev/sensors/ftdi_abc123 in your launch files when configuring a node such as the xv_11_laser_driver.
If you are running Ubuntu (or another flavor of Linux that uses udev), you can use a udev rule to get this result.
If you run the following as root
echo 'SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="sensors/ftdi_%s{serial}"' > /etc/udev/rules.d/52-ftdi.rules
you'll get a brand new udev rule that will create symlinks in /dev/sensors based on the unique serial numbers burned into the FTDI chip's EEPROM. You'll have to restart udev (or your entire PC) in order for this rule to take effect.
For example, if your Arduino's FTDI chip had a serial number of abc123, if you are using this udev rule after you plug the Arduino in, you will have a symlink of /dev/sensors/ftdi_abc123 that links to /dev/ttyUSB0 (or whichever /dev/ttyUSB device is appropriate if you have more than one). This way, you can use the path /dev/sensors/ftdi_abc123 in your launch files when configuring a node such as the xv_11_laser_driver.
As I am not allowed to comment with my karma, I'll write an answer...
I had the same problem when working with the turtlebot and connecting the arbotix controller for test and setup purposes.
I made several udev rules for the roomba and the arbotix. udevadm is very helpful to identify properties of your devices to write the rules. Restarting the pc was not necessary (As the man page of udevadm says too)
On ubuntu I had to restart udev to get this to work: sudo /etc/init.d/udev restart
Asked: 2011-02-16 17:10:32 -0500
Seen: 1,941 times
Last updated: Dec 18 '12
turtlebot_bringup failed to connect to iCreate
Problems using avr_bridge, Arduino <-> ROS communication
avr_bridge example code not working with current git version?
Rosserial/Arduino Publishers and Subscribers
ROS, MIPS Linux, Open Wrt and Arduino
rosserial_arduino: trouble with too much messaging?
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.