ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How can I get a unique device path for my Arduino/FTDI device

asked 2011-02-16 11:10:32 -0600

Eric Perko gravatar image

updated 2014-01-28 17:09:09 -0600

ngrennan gravatar image

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.

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
9

answered 2011-02-16 11:48:46 -0600

tfoote gravatar image

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.

edit flag offensive delete link more

Comments

This is exactly what we do. We choose some informative names as well, like /dev/lrf, /dev/motor_controller, /dev/power_board. It makes things easy to find for both ROS parameters and interfacing with a terminal (like screen) if your device's protocol is "human readable".
mjcarroll gravatar image mjcarroll  ( 2011-02-16 12:43:06 -0600 )edit
1

answered 2011-02-16 11:14:41 -0600

Eric Perko gravatar image

updated 2011-02-16 11:15:50 -0600

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.

edit flag offensive delete link more
1

answered 2012-11-28 23:42:33 -0600

Fabian Saccilotto gravatar image

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)

edit flag offensive delete link more
0

answered 2012-12-18 09:16:35 -0600

On ubuntu I had to restart udev to get this to work: sudo /etc/init.d/udev restart

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2011-02-16 11:10:32 -0600

Seen: 8,311 times

Last updated: Dec 18 '12