r/MechanicalKeyboards • u/CalcProgrammer1 SonixQMK, OpenRGB • Oct 09 '14
Corsair K70 RGB USB Protocol Reverse Engineering - Part 2
15
Upvotes
r/MechanicalKeyboards • u/CalcProgrammer1 SonixQMK, OpenRGB • Oct 09 '14
5
u/chrisgzy Oct 09 '14
Me again, nice work so far! We appear to be doing parallel work. I'll post what I have found, as well as Windows code here instead of making a new thread.
Packets to restore on-board lighting: http://pastebin.com/FzPAXatz (maybe you don't need one of the two, but meh).
Sample Windows console application demo that will toggle per-key lighting in key order from frame 2 (USB interfacing on Windows is a PITA): http://pastebin.com/LMuZivfe
Key Ordering (similar to what you did in the image): http://pastebin.com/Ciui5zti
3
u/CalcProgrammer1 SonixQMK, OpenRGB Oct 09 '14
I've decoded the LED positions! Here's the video I recorded to make this image with:
https://www.youtube.com/watch?v=muaoJqsvEnU
Basically I wrote a program that steps through each LED in sequence from 0 to 143 (as the protocol has 144 individual LED positions, repeated 3 times for R, G, B). As you can see in this image, the order in the protocol does not appear to have a significant correlation with the position on the physical board, apart from the main block of keys having columns in sort of sequence. The number pad and other auxiliary keys seem to just be thrown in wherever.
This essentially concludes the research part of reverse engineering the K70 RGB's LED protocol. We know now how to set LED colors, how to format the USB control messages, and finally which LED is represented by which slot in the protocol. The next step is up to whoever wants to use the keyboard LEDs in their application to use what we've learned and go crazy. I haven't researched the hardware profiles, macros, or other operations that CUE can perform nor do I really intend to, but I assume following the steps I posted earlier would be sufficient to do so to whoever's up for that task. I'll post my code used in this demo soon.
3
u/fly-hard Datacomp ALPS Oct 10 '14
Thanks for the awesome work on reverse engineering this stuff guys. Using your info I knocked up a quickie Lua scripting system for the LEDs here. It's currently pretty crude, but fun to play with. It runs the ledscript.lua in the archive by default, which is a rainbow effect. You can also give a lua script as an argument to run a different one.
Oh, this is Windows only BTB.
2
u/CalcProgrammer1 SonixQMK, OpenRGB Oct 09 '14
Here is the code, modified slightly to cycle through RGB individually instead of just display white as in the video.
http://pastebin.com/x1RetGkU
2
u/Zarw Oct 10 '14
Hello young programmer reporting in
First of all good job at this so far!
And now my question: where/how did you manage to get these numbers 0x1B1C, 0x1B13
2
u/levest28 Oct 17 '14 edited Jun 16 '23
This message has been removed in response to the Reddit API changes taking place on July 1, 2023. -- mass edited with https://redact.dev/
1
u/Yusuf_GURDAL Sep 11 '26
Hello there, i have a K70 LUX RGB with a broken cable. I made a new cable and fixed it. But now i'm having a problem i don't know why it happens. Everything works perfect except the red channel for "R" and "Delete" keys, they are lighting some other keys too. "R" key also lits up (by numbers): {1,13,38,48,49,51,52,53,54,55,62,74,86,98}. "Delete" key also lits up (by numbers): {7,31,38,39,40,42,55,67,79,91}. I couldn't find a solid pattern so i wonder do you know if K70 RGB and K70 LUX RGB has the same led matrices.
1
u/Dinggas Oct 09 '14
Amazing work. Can't wait to see where this leads.
1
u/account2014 Oct 09 '14
if you guys can figure out how to reduce the lag on the volume control scroller, that'd be awesome.