padelt / temper-python

libusb/PyUSB-based driver to read TEMPer USB HID devices (USB ID 0c45:7401) and serve as a NetSNMP passpersist module
Other
182 stars 76 forks source link

0c45:7402 and usbfs conflicts #75

Closed twomiles-dev closed 3 years ago

twomiles-dev commented 7 years ago

Hi there,

I get the following error message when I am running temper-poll:

WARNING:temperusb.temper:Encountered [Errno 110] Operation timed out, resetting <DEVICE ID 0c45:7402 on Bus 002 Address 004> and trying again. ERROR:temperusb.temper:[Errno 110] Operation timed out Traceback (most recent call last): File "/usr/local/bin/temper-poll", line 9, in load_entry_point('temperusb==1.5.3', 'console_scripts', 'temper-poll')() File "build/bdist.linux-x86_64/egg/temperusb/cli.py", line 55, in main File "build/bdist.linux-x86_64/egg/temperusb/temper.py", line 322, in get_temperatures File "build/bdist.linux-x86_64/egg/temperusb/temper.py", line 272, in get_data File "build/bdist.linux-x86_64/egg/temperusb/temper.py", line 243, in get_data File "build/bdist.linux-x86_64/egg/temperusb/temper.py", line 402, in _interrupt_read File "build/bdist.linux-x86_64/egg/usb/core.py", line 988, in read File "build/bdist.linux-x86_64/egg/usb/backend/libusb1.py", line 851, in intr_read File "build/bdist.linux-x86_64/egg/usb/backend/libusb1.py", line 936, in __read File "build/bdist.linux-x86_64/egg/usb/backend/libusb1.py", line 595, in _check usb.core.USBError: [Errno 110] Operation timed out

Even though I have:

kern.log:

usbfs: process 9043 (temper-poll) did not claim interface 1 before use usb 2-2.3: usbfs: interface 1 claimed by usbfs while 'temper-poll' sets config #1 usb 2-2.3: usbfs: interface 1 claimed by usbfs while 'temper-poll' sets config #1

dmesg:

[ 6388.584030] usb 2-2.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes [ 6388.585296] usb 2-2.3: usbfs: process 9043 (temper-poll) did not claim interface 1 before use [ 6388.585628] usb 2-2.3: usbfs: interface 1 claimed by usbfs while 'temper-poll' sets config #1 [ 6388.963989] usb 2-2.3: usbfs: interface 1 claimed by usbfs while 'temper-poll' sets config #1 [ 6389.238041] usb 2-2.3: reset low-speed USB device number 4 using xhci_hcd

Ubuntu 16.04 LTS

I have tried "usbreset", it didn't work.

Any idea?

arnauos commented 6 years ago

Hi, I was getting the same error ([Errno 110] Operation timed out) under Debian 9.x.

I have created the file /etc/udev/rules.d/10-temper.rules with the following content:

ATTRS={idVendor}=="0c45", ATTRS{idProduct}=="7402", OPTIONS=="ignore_device"

After a reboot, it started working:

Found 1 devices
Device #0: 26.9°C 80.5°F 62.2%RH
frank42hh commented 3 years ago

Unfortunately, I got the same problem but the solution from @arnauos doesn't work. First, there's a wrong equal sign between ATTRS and {idVendor}, and second, ignore_device is not recognized (removed in udev 148):

ATTRS={idVendor}=="0c45", ATTRS{idProduct}=="7401", OPTIONS=="ignore_device" /etc/udev/rules.d/10-temper.rules:1 Invalid key/value pair, ignoring.

ATTRS{idVendor}=="0c45", ATTRS{idProduct}=="7401", OPTIONS=="ignore_device" /etc/udev/rules.d/10-temper.rules:1 Invalid operator for OPTIONS.

I suggest referring to https://superuser.com/questions/611101/udev-rules-ignore-device for solutions depending on the udev system in use.

For me (Manjaro Linux 21) this one works:

ATTRS{idVendor}=="0c45", ATTRS{idProduct}=="7401", ENV{UDISKS_IGNORE}="1"