Search code examples
windows-7libusb

pyftdi finds device under OS X but not Windows


I have an FTDI FT230XS plugged into my MacBook Pro. The following works under OS X / python3.6:

from pyftdi.ftdi import Ftdi
x = Ftdi()
x.open_bitbang_from_url('ftdi:///1')

However, I'm having trouble doing the same thing under VirtualBox running Windows 7 (32 bit). I've taken pains to make sure the USB device is present in the VirtualBox environment: I get the little "bu-dum!" sound when I plug it in, and serial.tools.list_ports.comports() confirms that it is present. However, the open fails:

>>> from pyftdi.ftdi import Ftdi
>>> x = Ftdi()
>>> x.open_bitbang_from_url('ftdi:///1')
Traceback (most recent call last):
  File "C:\...site-packages\pyftdi\usbtools.py", line 375, in parse_url
    candidates[idx]
IndexError: list index out of range

During handling of the above exception, another exception occurred:
...
pyftdi.usbtools.UsbToolsError: No USB device matches URL ftdi:///1

Any idea of what I should be doing differently?


Solution

  • Assuming you've already loaded libusb-win32 from some source (Zadig, libusb win32, etc), you need to declare the FTDI device to Windows as described in the documentation. A recap of the steps:

    • download and install libusb-win32-devel-filter-x.x.x.x.exe from the libusb-win32 Sourceforge site. Choose the latest release (currently 1.2.6.0) and make sure you download the devel-filter installer.
    • Plug in your FTDI device, click to run the installer and follow the directions. It should create a filter for your specific device.