Controlling FTDI Devices
Using Python and pyftdi
Configuring Windows Drivers
When you connect one of these up to a Windows computer for the first time, it will enumerate as a virtual COM port as shown in This is a placeholder for the reference: fig-ftdi-ic-enumerating-as-a-virtual-com-port.
If you want to control the device from software such as Python, using the FTDI library, you may need to change the driver which is associated with the device. You can use Zadig to easily do this. Make sure you click “List all devices” in Zadig to see the FTDI device, as shown in This is a placeholder for the reference: fig-listing-all-devices-in-zadig.
Then select the FTDI device from the drop-down menu, as shown in This is a placeholder for the reference: fig-selecting-ft232r-usb-uart-in-zadig.
You should now see the current driver, which should be “FTDIBUS” by default. Change this to “libusb-win32” as shown in This is a placeholder for the reference: fig-changing-from-ftdibus-to-libusb-win32-driver-in-zadig. Then click “Replace Driver” to apply the change.
Once you do that, if you go back to the Device Manager, you should now see the FTDI device enumerating as a “libusb-win32” device as shown in This is a placeholder for the reference: fig-ftdi-device-in-device-manager-as-libusb-win32-device.
Configuring Linux Drivers
Device Has No langid Permissions Error
When calling Ftdi.list_devices() on Linux, you might get the exception: The device has no langid (permission issue, no string descriptors supported or device error)
If this is the case, you can add a udev rule to give all users permissions to access FTDI devices. Create the following file:
# udev rules for FTDI devices# This allows users to access FTDI USB devices without root privileges# FTDI vendor ID is 0x0403
# FT232R and other FTDI devices# Use permissions 666 so that no GROUP has to be definedSUBSYSTEM=="usb", ATTRS{idVendor}=="0403", MODE="0666"Reload udev rules with:
udevadm control --reload-rulesudevadm triggerAnd then unplug and plug the FTDI device back in.