Skip to content
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

Add support for VID 0c45 boards [RK68K/RK855 (0c45:8018), etc.] #13

Open
rnayabed opened this issue Mar 1, 2023 · 12 comments
Open

Add support for VID 0c45 boards [RK68K/RK855 (0c45:8018), etc.] #13

rnayabed opened this issue Mar 1, 2023 · 12 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rnayabed
Copy link
Owner

rnayabed commented Mar 1, 2023

Software link: https://drive.google.com/file/d/1sq4vglRZ-76aPoszcGp4_uBD27Kvu7Oo/view

@rnayabed
Copy link
Owner Author

rnayabed commented Mar 1, 2023

Both keyboards are NOT RGB. Only blue backlight.

@rnayabed rnayabed added the enhancement New feature or request label Mar 1, 2023
@rnayabed rnayabed changed the title Add RK68K Blue light (0c45:8018) Add RK68K/RK855 (0c45:8018) Mar 1, 2023
@rnayabed rnayabed mentioned this issue Mar 1, 2023
@syfq91
Copy link

syfq91 commented Mar 2, 2023

Here hidapitester output for RK855 from Windows:

PS C:\Users\abina59x\Downloads\hidapitester-windows-x86_64> .\hidapitester.exe  --vidpid 0c45:8018 --list-detail
0C45/8018: SONiX - USB DEVICE
  vendorId:      0x0C45
  productId:     0x8018
  usagePage:     0x000C
  usage:         0x0001
  serial_number: (null)
  interface:     1
  path: \\?\hid#vid_0c45&pid_8018&mi_01&col01#7&e9493c3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}

0C45/8018: SONiX - USB DEVICE
  vendorId:      0x0C45
  productId:     0x8018
  usagePage:     0x0001
  usage:         0x0080
  serial_number: (null)
  interface:     1
  path: \\?\hid#vid_0c45&pid_8018&mi_01&col02#7&e9493c3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}

0C45/8018: SONiX - USB DEVICE
  vendorId:      0x0C45
  productId:     0x8018
  usagePage:     0x0001
  usage:         0x0002
  serial_number: (null)
  interface:     1
  path: \\?\hid#vid_0c45&pid_8018&mi_01&col04#7&e9493c3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}

0C45/8018: SONiX - USB DEVICE
  vendorId:      0x0C45
  productId:     0x8018
  usagePage:     0x0001
  usage:         0x0006
  serial_number: (null)
  interface:     1
  path: \\?\hid#vid_0c45&pid_8018&mi_01&col03#7&e9493c3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd

0C45/8018: SONiX - USB DEVICE
  vendorId:      0x0C45
  productId:     0x8018
  usagePage:     0xFFFF
  usage:         0x0001
  serial_number: (null)
  interface:     1
  path: \\?\hid#vid_0c45&pid_8018&mi_01&col05#7&e9493c3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}

0C45/8018: SONiX - USB DEVICE
  vendorId:      0x0C45
  productId:     0x8018
  usagePage:     0x0001
  usage:         0x0006
  serial_number: (null)
  interface:     0
  path: \\?\hid#vid_0c45&pid_8018&mi_00#7&30562c40&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd

Path output:

PS C:\Users\abina59x\Downloads\hidapitester-windows-x86_64> .\hidapitester.exe --open-path "\\?\hid#vid_0c45&pid_8018&mi_01&col01#7&e9493c3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}" --length 65 --send-feature 0x0a,0x01,0x01,0x02,0x29,0x01,0x03,0x03,0x03,0,0,0,0x01,0x01
Opening device. path: \\?\hid#vid_0c45&pid_8018&mi_01&col01#7&e9493c3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Writing 65-byte feature report...wrote -1 bytes:
 0A 01 01 02 29 01 03 03 03 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00
Closing device

PS C:\Users\abina59x\Downloads\hidapitester-windows-x86_64> .\hidapitester.exe --open-path "\\?\hid#vid_0c45&pid_8018&mi_01&col02#7&e9493c3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}" --length 65 --send-feature 0x0a,0x01,0x01,0x02,0x29,0x01,0x03,0x03,0x03,0,0,0,0x01,0x01
Opening device. path: \\?\hid#vid_0c45&pid_8018&mi_01&col02#7&e9493c3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
Writing 65-byte feature report...wrote -1 bytes:
 0A 01 01 02 29 01 03 03 03 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00
Closing device

PS C:\Users\abina59x\Downloads\hidapitester-windows-x86_64> .\hidapitester.exe --open-path "\\?\hid#vid_0c45&pid_8018&mi_01&col04#7&e9493c3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}" --length 65 --send-feature 0x0a,0x01,0x01,0x02,0x29,0x01,0x03,0x03,0x03,0,0,0,0x01,0x01
Opening device. path: \\?\hid#vid_0c45&pid_8018&mi_01&col04#7&e9493c3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
Writing 65-byte feature report...wrote -1 bytes:
 0A 01 01 02 29 01 03 03 03 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00
Closing device

PS C:\Users\abina59x\Downloads\hidapitester-windows-x86_64> .\hidapitester.exe --open-path "\\?\hid#vid_0c45&pid_8018&mi_01&col03#7&e9493c3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd" --length 65 --send-feature 0x0a,0x01,0x01,0x02,0x29,0x01,0x03,0x03,0x03,0,0,0,0x01,0x01
Opening device. path: \\?\hid#vid_0c45&pid_8018&mi_01&col03#7&e9493c3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
Writing 65-byte feature report...wrote -1 bytes:
 0A 01 01 02 29 01 03 03 03 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00
Closing device

PS C:\Users\abina59x\Downloads\hidapitester-windows-x86_64> .\hidapitester.exe --open-path "\\?\hid#vid_0c45&pid_8018&mi_01&col05#7&e9493c3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}" --length 65 --send-feature 0x0a,0x01,0x01,0x02,0x29,0x01,0x03,0x03,0x03,0,0,0,0x01,0x01
Opening device. path: \\?\hid#vid_0c45&pid_8018&mi_01&col05#7&e9493c3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
Writing 65-byte feature report...wrote -1 bytes:
 0A 01 01 02 29 01 03 03 03 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00
Closing device

PS C:\Users\abina59x\Downloads\hidapitester-windows-x86_64> .\hidapitester.exe --open-path "\\?\hid#vid_0c45&pid_8018&mi_00#7&30562c40&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd" --length 65 --send-feature 0x0a,0x01,0x01,0x02,0x29,0x01,0x03,0x03,0x03,0,0,0,0x01,0x01
Opening device. path: \\?\hid#vid_0c45&pid_8018&mi_00#7&30562c40&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
Writing 65-byte feature report...wrote 65 bytes:
 0A 01 01 02 29 01 03 03 03 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00
Closing device

Same as linux, I don’t see any changes on the keyboard.

@rnayabed
Copy link
Owner Author

rnayabed commented Mar 2, 2023

Please attach screenshots of the RK Software. Note that I should be able to see the full list of lighting modes as well. That is very important.

It looks like the protocol is also different, so please do the following

You need to record some tests and send the output (.pcap) of the tests to me. You need to use Windows for this.

Setting up:

  1. install USBPCAP from https://desowin.org/usbpcap/

How to record:

  1. launch RK Keyboard Software
  2. launch USBPcapCMD.exe from C:\Program Files\USBPcap
  3. select the hub that you have connected your RK keyboard to. Generally it shows up as "HID Keyboard Device"
  4. enter file name as test_.pcap. After you enter it will start recording.
  5. proceed with the test steps.
  6. when test is done, do Ctrl+C to exit the program. The recording will stop.
  7. send over the .pcap files over

Note: Follow all the steps AT ONCE.
For example, if you are asked to set x to 2 you should set x to 2 from the previous value AT ONCE, and not stopping midway at 3 or something.

Test 1

Before Recording, do the following:

  1. Open RK Software
  2. Select the first lighting mode (Mention the name as well from the screenshot)
  3. Set brightness to 5 (max)
  4. Set animation to 5 (max)
  5. Set sleep as No Sleep (max)

== Start Recording ==

Tests:

  1. Select explode light mode
  2. Select sleep at middle (3)
  3. Select Animation Speed as 2
  4. Select Sleep Time as 10 minutes

Test 2

BEFORE Testing, do the following:

  1. Select "Customize" Light effect mode.
  2. Turn off EVERY KEY
  3. Set sleep as 30 minutes

== Start Recording ==

  1. Select the custom lighting mode (Mention the name as well from the screenshot)
  2. Click on Q Key.
  3. Click on Esc Key.
  4. Click on Right Arrow Key.
  5. Set sleep to 20 minutes
  6. Select "Glittering" Light effect mode
  7. Select "Ripples" Light effect mode

After your tests are done, send me the 2 .pcap files. Also, send me the exact model name, Vendor ID and product ID of your keyboard.

@syfq91
Copy link

syfq91 commented Mar 2, 2023

Hi, RK855 doesn’t have red led, what should I use to test?

And where can I check the exact model name, vendor id & product id?

Below is the screenshot of the software:

1 start page

2 layout

3 macro

4 light

5 setting

@rnayabed
Copy link
Owner Author

rnayabed commented Mar 2, 2023

Ignore the colour part, included it by mistake. Just set the keys ignoring specific color

@rnayabed
Copy link
Owner Author

rnayabed commented Mar 2, 2023

Updated the tests, pls check again

@syfq91
Copy link

syfq91 commented Mar 4, 2023

Hi, here the requested files.

Here the USBPcap window, for select filter I choose 2:
1 pcap

Test 1

Before Recording, do the following:

Open RK Software: Done
Select the first lighting mode: I choose static mode
Set brightness to 5 (max): I set brightness to 15
Set animation to 5 (max): I skipped this, not available in RK software
Set sleep as No Sleep (max): I skipped this, not available in RK software

t1 1

== Start Recording ==

Tests:

Select explode light mode: Done
Select sleep at middle (3): I choose 7, as shown in the screenshot
Select Animation Speed as 2: I skipped this, not available in RK software
Select Sleep Time as 10 minutes: I skipped this, not available in RK software

t1 2

Test 2

BEFORE Testing, do the following:

Select "Customize" Light effect mode. : I skipped this, not available in RK software
Turn off EVERY KEY : I skipped this, not available in RK software, but I choose “close backlight” mode, refer screenshot below
Set sleep as 30 minutes : I skipped this, not available in RK software

t2 1

== Start Recording ==

Select the custom lighting mode: I skipped this, not available in RK software
Click on Q Key.: Done
Click on Esc Key.: Done
Click on Right Arrow Key.: Done
Set sleep to 20 minutes: I skipped this, not available in RK software
Select "Glittering" Light effect mode : Done, refer screenshot below

t2 2

Select "Ripples" Light effect mode: Done, refer screenshot below

t2 3

Refer the pcap files below:

pcap.zip

@rnayabed
Copy link
Owner Author

rnayabed commented Mar 4, 2023

It looks like these brands of keyboards use a totally different protocol 🥲

No issues, I am trying to make sense of it. Thanks for sending info, I may send some more tests (very simple), please be patient :)

@rnayabed
Copy link
Owner Author

rnayabed commented Mar 7, 2023

Hi, can you do another test with the following?

Test 3

Before recording

  1. Open RK Software

Start Recording

Steps

  1. Exit the RK Software

Stop Recording

Test 4

Before recording

Do nothing

Start Recording

Steps

  1. Start RK Software
  2. Exit the RK Software

Stop Recording

Test 5

Before recording

  1. Start RK Software

Start Recording

Steps

Do nothing

Stop Recording

Test 6

Before recording

  1. Start RK Software
  2. Exit RK Software

Start Recording

Steps

Do nothing

Stop Recording

@syfq91
Copy link

syfq91 commented Mar 11, 2023

Hi, attach the test data.
test_3-6.zip

@rnayabed
Copy link
Owner Author

rnayabed commented Mar 26, 2023

The protocol looks very obfuscated and at the time of writing this I feel unmotivated to work on this. My initial aim was to be able to configure my keyboard on linux, which grew into a bigger project. However, it looks like there are models that totally have different vendor IDs and protocols but still are sold as royal kludge keyboards. Their official software is also different. The fact that I do not physically own a 0x0c45 board also makes it harder. Thankfully, most RK keyboard models use the 0x258a protocol.

Maybe someday I can look into it. It should not be that hard, and the .pcap files are already uploaded here. Anyone is free to examine them and report back.

@rnayabed rnayabed added the help wanted Extra attention is needed label Mar 26, 2023
@rnayabed rnayabed changed the title Add RK68K/RK855 (0c45:8018) Add support for VID 0c45 boards [RK68K/RK855 (0c45:8018), etc.] Mar 26, 2023
@rnayabed rnayabed pinned this issue Mar 26, 2023
@rowanad
Copy link

rowanad commented Aug 12, 2023

I have found a GitHub project which has a similar function to this one, but seems to be intended for keyboards with VID 0x0c45:

Keymeleon

Perhaps their code can be used or their approach might be able to be adapted? I haven't looked into their code/documentation properly yet but once I get a chance I will share some more details (unless you beat me to it!). Also, they cite this project as being helpful in helping them understand the protocol:

rgb_keyboard

That could also be a good (possibly better) resource.

I don't have much knowledge in this area of software dev but I do have a small amount of relevant knowledge, so if I get time over the next month or two I might see if I can contribute some code also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants