jath03 / openrgb-python

A python client for the OpenRGB SDK
GNU General Public License v3.0
115 stars 22 forks source link

Can't connect when Corsair K95 RGB Platinum is enabled #57

Closed x86-39 closed 2 years ago

x86-39 commented 2 years ago

I'm using this to test connection:

from openrgb import OpenRGBClient

cli = OpenRGBClient('192.168.100.1', 6742, 'Client')

This works fine most of the time, and interacting with the client works too. However when I connect my Corsair K95 RGB Platinum keyboard I get the following error:

Traceback (most recent call last):
  File "/home/diademiemi/Downloads/test.py", line 7, in <module>
    cli = OpenRGBClient('192.168.100.1', 6742, 'Client')
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/orgb.py", line 337, in __init__
    self.update()
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/orgb.py", line 502, in update
    self.comms.requestDeviceNum()
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/network.py", line 188, in requestDeviceNum
    self.read()
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/network.py", line 116, in read
    self.callback(device_id, packet_type, buff[0])
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/orgb.py", line 348, in _callback
    self.comms.requestDeviceData(x)
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/network.py", line 181, in requestDeviceData
    self.read()
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/network.py", line 137, in read
    self.callback(device_id, packet_type, utils.ControllerData.unpack(data, self._protocol_version))
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/utils.py", line 557, in unpack
    leds = parse_list(LEDData, data, version)
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/utils.py", line 143, in parse_list
    things.append(kind.unpack(data, version, x))  # type: ignore
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/utils.py", line 223, in unpack
    name = parse_string(data)
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/utils.py", line 118, in parse_string
    return parse_var(f'{length}s', data).decode().rstrip('\x00')
  File "/home/diademiemi/.local/lib/python3.10/site-packages/openrgb/utils.py", line 103, in parse_var
    d.append(int(next(data)))
StopIteration

When I disable the keyboard in the OpenRGB config, the script starts working again. But once I enable it and reload devices, the script stops working. Does anyone know of a solution to this or is this a known bug? This is also affecting https://github.com/koying/openrgb_ha and makes Home Assistant error on connecting.

jath03 commented 2 years ago

What version of OpenRGB are you using? Because if it's older than 0.7, this is probably another #33.

x86-39 commented 2 years ago

Might have been 0.6. I don't use this keyboard anymore but I'll grab it when I have time to test out if it's resolved on 0.7

jath03 commented 2 years ago

Stale