Rosanswers logo


I have a FT232H connected to a 16 ch servo controller over I2C. Both boards are from Adafruit I've installed python 2.7 and all other necessary drivers and library according to this guide. I ran the Servo_Example.py (as sudo python Servo_Example.py) and the servo moves as expected.

The thing is, this library expects to be run as sudo, and I want to control this as a part of ROS, which is not supposed to be run as sudo (as far as I can see from documentation and forums).

The "Adafruit-part" works when running "sudo python script1.py" and the "ROS-part" works when running "python script2.py" The problem is when I try to combine these two into "script3.py". Running it with sudo gives library import from all ROS libraries (that was working fine earlier) and without sudo it seems that it doesn't have the rights to access the usb port.

With sudo the error message is:

ImportError: No module named xxx

(where xxx is the topmost non-commented line, and changes accordingly if I try to run the script with one of the libraries commented out)

Without sudo the error message is

RuntimeError: ftdi_usb_open failed with error -4: usb_open() failed 

(after I edited the driver to not include "check_running_as_root()" cause it failed with that anyway as I'm trying to avoid running as root)

running ls -l /dev/ttyUSB0 gives

crw-rw---- 1 root dialout 188, 0 Jan 30 10:59 /dev/ttyUSB0

Running udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0) gives a ton of information, sorting through it, I made a udev.rules file in /etc/udev/rules.d/

#FT2232 Adapter 
SUBSYSTEM=="tty", ACTION=="add", DRIVERS=="?*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", OWNER:="second_user", GROUP:="my_group", MODE:="0770"

after unplugging and running sudo udevadm control --reload-rules and plugging back in, this is updated to

crwxrwx--- 1 second_user my_group 188, 0 Feb 1 22:16 /dev/ttyUSB0

So, something is happening here at least, but it doesn't do much good. Running my python scripts still gives me ftdi_usb_open error. Any thoughts on how to move forward from here?

Regards Pengatom

Originally posted by Pengatom on ROS Answers with karma: 15 on 2016-01-30

Post score: 0

Original comments

Comment by duck-development on 2016-01-31:
The guide link is wrong

Comment by Pengatom on 2016-01-31:
Fixed. Thanx for pointing it out!


2 Answers 2


Rosanswers logo

Try to run the Programm as root (sudo your programming)

Add a udev rule to map the device to yours second_user.

I think the problem is that ftdi_usb_open opens the /dev/bus/usb device and not the ttyUSB0 device

If you like to ise the raw interface maybe there is then an conflict with the Linux tty Module driver.

It is an permission error see the solution here


Originally posted by duck-development with karma: 1999 on 2016-01-31

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by duck-development on 2016-02-01:
Did it help

Comment by Pengatom on 2016-02-01:
Thanks for helping me along here! - Sorry for not getting back before, haven't had time to do anything before now. I'm waay out of my comfort zone here, which is a good thing - but it means I'll need some more inputs. I've updated the question with some more info...

Comment by duck-development on 2016-02-02:
Please close the answer


Rosanswers logo

Well, I can only say The devil is in the detail! Last night I ended up with this:

SUBSYSTEM=="tty", ATTR{idProduct}=="6014", ATTRS{idVendor}=="0403", MODE="0660", GROUP="dialout"

and here is the solution:

SUBSYSTEM=="usb", ATTR{idProduct}=="6014", ATTRS{idVendor}=="0403", MODE="0660", GROUP="dialout"

Changing tty to usb, three small letters did the trick!

Thanks to duck-development for the input!

Originally posted by Pengatom with karma: 15 on 2016-02-02

This answer was NOT ACCEPTED on the original site

Post score: 1

Original comments

Comment by kubelvla on 2016-06-21:
Thanks, helped me solving same issue.A small remark: there are two calls of modprobe after the root check, they both fail, but who cares :D, the device disconnects as soon as the new driver writes to it. Unfortunately, they removed the "ignore_device" option from udev, that would be a clean solution


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.