Installation on Windows with Kuando
See original GitHub issueHi there,
i am new to python and i am having a tough time working with the kuando light on windows. On mac everything was fine.
I tried to test with following code:
from busylight.lights.kuando import BusyLight
light = BusyLight.first_light()
light.on((255, 0, 0))
I get the following result:
Traceback (most recent call last): File "C:\Users\MyPC\Desktop\Python\test.py", line 4, in <module> light.on((255, 0, 0)) File "C:\Users\MyPC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\busylight\lights\kuando\busylight.py", line 49, in on self.state.line0 = instruction.value File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1520.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 124, in __exit__ next(self.gen) File "C:\Users\MyPC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\busylight\lights\usblight.py", line 412, in batch_update self.update() File "C:\Users\MyPC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\busylight\lights\usblight.py", line 507, in update raise USBLightIOError(f"write returned {nbytes}") busylight.lights.exceptions.USBLightIOError: write returned 65
Does anyone have any idea what I am doing wrong?``
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (9 by maintainers)
Fixing this problem on Windows will require some re-architecting of the USBLight class which I do not have time for right now, but will do at some point in the future. In the meantime, the README will be updated to indicate that BusyLight does not work on Windows right now.
So I’ve root caused the problem; I assumed that a HID USB device could only be opened successfully one time (exclusive open). This is true for macOS and Linux but not true for Windows. The entire light discovery mechanism depends on this assumption unfortunately. I’ll need to re-think how I manage devices to make things work on Windows. Sorry if this doesn’t make sense, I’m hoping to have a solution for this pretty quick now that I understand the problem.