|
From: Sarah M. <iku...@ya...> - 2007-10-21 02:44:37
|
This is due to a particular line in the source that sets an error-occurred flag but not the numerical error code itself. I've tried posting analysis and solution here
(as user SMesser) and here (as user spinmess). Look for the libusb.c patch I've posted.
Yaniv Aknin <ya...@ak...> wrote: Hi,
I'm trying to use PyUSB on OSX (10.4.10) to enumerate USB devices. I'm not entirely certain why, but upon calling getString on a device (almost any device on my system at least, and I have a few), I'm getting a USBError, with usb_control_msg: unknown error.
My (slightly modified) lsusb.py source is:
osx:pyusb yaniv$ cat lsusb.py
#!/usr/bin/env python
import usb
import sys
for bus in usb.busses():
for dev in bus.devices:
try:
print "Bus %s Device %s: ID %04x:%04x %s" % (bus.dirname,dev.filename,dev.idVendor,dev.idProduct,dev.open().getString(1,30))
except:
print 'caught ', sys.exc_info()[1]
continue
osx:pyusb yaniv$ ./lsusb.py
caught usb_control_msg(DeviceRequestTO): unknown error
caught usb_control_msg(DeviceRequestTO): unknown error
caught usb_control_msg(DeviceRequestTO): unknown error
caught usb_control_msg(DeviceRequestTO): unknown error
caught usb_control_msg(DeviceRequestTO): unknown error
caught usb_control_msg(DeviceRequestTO): unknown error
caught usb_control_msg(DeviceRequestTO): pipe is stalled
caught usb_control_msg(DeviceRequestTO): pipe is stalled
Bus 005 Device 002-05ac-8501-ff-ff: ID 05ac:8501 Micron
caught usb_control_msg(DeviceRequestTO): pipe is stalled
osx:pyusb yaniv$
The exception is caught on the getString(), not on the open().
I don't know what's special about this Micron device which works.
I've tried running as UID 0 as well.
Any further ideas?
Many thanks,
- Yaniv
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________
Pyusb-users mailing list
Pyu...@li...
https://lists.sourceforge.net/lists/listinfo/pyusb-users
-Sarah
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com |