2

Hello there @codedstructure,

I'm able to import the pylibftdi module and list my FTDI devices using python (2.7) and have installed pylibftdi using pip3, but running the list_devices example outputs nothing:

pi@raspberrypi:~ $ python -m pylibftdi.examples.list_devices
FTDI:FT230X Basic UART:DA00TWHT
FTDI:FT230X Basic UART:DA00TWHN
FTDI:FT230X Basic UART:DA00TN7R
pi@raspberrypi:~ $ python3 -m pylibftdi.examples.list_devices
pi@raspberrypi:~ $ 

Running python 3.4, I can show libftdi is installed:

Python 3.4.2 (default, Oct 19 2014, 13:31:11) 
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylibftdi import Driver; print(Driver().libftdi_version())
libftdi_version(major=1, minor=0, micro=0, version_str=b'1.0', snapshot_str=b'v1.0')

Is there something else I can check?

1 Answers1

3

Solution found:

Needed to modify the driver.py file in my python 3 dist-packages folder to recognize the FTDI devices (from Atlas Scientific).

Specifically, pylibftdi needed some tweaking to see USB PID (0x6015)

sudo nano /usr/local/lib/python3.4/dist-packages/pylibftdi/driver.py

Move down to the line 70 and add 0x6015 at the end of line.

Modified line:

USB_PID_LIST = [0x6001, 0x6010, 0x6011, 0x6014, 0x6015]

This was done for the install of pylibftdi on python 2.7, but overlooked when installing pylibftdi for python 3.x.

Problem solved!!

  • This worked very well! In my case, the Python dist-packages folder was different from one in the answer. I had to run 'pip3 show pylibftdi' which gave me 'Location: /home/username/.local/lib/python3.6/site-packages'. Then I have edited the driver.py file. – Valentyn Jun 10 '19 at 14:55
  • It looks like you can add devices programatically (https://pylibftdi.readthedocs.io/en/0.15.0/how_to.html) >>>> from pylibftdi import USB_PID_LIST, USB_VID_LIST, Device >>> USB_PID_LIST.append(0x1234) >>> >>> dev = Device() # will now recognise a device with PID 0x1234. – Valentyn Jun 10 '19 at 15:07