FTDI USB Serial device programming

From Tekkotsu Wiki

Jump to: navigation, search

Contents


Introduction

USB serial devices are used to connect a computer to the iRobot Create or to Robotis Dynamixel servo controllers. These devices show up in Linux as /dev/ttyUSB0, /dev/ttyUSB1, etc.

Tekkotsu assumes that the Create will be /dev/ttyUSB0 and that the first Dynamixel controller will be /dev/ttyUSB1. But at boot time these device paths could be assigned in any order. To prevent this, we must use udev rules to assign specific paths to specific devices. This can be facilitated by assigning specific serial numbers to each of the robot's USB devices. For those devices that use an FTDI chip, one can do this using the FT_PROG utility.

Obtaining the FT_PROG Utility

This is a Windows-only utility. Download it from the FTDI utilities page, unzip the folder, and run the exe file. Note: you must have Microsoft .NET framework installed.

Programming The FTDI Chip Using FT_PROG

  1. Run FT_PROG.
  2. Plug in your USB device.
  3. In the FT_PROG window, click on Devices > Scan & Parse (or just hit F5).
  4. Select the device you want to program. There will probably only be one.
  5. Click on USB String Descriptors.
  6. Uncheck the "Auto Generate Serial No" box.
  7. Type the desired serial number into the "Serial Number" text box. (See below for a list.)
  8. Erase the text in the "Prefix" text box.
  9. Right click on "USB String Descriptors" and select "Program Device".
  10. Do the device scan again to confirm that the serial number has been changed. For example, if you are programming an iRobot Create serial cable, you should see "iRobot Auto-Generate" for the serial number.
  11. Unplug the USB device.

Recommended Serial Numbers

Serial numbers can be at most 6 alphanumeric characters.

   iRobot   iRobot Create USB serial cable
   dynAXRobotis Dynamixel controller for AX servos
   dynRXRobotis Dynamixel controller for RX servos
   dynMXRobotis Dynamixel controller for MX servos

Note: the Kobuki platform already has a platform-specific serial number that is recognized by our udev rule set, so you do not have to modify its serial number at all.

Using the Serial Numbers in Udev Rules

Once you've programmed the device serial numbers, you need to tell Linux to use them to assign the correct path to each device. This is done using udev rules. See the article on Linux Udev Rules for instructions on how to set up these rules for the robot you are using.

Checking Serial Numbers Under Linux

You can use the lsusb command to scan the USB bus. You must be root to access the serial number information. To scan specifically for FTDI devices, do:

sudo -s
lsusb -v -d 0403:

You can also use the udevadm program (an alternative to udevinfo for Ubuntu systems) to query the device:

udevadm info -q all -a -p /dev/ttyUSB0

Related Info

Linux Udev Rules