2013/12/9 Christopher Fowler <christop...@chronofish.com>:
> Hello,
>
> I have been trying to find an easy to use USB API, and this seems pretty
> straight forward, except for getting the dependencies correct.
>
> I am running Python 2.6 on an Angstrom for the Beaglboard XM:
>
> root@beagleboard:~# uname -a
> Linux beagleboard 2.6.32 #3 PREEMPT Tue Jul 26 10:56:56 CEST 2011 armv7l
> GNU/Linux
>
> I have used OPKG to load the following:
> libusb-0.1-4 - 1:0.1.3-r0.6 - libusb-0 compatibility library using libusb-1
> libusb-1.0-0 - 1.0.8-r0.6 - library to provide userspace access to USB
> devices
> libusbpp-0.1-4 - 0.1.12-r3.5 - libusb is a library to provide userspace
> access to USB devices.
> python-core - 2.6.6-ml12.2.6 - Python Interpreter and core modules (needed!)
> python-ctypes - 2.6.6-ml12.2.6 - Python C Types Support
> python-setuptools - 0.6c9-ml0.3 - Download, build, install, upgrade, and
> uninstall Python packages
>
> I have used the setup.py command to install pyusb-1.0.0a2
>
> When I run my script without specifying the backend, I get this error:
>
>   File "./pyServo.py", line 18, in <module>
>      dev = usb.core.find(idVendor=0x1208, idProduct=0x0815)
>    File "/usr/lib/python2.6/site-packages/usb/core.py", line 846, in find
>      raise ValueError('No backend available')
> ValueError: No backend available
>

You installed libusb 1.0 and libusb-compat. libusb 1.0.8 has been
quite buggy, you may want to upgrade it.

>
> When I run my script specifying the backend, I get this error:
> Traceback (most recent call last):
>    File "./pyServo.py", line 17, in <module>
>      dev = usb.core.find(idVendor=0x1208, idProduct=0x0815,
> backend=libusb.get_backend() )
>    File "/usr/lib/python2.6/site-packages/usb/core.py", line 854, in find
>      return _interop._next(device_iter(k, v))
>    File "/usr/lib/python2.6/site-packages/usb/_interop.py", line 60, in
> _next
>      return next(iter)
>    File "/usr/lib/python2.6/site-packages/usb/core.py", line 821, in
> device_iter
>      for dev in backend.enumerate_devices():
>    File "/usr/lib/python2.6/site-packages/usb/backend/libusb01.py", line
> 390, in enumerate_devices
>      _check(_lib.usb_find_busses())
>    File "/usr/lib/python2.6/ctypes/__init__.py", line 366, in __getattr__
>      func = self.__getitem__(name)
>    File "/usr/lib/python2.6/ctypes/__init__.py", line 371, in __getitem__
>      func = self._FuncPtr((name_or_ordinal, self))
> AttributeError: python: undefined symbol: usb_find_busses
>
>

It seems there is some problem with your libusb-compat library, as
PyUSB cannot find the usb_find_busses symbol. Maybe this is a ctypes
issue.

Try to find the libusb 0.1 shared object and run the command objdump
-T <file> and post the output here.

Another thing is that you installed libusb 1.0 and it is the preferred
backend for PyUSB under linux. Probably PyUSB is not finding it.

>
> Here is the simply script that I am using:
> #!/usr/bin/env python
>
> import usb.core
> import usb.util
> import usb.backend.libusb01 as libusb
>
> PYUSB_DEBUG_LEVEL = 'debug'
> # find our device
> # Bus 002 Device 006: ID 1208:0815
> #  idVendor           0x1208
> #  idProduct          0x0815
> # dev = usb.core.find(idVendor=0xfffe, idProduct=0x0001)
> # iManufacturer           1 TOROBOT.com
> #dev = usb.core.find(iManufacturer='TOROBOT.com')
> dev = usb.core.find(idVendor=0x1208, idProduct=0x0815,
> backend=libusb.get_backend() )
>
>
>
>
> What am I doing wrong, and what do I need to do to make this work?
>

As you are forcing the use of libusb0 and it is not working, the
script fails. Also notice you are using an old version of PyUSB, you
might want to upgrade it.

-- 
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to