FT232H - python_GPIO ftdi_usb_open failed
Hi,
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
The guide link is wrong
Fixed. Thanx for pointing it out!