.. my first post ..
I have a device (Atmel running their vendor development USB stack).
It has one configuration, one interface two alternates as they use an
isochronous endpoint and you can’t have that in the default configuration. With
the simplest example I can come up with I get ‘Errno 2 - entity not found’ on
any access to any endpoint on the device.
Heres the python, this is on MacOS
MacBook-Pro:eic rols$ python3
Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import usb
>>> dev=usb.core.find(idVendor=0x3eb,idProduct=0x2423)
>>> dev.set_configuration()
>>> dev.set_interface_altsetting(0,1)
>>> dev.write(0x83,'test')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/usb/core.py",
line 948, in write
self.__get_timeout(timeout)
File
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/usb/backend/libusb1.py",
line 824, in bulk_write
timeout)
File
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/usb/backend/libusb1.py",
line 920, in __write
_check(retval)
File
"/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/usb/backend/libusb1.py",
line 595, in _check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 2] Entity not found
>>>
There’s a print of the device at the bottom showing that it does have one
config and interface 0 has an alternate. I note that the framework has
correctly deduced the endpoint is bulk (it’s in bulk_write) and I tried a few
others and ended up in the same place in different functions (read_bulk,
write_int.. etc) so it has definitely parsed the descriptor properly and is
calling the right thing.
the USB Prober on the Mac shows the interface is configured, it wasn’t before I
did the dev.set_configuration() so I’m definitely talking to it and as it’s a
device I’m building I can see the correct setup calls were made to the board,
pretty sure it’s in config 0, interface 0/alternate 1.
I’ve tried explicitly claiming it, no difference. I don’t believe the OS claims
this interface as it’s all totally vendor and when restarted it comes up
unconfigured.
I get the same error reading or writing to any of the non-control interfaces.
Is there a step I missed here?
DEVICE ID 03eb:2423 on Bus 020 Address 035 =================
bLength : 0x12 (18 bytes)
bDescriptorType : 0x1 Device
bcdUSB : 0x200 USB 2.0
bDeviceClass : 0x0 Specified at interface
bDeviceSubClass : 0x0
bDeviceProtocol : 0x0
bMaxPacketSize0 : 0x40 (64 bytes)
idVendor : 0x03eb
idProduct : 0x2423
bcdDevice : 0x100 Device 1.0
iManufacturer : 0x0
iProduct : 0x0
iSerialNumber : 0x0
bNumConfigurations : 0x1
CONFIGURATION 1: 100 mA ==================================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x2 Configuration
wTotalLength : 0x45 (69 bytes)
bNumInterfaces : 0x1
bConfigurationValue : 0x1
iConfiguration : 0x0
bmAttributes : 0x80 Bus Powered
bMaxPower : 0x32 (100 mA)
INTERFACE 0: Vendor Specific ===========================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x4 Interface
bInterfaceNumber : 0x0
bAlternateSetting : 0x0
bNumEndpoints : 0x0
bInterfaceClass : 0xff Vendor Specific
bInterfaceSubClass : 0xff
bInterfaceProtocol : 0xff
iInterface : 0x0
INTERFACE 0, 1: Vendor Specific ========================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x4 Interface
bInterfaceNumber : 0x0
bAlternateSetting : 0x1
bNumEndpoints : 0x6
bInterfaceClass : 0xff Vendor Specific
bInterfaceSubClass : 0xff
bInterfaceProtocol : 0xff
iInterface : 0x0
ENDPOINT 0x81: Interrupt IN ==========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x81 IN
bmAttributes : 0x3 Interrupt
wMaxPacketSize : 0x40 (64 bytes)
bInterval : 0x1
ENDPOINT 0x2: Interrupt OUT ==========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x2 OUT
bmAttributes : 0x3 Interrupt
wMaxPacketSize : 0x40 (64 bytes)
bInterval : 0x1
ENDPOINT 0x83: Bulk IN ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x83 IN
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x40 (64 bytes)
bInterval : 0x0
ENDPOINT 0x4: Bulk OUT ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x4 OUT
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x40 (64 bytes)
bInterval : 0x0
ENDPOINT 0x85: Isochronous IN ========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x85 IN
bmAttributes : 0x1 Isochronous
wMaxPacketSize : 0x100 (256 bytes)
bInterval : 0x1
ENDPOINT 0x6: Isochronous OUT ========================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x6 OUT
bmAttributes : 0x1 Isochronous
wMaxPacketSize : 0x100 (256 bytes)
bInterval : 0x1
>>>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users