After connecting an FTDI device to the USB port, FT_OpenEx()
returns an error code 2 which is FT_DEVICE_NOT_FOUND
. However on running "lsusb" in the terminal, the FTDI device does show up. What is causing FT_Open_Ex()
to return FT_DEVICE_NOT_FOUND
if the device is listed by lsusb? What are the possible issues and solutions?
Output of lsusb:
Bus 001 Device 003: ID 0bda:5776 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 8087:8000 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Output of dmesg | grep FTDI :
[28153.244220] usbserial: USB Serial support registered for FTDI USB Serial Device
[28153.244260] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
[28153.244509] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
Output of dmesg | grep -i FTDI:
[28153.244206] usbcore: registered new interface driver ftdi_sio
[28153.244220] usbserial: USB Serial support registered for FTDI USB Serial Device
[28153.244260] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
[28153.244509] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
After connecting an FTDI device to the USB port, FT_OpenEx()
returns an error code 2 which is FT_DEVICE_NOT_FOUND
. However on running "lsusb" in the terminal, the FTDI device does show up. What is causing FT_Open_Ex()
to return FT_DEVICE_NOT_FOUND
if the device is listed by lsusb? What are the possible issues and solutions?
Output of lsusb:
Bus 001 Device 003: ID 0bda:5776 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 8087:8000 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Output of dmesg | grep FTDI :
[28153.244220] usbserial: USB Serial support registered for FTDI USB Serial Device
[28153.244260] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
[28153.244509] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
Output of dmesg | grep -i FTDI:
[28153.244206] usbcore: registered new interface driver ftdi_sio
[28153.244220] usbserial: USB Serial support registered for FTDI USB Serial Device
[28153.244260] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
[28153.244509] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
One possible issue:
If you have no root permissions while using the program (which uses the FT_OpenEx function) you get error code 2
Solution to this specific issue:
sudo ./"your FT program"
Do you have read/write permissions on the device? can you try sudo chmod 666 /dev/ttyUSB0
to make this permanent make a udev rule
create this file /etc/udev/rules.d/99-ftdi.rules
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS={idProduct}=="6001"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.