FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: Issues with using D2XX driver without root privileges on Ubuntu (udev)  (Read 12897 times)

prex

  • Newbie
  • *
  • Posts: 2
    • View Profile

Hi there,

I hope this is not a stupid question and that this community can help me.

I'm using FTDI D2XX driver on a virtual Ubuntu 16.04. However, I have some issues with accessing my devices without root privileges. The EEPROM/read example, which comes with the driver just worked fine executed as root. However, I can not execute it as "normal" user. And I have the same problem with my own software. Therefore, I was trying to set up an udev rule. Seems to work fine on my "physical" Ubuntu 16.04, but not on VMware. I have the exactly same rule on my "physical" Ubuntu and it works without root privileges. This is what I did:

Code: [Select]
cd /etc/udev/rules.d

sudo gedit 52-thorlab.rules

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

sudo udevadm control –reload-rules

Any help is appreciated.

Best,

prex
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 892
    • View Profile

Hello,

Thanks for your question.

As you have discovered, elevated privileges are required to interact with the USB subsystem via a user space program. Thus requiring any software which makes use of the D2XX library to be run with these elevated privileges, this is usually achieved by running as 'root'.

I have found the following useful when writing udev rules:
http://www.reactivated.net/writing_udev_rules.html

I would suggest that if the rule works on a physical Ubuntu system, that it should work on a Virtual Machine. Although in my practical experience this is rarely the case, and VMs can be tedious to debug.

Unfortunately we have limited experience with VMs here at FTDI, hopefully one of the other forum members could point you in the right direction. Otherwise the VMware or Ubuntu forums are likely to be helpful with such an issue.

VMware:
https://communities.vmware.com/community/vmtn/overview

Ubuntu:
https://ubuntuforums.org/

Best Regards,
FTDI Community
Logged

prex

  • Newbie
  • *
  • Posts: 2
    • View Profile

Thanks for your reply. I actually spent some more time trying to get the right privileges on VMWare Ubuntu and finally succeeded. I added my user to the dialout and tty group:
Code: [Select]
sudo usermod -aG tty user
sudo usermod -aG dialout user

And then added another udev rule, which shouldn't be necessary anymore... but now it's working.

99-ftdi.rules
Code: [Select]
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="faf0", GROUP="users", MODE="0666"

And then restarted the whole system.
Logged