hey guys, i got it now, thanks :) The log follows below, it seems that pyusb was unable to load the propper backend? when installing i did all the steps in the documentation: sudo apt-get install python libusb-1.0-0 sudo python setup.py install
Both run fine. Heres the Log dump: 2015-06-12 16:38:05,805 ERROR:usb.backend.libusb1:Error loading libusb 1.0 backend Traceback (most recent call last): File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/libusb1.py", line 880, in get_backend _setup_prototypes(_lib) File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/libusb1.py", line 453, in _setup_prototypes lib.libusb_strerror.argtypes = [c_uint] File "/usr/lib/python3.2/ctypes/__init__.py", line 366, in __getattr__ func = self.__getitem__(name) File "/usr/lib/python3.2/ctypes/__init__.py", line 371, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: /lib/arm-linux-gnueabihf/libusb-1.0.so.0: undefined symbol: libusb_strerror 2015-06-12 16:38:06,407 ERROR:usb.libloader:'OpenUSB library' could not be found 2015-06-12 16:38:06,408 ERROR:usb.backend.openusb:Error loading OpenUSB backend 2015-06-12 16:38:06,439 INFO:usb.core:find(): using backend "usb.backend.libusb0" 2015-06-12 16:38:06,441 DEBUG:usb.backend.libusb0:_LibUSB.enumerate_devices() 2015-06-12 16:38:06,444 DEBUG:usb.backend.libusb0:_LibUSB.get_device_descriptor(<usb.backend.libusb0._usb_device object at 0x150dc60>) 2015-06-12 16:38:06,446 DEBUG:usb.backend.libusb0:_LibUSB.get_device_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>) 2015-06-12 16:38:06,447 DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 0) 2015-06-12 16:38:06,449 DEBUG:usb.backend.libusb0:_LibUSB.get_interface_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 0, 0, 0) 2015-06-12 16:38:06,450 DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 0) 2015-06-12 16:38:06,452 DEBUG:usb.backend.libusb0:_LibUSB.get_endpoint_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 1, 0, 0, 0) 2015-06-12 16:38:06,453 DEBUG:usb.backend.libusb0:_LibUSB.get_interface_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 0, 0, 0) 2015-06-12 16:38:06,453 DEBUG:usb.backend.libusb0:_LibUSB.get_configuration_descriptor(<usb.backend.libusb0._usb_device object at 0x151c4e0>, 0) 2015-06-12 16:38:06,455 DEBUG:usb.backend.libusb0:_LibUSB.open_device(<usb.backend.libusb0._usb_device object at 0x151c4e0>) 2015-06-12 16:38:06,514 DEBUG:usb.backend.libusb0:_LibUSB.close_device(22698048) And from the console when i run my script: Traceback (most recent call last): File "testusb.py", line 65, in <module> if dev.is_kernel_driver_active(0): File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/core.py", line 992, in is_kernel_driver_active interface) File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/__init__.py", line 363, in is_kernel_driver_active _not_implemented(self.is_kernel_driver_active) File "/usr/local/lib/python3.2/dist-packages/pyusb-1.0.0b2-py3.2.egg/usb/backend/__init__.py", line 79, in _not_implemented raise NotImplementedError(func.__name__) NotImplementedError: is_kernel_driver_active matt Am 12.06.2015 um 16:14 schrieb Wander Lairson Costa: > 2015-06-12 11:15 GMT-03:00 Matthias Grabowski <em...@mailbox.org>: >> I don't know what you want me to do with >> export PYUSB_DEBUG=debug >> > This is an environment variable to define before running your script. > You can also define inside your Python code before you import the > pyusb modules. If you need further details, you might want to give a > look in the tutorial [1] > > [1] https://github.com/walac/pyusb/blob/master/docs/tutorial.rst > >> Am 12. Juni 2015 15:36:52 MESZ, schrieb Wander Lairson Costa >> <wander.lair...@gmail.com>: >>> 2015-06-12 9:20 GMT-03:00 Matthias Grabowski <em...@mailbox.org>: >>>> Hello guys, >>>> >>>> I'm new to this mailing list, pyusb and Linux in general. So sorry, if >>>> some >>>> of my questions may be a little stupid. I know my way around python, >>>> though. >>>> >>>> Anyways, I got a raspberry pi with raspbian installed and I'm writing a >>>> python script to read data from an air quality sensor that identifies >>>> itself >>>> as a HID to the OS. When I try to read or write data to/from the device >>>> I >>>> get a USBError: >>>> Could not claim interface 0: device or resource busy. >>>> >>>> I think that happens because the os attaches a kernel driver to the >>>> device. >>>> Correct? >>>> >>>> In that case I found some code that tries to claim the interface: >>>> if dev.is_kernel_driver_active (0): >>>> dev.detach_kernel_driver(0) >>>> >>>> >>>> usb.util.claim_interface (dev, 0) >>>> >>>> But there I get a NotImplementedError. Why? Whats wrong and what can I >>>> do? >>> >>> >>> Hi, >>> >>> Could you please run with logs (export PYUSB_DEBUG=debug) and post the >>> result? >>> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> pyusb-users mailing list >> pyusb-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/pyusb-users >> > > ------------------------------------------------------------------------------ _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users