random findings by wt8008
RSS icon Home icon
  • FTDI USB-Serial Converter for New Products

    Posted on April 14th, 2011 wt8008 No comments

    If you have a generic FTDI product that simulates a serial port (COM port), but it does not register as /dev/ttyUSB0 in Ubuntu/Linux, it could be that the device is too new or a rare product (industrial use) and not a recognized vendor/product ID. (This also applies for products that use a USB-Serial bridge for communications.) You can attempt to tell if the product uses such a chip by taking a look at the ICs on the product itself or by the drivers it uses in Windows.

    Use lsusb to see what new shows when you plugin the USB device.

    Bus 002 Device 002: ID 413c:a005 Dell Computer Corp. Internal 2.0 Hub

    In this example the vendor ID is 413c and the product ID is a005.

    You can manually allow it to register by:

    sudo modprobe ftdi_sio
    sudo su -c "echo 413c a005 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id"

    using the vendor and product IDs from the previous step. It should show up as /dev/ttyUSB0 unless you already have another device plugged in. You can see the output of dmesg to determine the exact name/device file.

    You may need to give yourself permissions to read and write to the device.

    sudo chmod +rw /dev/ttyUSB0

    Auto Register when Connected

    For automatically preforming the commands upon connection create a file /usr/local/bin/serial-usb.sh with contents

    modprobe ftdi_sio
    echo 413c a005 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

    Give the file executable permissions with

    sudo chmod +x /usr/local/bin/serial-usb.sh

    Create a new udev rule to detect when the device is plugged in to run the previous script with a file in /etc/udev/rules.d/70-serial-usb.rules with the contents:

    ATTRS{idVendor}=="413c", ATTRS{idProduct}=="a005", RUN+="/usr/local/bin/serial-usb.sh"

    You may need to restart/reload udev by

    sudo /etc/init.d/udev restart