Getting this all set up on Windows is not fun - but it is possible. Follow each step below to get it working on Windows
Have Python 3 Installed
We assume you already have Python 3 installed on your computer. Note we do not support Python 2 - it's deprecated and no longer supported!
At your command line prompt of choice, check your Python version with python --version
Plug in FT232H & Fix Driver with Zadig
Unlike Mac or Linux, Windows doesn't like devices that are 'driverless' - every hardware device must have a driver attached to it. To fix the driver on Windows, we must use a tool called Zadig
Download the appropriate Zadig tool for your version of Windows at its homepage. This tool simplifies the installation of a libusb driver for the FT232H device.
Before you run the tool unplug all FTDI devices from your computer. This includes devices like Arduinos which include an FTDI chip as a USB to serial converter. You want to unplug these devices to make sure you don't accidentally select one with the tool and replace its driver.
After all the FTDI devices are unplugged, plug in your FT232H breakout to the computer so it is the only FTDI device connected to the computer.
Now run the Zadig tool executable you just downloaded (there is no installation necessary, the executable is the program). Click the Options menu and select the List All Devices item below:
The list box of devices should populate with many devices. Select the USB Serial Converter device shown below.
Note: Make sure to select the device with Driver equal to FTDIBUS and USB ID equal to 0403 6014! If you pick the wrong device you might accidentally uninstall another device's driver and make it inoperable.
Click the up/down arrows on the driver select box to the right of the green arrow and select the libusbK driver as shown above.
Now click the Replace Driver button to replace the FTDI driver with the libusbK-based driver. After the driver replacement finishes you can close Zadig tool.
To check that the driver was successfully replaced, open Device Manager from Control Panel or searching in the Start menu. You should see a new top level node libusbK devices and the USB Serial Converter underneath it as shown below.
If you see the libusb-win32 node and USB serial device, move on to the next step to install libftdi.
If you don't see the libusb-win32 node, try unplugging and plugging back in the FT232H breakout. If you still don't see the node, run Zadig tool again and follow the steps above again to make sure you replace the FTDI driver for the device with the libusb-win32 driver.
pip3 install pyusb
pip3 install pyftdi
And then move to the Test pyusb and pyftdi section below. If the install runs into issues or doesn't seem to work, you may need to try Option 2. This is what it originally took to set things up on Windows. However, it has been reported that the latest version of pyusb "just works", so you might get lucky :)
Option 2 - Install pyftdi and (fixed) pyusb
Next lets install pyusb and pyftdi. We have to do a little trickery here so before you start run
pip3 uninstall pyusb
pip3 uninstall pyftdi
(or pip instead of pip3 if that's how you have it named)
To make sure you do not have pyusb and pyftdi installed
Run them again to make absolutely sure!
We need to get a fork of pyusb to fix a bug that affects windows:
git clone https://github.com/minkustree/pyusb.git
Then
cd pyusb
python setup.py install
if you get a permission denied error, try
python setup.py install --user
Now you can run pip install pyftdi
Test pyusb and pyftdi
Now that you have pyusb and pyftdi installed correctly, run python and paste in the following (with the FT232H plugged in)
import usb
import usb.util
dev = usb.core.find(idVendor=0x0403, idProduct=0x6014)
print(dev)
You should get something like the following, not that dev
is None
or any other weird failure
If you get usb.core.NoBackendError: No backend available
Download libusb 1.0.23, uncompress it with WinRar or some other decompression tool that can open 7z files.
If you are on 64-bit Windows, copy the MS64\dll\libusb-1.0.dll
file into C:\Windows\System32
and C:\Windows\SysWOW64I
If you are on 32-bit Windows, copy the MS32\dll\libusb-1.0.dll
file into C:\Windows\System32
Set Environment Variable
You must do this every time before running circuitpython code, you can set it permanently in windows if you like, for now just type into the same cmd window you're using with Python
set BLINKA_FT232H=1
If you are using Windows Powershell, the syntax is a little different. In that case do:
$env:BLINKA_FT232H=1
Check Platform was detected
In the same command window you set BLINKA_FT232H=1
env var, run python
and run
import board
dir(board)
at the Python REPL. If you get no errors, and you see a list of all the pins available - you're good to go!
Text editor powered by tinymce.