linuxvmwareudevftdid2xx

udev rules for FTDI device are not working in VMware Ubuntu 16.04


I have set up a VMware (14.1.1) environment with Ubuntu 16.04 where I was trying to control some FTDI devices over FTDI's D2xx driver. However, I can not open my FTDI device or communicate with it. Using

FT_CreateDeviceInfoList(&NumDevs);

tells me that there is a device available. However, if I try to open it with

ftStatus = FT_OpenEx(const_cast<char*>(tmp),FT_OPEN_BY_SERIAL_NUMBER, &keyHandle);

it gives me an error (ftStatus = 2). As far as I know, this error means that there is no device available.

If I execute the "EEPROM/read" example from the FTDI driver, everything works fine. Only difference is that I execute it as superuser (sudo ./read). Therefore, I was making an udev rule which I was hoping would solve my problem:

cd /etc/udev/rules.d

cd /etc/udev/rules.d

SUBSYSTEMS==”usb”,  ATTRS{idVendor}==”0403”, ATTRS{idProduct}==”faf0”, 
GROUP=”student”

sudo udevadm control –reload-rules

However, the problem still exists. If I'm running the exactly same thing on a very similar, physical Ubuntu 16.04 machine, everything works fine with this udev rule.

Is there a difference in how to define these rules when using a virtual system? But I have some other FTDI devices which just work fine with this rule:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a8b0", GROUP="users", MODE="0666"

I followed the installation guide from FTDI: http://www.ftdichip.com/Support/Documents/AppNotes/AN_220_FTDI_Drivers_Installation_Guide_for_Linux.pdf


Solution

  • I actually found a solution after quite some time trying. I found that it is important to shut down the system between the changes.

    I added my user to both the tty and dialout groups:

    sudo usermod -aG tty user
    sudo usermod -aG dialout user
    

    This should already be enough. But it seemed not to work, so I deleted my last udev rule and added:

    sudo gedit 99-ftdi.rules
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="faf0", GROUP="users", MODE="0666"
    sudo udevadm control --reload
    

    Then rebooted the whole system.