Using FTDI D2XX drivers with Python from Raspberry Pi on raspbian soft-float

假如想象 提交于 2019-11-28 19:01:29
TheDuke

I wasn't sure where the problem lay: Was it PyUSB, an issue with FTDI's libftd2xx.so or some issue with the Debian distribution?

With the FTDI package there's a test, under release/examples/EEPROM/read. You must build it, but that's simply a matter of typing make. Running it (via sudo), it failed to open the USB device, so clearly it wasn't PyUSB. After poking around, I found a reference to a driver, ftdi_sio, and that it could conflict with other D2XX drivers. So, using lsmod, I saw ftdi_sio was already installed by default, so I ran rmmod ftdi_sio. After that, everything worked. The read command should show something like this:

Library version = 0x10112
Opening port 0
FT_Open succeeded.  Handle is 0xf7d240
FT_GetDeviceInfo succeeded.  Device is type 4.
FT_EE_Read succeeded.
Signature1 = 0
Signature2 = -1
Version = 1
VendorId = 0x0407
ProductId = 0x6009
Manufacturer = MagicIncorporated
ManufacturerId = wo
Description = MyCompany Test Board
SerialNumber = testit_028
MaxPower = 44
PnP = 1
SelfPowered = 0
RemoteWakeup = 1
2232RC:
-------
    Rev5 = 0x1
    IsoInA = 0x0
    IsoInB = 0x0
    IsoOutA = 0x0
    IsoOutB = 0x0
    PullDownEnable5 = 0x0
    SerNumEnable5 = 0x0
    USBVersionEnable5 = 0x0
    USBVersion5 = 0x110
    AIsHighCurrent = 0x0
    BIsHighCurrent = 0x0
    IFAIsFifo = 0x0
    IFAIsFifoTar = 0x0
    IFAIsFastSer = 0x0
    AIsVCP = 0x0
    IFBIsFifo = 0x0
    IFBIsFifoTar = 0x0
    IFBIsFastSer = 0x0
    BIsVCP = 0x0
Returning 0

I also switched from PyUSB to ftd2xx, because it's pure python, but it wasn't strictly necessary.

Mike

There is a special version of the libftd2xx 1.1.12 that fixes the problems on Raspberry pi. That would probably fix your problem.

I forgot where I found it, but I have a copy on the download page of my website, Lightput Download page.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!