On Fri, Apr 20, 2012 at 10:40 PM, Ron Eggler wrote:
> Hi Tormod
> [snip]
>> Maybe it is better if you tell us exactly what the troubles are.
>
> Alright, we have an E10 gateway from Synapse wireless that will connect via
> cell modem to the internet (thus usb_modeswitch is required). We'll also have
> a (TP1080WC) weather station connected which requires the pywws driver to
> communicate with the E10 over usb.
> Now I have a buildroot environment (BusyBox) with libusb-1.0.8, libusb-
> compat-0.1.3 and PyUSB-0.4.3 which I think should resolve all required
> depencies. I however when I invoke the "TestWeatherStation.py" script from
> pywws, I get these errors:
>
> # python TestWeatherStation.py
> 20:35:08:usb.backend.libusb10:Error loading libusb 1.0 backend
> Traceback (most recent call last):
>  File "/usr/lib/python2.7/site-packages/usb/backend/libusb10.py", line 588,
> in get_backend
>    _lib = _load_library()
>  File "/usr/lib/python2.7/site-packages/usb/backend/libusb10.py", line 160,
> in _load_library
>    raise OSError('USB library could not be found')
> OSError: USB library could not be found

It actually looks like you have pyusb 1.0 installed. Only pyusb 1.0
has the concept of backends, and will try to load, in order: libusb
1.0, openusb, libusb 0.1. Since pyusb 1.0 has a legacy module, it will
emulate python 0.4 for your application, but using the auto-selected
backend.

[Note that you can select backend yourself when you use the pyusb 1.0
API, but when using the legacy module 0.4 emulation there is no way to
select the backend.]

"Real" pyusb 0.4, on the other hand, only knows libusb 0.1 (which is
compiled in) and does not look for other libraries or backends.

Of course, this emulation should not be a problem either, but maybe
you want to try uninstalling pyusb 1.0 and use the "real" pyusb 0.4
instead (which will use the libusb-compat library in your case), and
see if that solves the issue.

>From the error messages it looks like pyusb 1.0 fails to find any
backend at all. If you want to use pyusb 1.0, please use latest git.
We could start debugging why usb.backend.libusb10.get_backend fails
(your libusb1.0.so is not in a standard library location where
ctypes.util.find_library can find it?) but it would not be worthwhile
if you happen to be using an out-dated pyusb 1.0 version.

Tormod

PS. There are quite some combinations possible for an application
using pyusb 0.4 API:
 -> pyusb 0.4 -> libusb 0.1
 -> pyusb 0.4 -> libusb-compat -> libusb 1.0
 -> pyusb 1.0 legacy module  -> libusb 0.1
 -> pyusb 1.0 legacy module  -> libusb 1.0
Technically possible but inhibited by the backend auto-selection:
 -> pyusb 1.0 legacy module  -> libusb-compat -> libusb 1.0

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to