I'm running into issues reading from a USB device using PyUSB. If I run
import usb.core
dev = usb.core.find(idVendor=0x0403, idProduct=0x6001, serial_number="GAFR0000")
if dev is None:
raise ValueError('Not connected')
print(dev)
print(dev.read(0x81, 0x40))
it returns
Traceback (most recent call last):
File "D:\PycharmProjects\motorsusb\main.py", line 5, in <module>
raise ValueError('Not connected')
ValueError: Not connected
This happens using the FTDI driver (the usb device is using a ftdi chip to convert usb to serial). I tried Zadig to replace the driver with a WinUSB and libusb driver. Then I used the same code and it worked, printing me the devices description. The problem is that I need the FTDI Driver because the usb device is run through a different program, which doesnt work with other drivers(the usb device is a control for four step motors).I need to read and write to the device, when the other program isn't used so the are no connection issues. Just ignoring the other program is no option since I still need to use it.
Thanks for the help.