-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
OpenRGB Support #151
Comments
I update the leds on the command CorsairLightingProtocol/src/LEDController.cpp Lines 23 to 26 in 5d9594c
What do you send as keepalive (apply) messages? You mean after some the keepalive messages the arduino becomes unresponsive?
The "Device Types" are actually the number of LEDs of that device, at least I have implemented it that way and it works. CorsairLightingProtocol/src/LEDController.cpp Lines 76 to 95 in 5d9594c
|
My keepalive loop is a trigger (0x33, I called this CORSAIR_LIGHTING_NODE_PACKET_ID_COMMIT) message sent every 5 seconds. I also send a commit after every command. My Effect Configuration function, it looks like my structure lines up with yours: CORSAIR_LIGHTING_NODE_PACKET_ID_EFFECT_CONFIG = 0x35, /* Effect mode configuration packet */ The *10 on the count is probably an error. I'm going to remove it. |
Don't remove it, it's the offset on the led strip for the effect. 10 is correct in case of corsair 10 LEDs strip, it should be the sum of all previous |
I can think of two possible problems (beside the
I will look into these over the weekend. |
I'm going to continue experimenting this weekend as well. I added some sleeps between packet sends and that seems to have made it a bit more reliable, but it's only controlling the red channel in direct mode. I haven't messed with the effect modes (built-in effects) yet. Edit: It is a lot more reliable (and I can get all color channels working) if I perform a read every time I perform a write. Edit 2: Definitely seems to be a timing issue, even if it's not the only issue. If I send all three channels of data back-to-back it has major trouble updating. Much more reliable with 1ms gaps between each packet. Still has a lot of stuttering when I try to send updates at 25ms though. Edit 3: Reflashed my Arduino with the Lighting Node PRO sketch. It's doing some very strange things when I try to send a rainbow pattern in direct mode. It updates much slower than the real LNP and it seems to distort the colors a lot. I'll try to set up a demo. Edit 4: Commented out saving and sending replies:
It's running smoothly with 25ms update rate and no hid_reads. |
I uncommented the save and it is still working fine. The effect I set with OpenRGB is saved and starts back up if I unplug and reconnect it. My guess is that there's something going on with the writes. On the real LNP I don't need to do HID reads after each write, and in fact doing so seems to cause slowdowns and stalls. Edit: More digging. I added support for the fan controllers on the Commander Pro a few weeks ago in a branch. During that investigation I found that the Commander Pro uses a 16-byte reply and that I would have to read it after every write if I wanted the fan RPM reads to be reliable. I looked and the reply buffer in CLP is 64 bytes. I changed it to 16:
Now it appears to be working well with the writes and saves enabled (with 1ms delays added between transactions). EDIT: Taking out the 1ms delay is no problem since the read acts as a delay. |
Pushed a change to OpenRGB that gets it working with CLP as long as the 64->16 reply size change is implemented. Tested the 16 byte reply on iCue and it seems to work just fine as well. Firmware version is received correctly and all effects work. Added pull request: It looks to be failing one of the automated tests, but it built and ran successfully on my Pro Micro (which shows up as an Arduino Leonardo). |
Describe the bug
I'm the developer of OpenRGB and my project supports the real Lighting Node devices. I'd like to make sure it works with CorsairLightingProtocol as I would like to be able to recommend an Arduino running this project as a recommended controller for OpenRGB users.
Unfortunately, OpenRGB has trouble controlling an Arduino Pro Micro running CorsairLightingProtocol as a Lighting Node Pro. A real Lighting Node Pro works correctly. It may be that my implementation of the Corsair protocol doesn't exactly match iCue, but my code does work on a real Lighting Node Pro.
OpenRGB sends a keepalive (apply) message every 5 seconds as a real Lighting Node device will revert to the saved hardware effect mode after 20 seconds of bus inactivity. It seems like CorsairLightingProtocol is applying changes on this keepalive rather than on the actual color update message. After a few tries, it becomes unresponsive.
Here is my protocol documentation. This is what I based my driver in OpenRGB on:
https://gitlab.com/CalcProgrammer1/OpenRGB/-/wikis/Corsair-Lighting-Node-Devices
I'm entirely open to the idea that I'm doing something wrong in OpenRGB. This may not be CorsairLightingProtocol's fault.
OpenRGB issue link: https://gitlab.com/CalcProgrammer1/OpenRGB/-/issues/355
What works?
OpenRGB successfully detects my Arduino as a Lighting Node Pro. I flashed the Lighting Node CORE sketch so I'm not sure why. It shows up in Zadig/Device Manager/lsusb as a Pro. Firmware version is correctly reported.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Lights immediately change to selected color
Effect modes work
Actual behavior
Lights don't immediately change, sometimes apply set color on the 5s keepalive command.
Effect modes turn off the LEDs
System:
Code changes
None
The text was updated successfully, but these errors were encountered: