Hi all.
I wrote a simple program to communicate with a USB peripheral which is supposed
to send A/D samples to the host by bulk transfer.
I have the impression that the enumeration is normal (see lsusb -v output
below).
When the program:
def main(args):
dev = usb.core.find(idVendor = VID, idProduct = PID)
if dev is None:
raise ValueError('Device not found')
dump_interfaces(dev)
dev.set_configuration()
return 0
is run, I get:
1
0,0
129
1
Traceback (most recent call last):
File "test_pyusb.py", line 58, in <module>
sys.exit(main(sys.argv))
File "test_pyusb.py", line 52, in main
dev.set_configuration()
File "/usr/lib64/python2.7/site-packages/usb/core.py", line 819, in
set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "/usr/lib64/python2.7/site-packages/usb/core.py", line 129, in
managed_set_configuration
self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
File "/usr/lib64/python2.7/site-packages/usb/backend/libusb1.py", line 786,
in set_configuration
_check(self.lib.libusb_set_configuration(dev_handle.handle, config_value))
File "/usr/lib64/python2.7/site-packages/usb/backend/libusb1.py", line 592,
in _check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno None] Other error
Note that the output says "Other error", not Unknown error - of which I found
several references.
When tested with a minimalistic C program, also with libusb 1.0.20, the transfer
actually starts, but stops after a couple of 512 data blocks.
Questions:
- In C, I have code that detaches the kernel driver if necessary. Is this
necessary
here? I didn't find any reference in the tutorial.
- Any other tests I can do?
The system is Linux, kernel 4.1.6, Slackware 14.1, and libusb 1.0.20.
This is the lsusb -v output for the device:
Bus 001 Device 014: ID 1cbe:0003 Luminary Micro Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1cbe Luminary Micro Inc.
idProduct 0x0003
bcdDevice 1.00
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 5
bmAttributes 0xc0
Self Powered
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 4
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0003
Self Powered
Remote Wakeup Enabled
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
pyusb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyusb-users