Ubuntu – UDEV rules for FTDI not completely working

permissionsudevusb

I know this question has been asked many times but I cannot make it work. I have a FTDI serial-usb converter. I have generated 10-fhss-usb.rules in /etc/udev/rules.d/:

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="FTTA5DMA", SYMLINK+="fhss", GROUP="dialout", MODE="0777", RUN+="echo USB CONNECTED!"

I have also added my user to dialout group:

sudo usermod -a -G dialout $USER

and groups $USER returns:

jvgomez : jvgomez adm dialout sudo plugdev lpadmin sambashare

(The plugdev group was created following another post) Now, when I connect the USB, running ls -al I can see:

$ ls -al /dev/fhss
lrwxrwxrwx 1 root root 7 Jun  4 17:13 /dev/fhss -> ttyUSB0

$ ls -al /dev/ttyUSB0 
crw-rw-r-- 1 root dialout 188, 0 Jun  4 17:13 /dev/ttyUSB0

The echo USB CONNECTED! message is never displayed. And when I use screen /dev/fhss/ it immediately says [screen is terminating]. To make it work, I sill have to run chmod

$ sudo chmod a+rwx /dev/fhss 

And now:

$ ls -al /dev/ttyUSB0 
crwxrwxrwx 1 root dialout 188, 0 Jun  4 17:13 /dev/ttyUSB0

1) What am I missing? I still have to run chmod which is what I am trying to avoid.
2) What is the difference between using SUBSYSTEM=="tty" and SUBSYSTEM=="usb"?

Any help is welcome!

EDIT: adding NAME="my_device" as proposed in Usb udev rule never worked for me didn't change anything.

Best Answer

  • To make a FTDI breakout work on Ubuntu:

    Open the file /etc/group with root permissions:

    sudo nano /etc/group
    

    After that, search for tty:x5: and dialout:x20:

    Add your user to this groups typing your username in front of each line:

    tty:x5:<user>

    dialout:x20:<user>

    You can also use the next two commands to avoid search for the file:

    sudo usermod -aG tty <user>
    sudo usermod -aG dialout <user>
    

    Where <user>, is your user name.

    Finally, reboot your computer.

    If you want to use udev rules, connect the FTDI Module, then run:

    lsusb
    

    This will show the vendorID and the productID. For example:

    Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    

    Where 8087 is the vendorID, and 0024 the productID.

    Then, create a rule like this:

    ATTRS{idVendor}="8087", ATTRS{idProduct}="0024", MODE="0660", GROUP="dialout"
    
  • Related Question