using ftdi d2xx drivers with python from raspberry pi on raspbian soft-float

  • Last Update :
  • Techknowledgy :

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
2232 RC:
   -- -- -- -
   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

Suggestion : 2

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?,I also switched from PyUSB to ftd2xx, because it's pure python, but it wasn't strictly necessary.,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:

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
2232 RC:
   -- -- -- -
   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

Suggestion : 3

EDIT: I got the info here : http://stackoverflow.com/questions/14615308/using-ftdi-d2xx-drivers-with-python-from-raspberry-pi-on-raspbian-soft-float,Yes, @kilokeith's notes are good ones (OSX added a built-in driver around Yosemite that doesn't quite work right with all devices), and in extreme situations you may also want cd /System/Library/Extensions && sudo rm -r FTDIUSBSerialDriver.kext,Hi! I've been facing the same kind of issue a couple of minutes ago, and the solution for me was to remove an already existing library for FTDI (ftdi_sio) by using rmmod ftdi_sio I did not get the same exact error as you do, but I was unable to get the vendorId and productId. After removing ftdi_sio, I was fully able to do so. Have a look if you have that library already installed and try uninstalling it.,BTW, this package helped me give one of my favorite presentations: Node for not HTTP: https://github.com/evantahler/node_for_not_http

[{
   description: 'FT232R USB UART',
   serialNumber: 'A603DUGT',
   locationId: 262,
   index: 0,
   vendorId: 0,
   productId: 0
}]
#!/usr/bin/env node

var ftdi = require('ftdi');

var settings = {
   'baudrate': 115200 / 2,
   'databits': 8,
   'stopbits': 2,
   'parity': 'none',
};

ftdi.find(function(err, devices) {
   console.log(devices)
   device = new ftdi.FtdiDevice(devices[0]);
   device.open(settings, function() {
      //
   });
});
sudo kextunload - bundle - id com.apple.driver.AppleUSBFTDI
sudo kextunload - bundle - id com.FTDI.driver.FTDIUSBSerialDriver

Suggestion : 4

Mamy Urządzenie USB sterowane przez sterowniki FTDI D2XX. To jest obecnie kontrolowane z komputera z systemem Windows za pośrednictwem interfejsu Python i jako projekt zabawy próbowałem przenieść kontrolę do Raspberry Pi (o 1/10 koszt komputera, nie wliczając koszt systemu operacyjnego).,Po zainstalowaniu sterowników FTDI D2XX i zbudowaniu modułu Pythona D2XX z PyUSB, ponownie wypróbowałem skrypt testowy. Znowu się nie udało. Moduł d2xx mógł odczytać libftd2xx.so biblioteka nie ma problemu, ale z jakiegoś powodu nie mógł po prostu rozmawiać z urządzeniem.,Z pakietem FTDI jest test, pod release/examples/EEPROM/read. Musisz go zbudować, ale to po prostu kwestia wpisania make. Uruchamiając go (przez sudo), nie udało się otworzyć urządzenia USB, więc najwyraźniej nie był to PyUSB. Po przeszukaniu znalazłem odniesienie do sterownika, ftdi_sio, i że może on kolidować z innymi sterownikami D2XX. Więc, używając lsmod , zobaczyłem ftdi_sio był już domyślnie zainstalowany, więc uruchomiłem rmmod ftdi_sio. Potem wszystko działało. Polecenie read powinno pokazywać coś takiego: , sterowniki FTDI D2XX do rozmowy z naszym urządzeniem FTDI.

Kiedy wszystko zostało zrobione, napisałem prosty skrypt Pythona, aby porozmawiać z chipem FTDI. UWAGA Musisz uruchomić przez sudo.

import d2xx
jd = d2xx.open(0)
pd = jd.eeRead()
print pd

Z pakietem FTDI jest test, pod release/examples/EEPROM/read. Musisz go zbudować, ale to po prostu kwestia wpisania make. Uruchamiając go (przez sudo), nie udało się otworzyć urządzenia USB, więc najwyraźniej nie był to PyUSB. Po przeszukaniu znalazłem odniesienie do sterownika, ftdi_sio, i że może on kolidować z innymi sterownikami D2XX. Więc, używając lsmod , zobaczyłem ftdi_sio był już domyślnie zainstalowany, więc uruchomiłem rmmod ftdi_sio. Potem wszystko działało. Polecenie read powinno pokazywać coś takiego:

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
2232 RC:
   -- -- -- -
   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