Please, try to find the device from python prompt, just do it:

import usb.core
dev = usb.core.find(idVendor=0xFFFE)
assert dev is not None

Wander

2010/4/4 Xiaofan Chen <xiaof...@gmail.com>:
> On Sat, Apr 3, 2010 at 10:54 PM, Wander Lairson
> <wander.lair...@gmail.com> wrote:
>> Hmmm... Really strange, isn't PyUSB 0.4 already installed? I have
>> managed test scripts to silently ignore test when test device is not
>> present, to when I am testing certain features which don't require
>> hardware...
>
> Now I know the reason, because there is no libusb-1.0.so.* under
> Freebsd 8/9. libusb.so (point to libusb.so.2) is both for libusb 0.1
> wrapper and the libusb 1.0 wrapper.
>
> [mc...@myfreebsd ~]$ ls -la /usr/lib/libusb*
> -r--r--r--  1 root  wheel  64434 Apr  4 16:04 /usr/lib/libusb.a
> lrwxr-xr-x  1 root  wheel     11 Apr  4 16:04 /usr/lib/libusb.so -> 
> libusb.so.2
> -r--r--r--  1 root  wheel  52968 Apr  4 16:04 /usr/lib/libusb.so.2
> -r--r--r--  1 root  wheel  68340 Apr  4 16:04 /usr/lib/libusb_p.a
> -r--r--r--  1 root  wheel  11926 Nov 21 22:54 /usr/lib/libusbhid.a
> lrwxr-xr-x  1 root  wheel     14 Nov 21 22:54 /usr/lib/libusbhid.so ->
> libusbhid.so.4
> -r--r--r--  1 root  wheel  11400 Nov 21 22:54 /usr/lib/libusbhid.so.4
>
> So I further changed libusb10.py. With the following changes,
> it goes further. Still it could not find the test device even though
> lsusb shows the device is there.
>
> def _load_library():
>   if sys.platform == 'win32':
>                libname = ctypes.util.find_library('libusb-1.0')
>   elif sys.platform == 'freebsd8' or sys.platform == 'freebsd9':
>                libname = ctypes.util.find_library('usb')
>   else:
>       libname = ctypes.util.find_library('usb-1.0')
>   if libname is None:
>       raise OSError('USB library could not be found')
>   return CDLL(libname)
>
> [mc...@myfreebsd ~/Desktop/build/pyusb/pyusb/trunk/tests]$ sudo python
> testall.py
> Adding DeviceTest(usb.backend.libusb10) to test suite...
> Adding ConfigurationTest(usb.backend.libusb10) to test suite...
> Adding InterfaceTest(usb.backend.libusb10) to test suite...
> Adding EndpointTest(usb.backend.libusb10) to test suite...
> Adding BackendTest(usb.backend.libusb10) to test suite...
> Adding BackendTest(usb.backend.libusb01) to test suite...
> ............F
> ======================================================================
> FAIL: runTest (test_backend.BackendTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "/usr/home/mcuee/Desktop/build/pyusb/pyusb/trunk/tests/test_backend.py",
> line 45, in runTest
>    self.test_enumerate_devices()
>  File "/usr/home/mcuee/Desktop/build/pyusb/pyusb/trunk/tests/test_backend.py",
> line 68, in test_enumerate_devices
>    self.fail('PyUSB test device not found')
> AssertionError: PyUSB test device not found
>
> ----------------------------------------------------------------------
> Ran 13 tests in 1.892s
>
> FAILED (failures=1)
>
>
> --
> Xiaofan http://mcuee.blogspot.com
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to