-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation on Windows with Kuando #56
Comments
As you might guess, I develop on Mac and test on Linux but have never actually tested on Windows. The Kuando Busylight control packet is 64 bytes long and 65 bytes were written. This could be a one-off bug in my code or some sort of Windows-specific interaction that I hadn't anticipated. I don't think this is a problem caused by you doing something wrong. I'll investigate and see what I can figured out. |
If you could describe to me how you installed busylight-for-humans on Windows that would be an enormous help to me. |
Ofcourse! after that i created a test.py file with the above code. |
Awesome. I have been able to replicate the error you reported. I suspect that it's because libusb isn't installed ( it's not installed on my Windows either ). Investigating further. If anything, |
Poking around some more, missing libusb doesn't seem to be the problem. Which is great because debugging this is frustrating enough :) It looks like Windows may be a little more picky about the control packet written to the device, but may be an easy fix. Stand by. |
And no, I was not so lucky. It appears that the Kuando Busylight $ busylight -D list You'll probably need to kill the script, dependent on what Windows shell technology you're using (Control-C in |
Uhm, could you explain to me how I can set up the cmd.exe commands in windows for busylight? I haven't figured it out... If i type busylight the response show that the command is unknown. Like i said - I'm new :-D |
Likely your PATH variable doesn't include the filesystem path to your python executable. I was bit by exactly the same thing which led to a frustrating several hours of futzing with Windows. My solution to the problem was:
After I did this, I was able to start a C:\Users\ejo\local\busylight> python
Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> After getting python to run from a prompt, you will likely need to re-install C:\Users\ejo\local\busylight> python -m pip install busylight-for-humans
... Assuming that completes successfully, you can then run the C:\Users\ejo\local\busylight> busylight --help
... I was hoping to see if your debug output matches mine for: c:\Users\ejo\local\busylight> busylight -D list
... |
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. |
You are awesome! Thank you! |
@JnyJny Hey Erik, I experienced a problem with ALL busylight powered devices in my project. Even a See verbose log: verbose-log.txt |
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. |
Hi 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?``
The text was updated successfully, but these errors were encountered: