I just began to use pyusb, and basically I'm playing with the sample code here.
I'm using Windows7 64 bit, and downloaded the zip version from https://walac.github.io/pyusb/. Backend is libusb-1.0.19 that is downloaded the windows binary from http://libusb.info/.
All of my code is:
dev = usb.core.find(idVendor=3544, idProduct=9736)
if dev is None:
sys.stdout.write("No device found")
return;
print "deviceClass = " + str(dev.bDeviceClass);
for cfg in dev:
sys.stdout.write("configuration: " + str(cfg.bConfigurationValue) + '\n')
for intf in cfg:
sys.stdout.write('\tInterface: ' + \
str(intf.bInterfaceNumber) + \
',' + \
str(intf.bAlternateSetting) + \
'\n')
for ep in intf:
sys.stdout.write('\t\tEndpoint: ' + \
str(ep.bEndpointAddress) + \
',' + \
str(ep.bmAttributes) + \
'\n')
dev.set_configuration()
At the ending line, I got
File "test.py", line 44, in find_mine
dev.set_configuration()
File "c:\Python27\lib\site-packages\usb\core.py", line 842, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "c:\Python27\lib\site-packages\usb\core.py", line 128, in managed_set_configuration
self.managed_open()
File "c:\Python27\lib\site-packages\usb\core.py", line 106, in managed_open
self.handle = self.backend.open_device(self.dev)
File "c:\Python27\lib\site-packages\usb\backend\libusb1.py", line 778, in open_device
return _DeviceHandle(dev)
File "c:\Python27\lib\site-packages\usb\backend\libusb1.py", line 640, in __init__
_check(_lib.libusb_open(self.devid, byref(self.handle)))
File "c:\Python27\lib\site-packages\usb\backend\libusb1.py", line 590, in _check
raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
I have several USB devices installed, but only see this issue when I try to set_configuration
for my USB flash drive...
Is this because I can't use pyusb to access the flash drive? Or there's anything I missed...