On 13/03/11 12:59 AM, wander.lairson wrote: > 2011/3/11 Brendan Simon (eTRIX) > <brendan.simon-klfc6hf5x8b0ccvohzk...@public.gmane.org>: >> My usb device can not be found with pysub (v1.0.0a). >> I am running on OS X 10.6 and have installed libusb-1.0.8 (=>/usr/local/lib) >> >> I have python2.7 installed, and installed pysub with "pip install pyusb" >> >> Following the tutorial, dev = usb.core.find() does return an object :) >> >> However, dev = usb.core.find(idVendor=myVID, idProduct=myPID) returns >> None :( >> > Does your device is found by another tools. What about the samples > that come with libusb 1.0, > do they can find your device?
It is found by Apple tools (System Profiler, ioreg). The device is the Pololu Micro Masestro 6-servo Controller. $ ioreg -p IOUSB -w 0 +-o Root <class IORegistryEntry, id 0x100000100, retain 12> +-o EHCI Root Hub Simulation@4,1 <class IOUSBRootHubDevice, id 0x10000021e, registered, matched, active, busy 0 (3042 ms), retain 10> | +-o Built-in iSight@24400000 <class IOUSBDevice, id 0x100000d7b, registered, matched, active, busy 0 (446 ms), retain 12> +-o EHCI Root Hub Simulation@6,1 <class IOUSBRootHubDevice, id 0x10000023f, registered, matched, active, busy 0 (3099 ms), retain 10> | +-o Card Reader@26500000 <class IOUSBDevice, id 0x100001448, registered, matched, active, busy 0 (226 ms), retain 8> +-o OHCI Root Hub Simulation@4 <class IOUSBRootHubDevice, id 0x100000245, registered, matched, active, busy 0 (3002 ms), retain 14> | +-o Apple Internal Keyboard / Trackpad@4600000 <class IOUSBDevice, id 0x100000db7, registered, matched, active, busy 0 (22040 ms), retain 13> | +-o IR Receiver@4500000 <class IOUSBDevice, id 0x100000dc9, registered, matched, active, busy 0 (121 ms), retain 9> | +-o Pololu Micro Maestro 6-Servo Controller@4100000 <class IOUSBDevice, id 0x10000141b, registered, matched, active, busy 0 (995 ms), retain 7> +-o OHCI Root Hub Simulation@6 <class IOUSBRootHubDevice, id 0x10000024f, registered, matched, active, busy 0 (3057 ms), retain 10> +-o BRCM2046 Hub@6100000 <class IOUSBHubDevice, id 0x100000db1, registered, matched, active, busy 0 (14 ms), retain 12> +-o Bluetooth USB Host Controller@6110000 <class IOUSBDevice, id 0x100000dfa, registered, matched, active, busy 0 (65 ms), retain 11> but is not found by libusb sample program 'lsusb' $ ./lsusb 05ac:8005 (bus 4, device 1) 05ac:0236 (bus 4, device 2) 05ac:8242 (bus 4, device 3) 05ac:8006 (bus 36, device 1) 05ac:8507 (bus 36, device 2) 05ac:8005 (bus 6, device 1) 05ac:8006 (bus 38, device 1) 05ac:8403 (bus 38, device 2) Notice that the VendorIDs are all 05ac (Apple). Also, some of the ProductIDs are not is the list provided by the System Profiler. So there seems to be either a bug in the libusb-1.0.8 code. It could be OS X specific, or could be a build/compiler issue. >> dev = usb.core.find(find_all=True) does return a list of devs, but none >> of them are my usb device. It seems like a limited set. >> > Does it return all devices but yours? I think there is some missing, or possibly some extra devices. >> I tried the same thing with my python 2.5 and python 2.6 installs, but >> with these I get: >> ValueError: No backend available >> >> I don't know why I get this with python2.5 and python2.6, but not with >> python2.7. All I can think of is that python2.7 is my default python, >> but that shouldn't make any difference should it ?? >> > Very strange, please define the env variable PYUSB_DEBUG_LEVEL=debug, > run your app with python 2.7 and 2.6, and report the results, this > might be a bug > in PyUSB. **** Python 2.7 results (on my system) **** $ export PYUSB_DEBUG_LEVEL=debug $ python2.7 Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> import usb.core as UC >>> dev = UC.find(find_all=True) 2011-03-14 20:33:28,932 INFO:usb.core:find(): using backend "usb.backend.libusb10" 2011-03-14 20:33:28,932 DEBUG:usb.backend.libusb10:_LibUSB.enumerate_devices() 2011-03-14 20:33:29,841 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x100722ad0>) 2011-03-14 20:33:29,841 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x100722c10>) 2011-03-14 20:33:29,841 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x100722cd0>) 2011-03-14 20:33:29,842 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x100722d90>) 2011-03-14 20:33:29,842 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x100722e50>) 2011-03-14 20:33:29,842 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x100722f10>) 2011-03-14 20:33:29,842 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x100722fd0>) 2011-03-14 20:33:29,842 DEBUG:usb.backend.libusb10:_LibUSB.get_device_descriptor(<usb.backend.libusb10._Device object at 0x10072d0d0>) >>> >>> dev [<usb.core.Device object at 0x100722b10>, <usb.core.Device object at 0x100722b90>, <usb.core.Device object at 0x100722c50>, <usb.core.Device object at 0x100722d10>, <usb.core.Device object at 0x100722dd0>, <usb.core.Device object at 0x100722e90>, <usb.core.Device object at 0x100722f50>, <usb.core.Device object at 0x10072d050>] >>> **** Python 2.6 results (on my system) **** $ export PYUSB_DEBUG_LEVEL=debug $ python2.6 Python 2.6.6 (r266:84374, Aug 31 2010, 11:00:51) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> import usb.core as UC >>> devs = UC.find(find_all=True) 2011-03-14 20:33:12,649 ERROR:usb.backend.libusb10:Error loading libusb 1.0 backend Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/libusb10.py", line 600, in get_backend _lib = _load_library() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/libusb10.py", line 165, in _load_library l = CDLL(libname) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py", line 353, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(/usr/local/lib/libusb-1.0.dylib, 6): no suitable image found. Did find: /usr/local/lib/libusb-1.0.dylib: mach-o, but wrong architecture 2011-03-14 20:33:12,778 ERROR:usb.backend.openusb:Error loading OpenUSB backend Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/openusb.py", line 598, in get_backend _lib = _load_library() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/openusb.py", line 148, in _load_library raise OSError('USB library could not be found') OSError: USB library could not be found 2011-03-14 20:33:12,839 ERROR:usb.backend.libusb01:Error loading libusb 0.1 backend Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/libusb01.py", line 558, in get_backend _lib = _load_library() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/libusb01.py", line 180, in _load_library raise OSError('USB library could not be found') OSError: USB library could not be found Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/core.py", line 829, in find raise ValueError('No backend available') ValueError: No backend available >>> >>> dev Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'dev' is not defined >>> ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users