0
$\begingroup$

Rosanswers logo

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.


Originally posted by Eric Perko on ROS Answers with karma: 8406 on 2011-02-16

Post score: 0

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

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.


Originally posted by tfoote with karma: 58457 on 2011-02-16

This answer was ACCEPTED on the original site

Post score: 9


Original comments

Comment by mjcarroll on 2011-02-16:
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".

Comment by tfoote on 2011-02-16:
copied to work around http://askbot.org/en/question/293/how-can-an-admin-answer-own-question-and-accept-it

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by Eric Perko with karma: 8406 on 2011-02-16

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

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)


Originally posted by Fabian Saccilotto with karma: 51 on 2012-11-29

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.