KsenijaS / krakenx

Python script to control NZXT cooler Kraken X52/X62 in Linux
GNU General Public License v2.0
181 stars 20 forks source link

usb.core.USBError: [Errno 110] Operation timed out #32

Closed leinardi closed 5 years ago

leinardi commented 5 years ago

If multiple executions of colctl are done in a short amount of time this error is shown:

$ colctl --status
Device status:
Traceback (most recent call last):
  File "/usr/local/bin/colctl", line 121, in <module>
    main(parser)
  File "/usr/local/bin/colctl", line 115, in main
    cooler.print_status()
  File "/usr/local/lib/python2.7/dist-packages/krakenx/color_change.py", line 145, in print_status
    for k,v in sorted(self._receive_status().items()):
  File "/usr/local/lib/python2.7/dist-packages/krakenx/color_change.py", line 149, in _receive_status
    raw_status = self.dev.read(0x81, 64)
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 988, in read
    self.__get_timeout(timeout))
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 851, in intr_read
    timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 936, in __read
    _check(retval)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 595, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 110] Operation timed out

Most probably the USB devices is not reset before

jneumaier commented 5 years ago

Please also consider Windows support. It is broken now. I will fix this tomorrow.

leinardi commented 5 years ago

Sorry about Windows, I have not thought it could break it.

jneumaier commented 5 years ago

@leinardi No worries, glad you are helping. For once I directly pushed the fix because I guess it is not worth a review.