ch57x-keyboard-tool icon indicating copy to clipboard operation
ch57x-keyboard-tool copied to clipboard

v1.4.2 broken for 3x1-1 keyboard

Open BlinxFox opened this issue 1 year ago • 7 comments

Hi,

I tried to upload a keys.yaml with v1.4.2. There was no output when running ch57x-keyboard-tool. But also the keyboard mapping was not updated.

Tested with v1.2.0 which worked.

Currently running on Ubuntu 22.04.3 LTS

BlinxFox avatar Jun 05 '24 20:06 BlinxFox

Same problem, same solution, but on Windows 10 Pro 22H2.

thelegend09 avatar Jun 26 '24 00:06 thelegend09

Had a quick look with Wireshark:

Running these commands:

./ch57x-keyboard-tool led 1
./ch57x-keyboard-tool led 0

I found that for the working v1.2.0 sends HID-Data as the following: 0000 03 a1 01 00 00 00 00 00 00 00 00 00 00 00 00 00

The broken v1.4.2 sends the following: 0000 aa a1 00 00 00 00 00 00 00 00 00 00 00 00 00 00

-> The broken does not send the starting 0x03.

Hacking the 0x03 in the HID-Data fixes LED for me.

diff --git a/src/keyboard/k8890.rs b/src/keyboard/k8890.rs
index 4c05b77..e6beef8 100644
--- a/src/keyboard/k8890.rs
+++ b/src/keyboard/k8890.rs
@@ -60,9 +60,9 @@ impl Keyboard for Keyboard8890 {
     }
 
     fn set_led(&mut self, n: u8) -> Result<()> {
-        self.send(&[0xa1, 0x01, 0, 0, 0, 0, 0, 0])?;
-        self.send(&[0xb0, 0x18, n, 0, 0, 0, 0, 0])?;
-        self.send(&[0xaa, 0xa1, 0, 0, 0, 0, 0, 0])?;
+        self.send(&[0x03, 0xa1, 0x01, 0, 0, 0, 0, 0, 0])?;
+        self.send(&[0x03, 0xb0, 0x18, n, 0, 0, 0, 0, 0])?;
+        self.send(&[0x03, 0xaa, 0xa1, 0, 0, 0, 0, 0, 0])?;
         Ok(())
     }
 

BlinxFox avatar Jun 26 '24 16:06 BlinxFox

I had the same problem. I used 1.24, but it has another issue.

I have the knob set to volumeup on cw, volumedown on ccw.

The macro pad works fine initially, but any time I unplug it and plug it back in cw and ccw both trigger volumedown.

WayneManion avatar Jun 26 '24 21:06 WayneManion

cw and ccw both trigger volumedown.

Works for me. I'm not sure if you also have a broken knob...

BlinxFox avatar Jun 27 '24 18:06 BlinxFox

I was using a Windows box with 1.2.4 yesterday. I kept getting strange results with the knob.

I installed v1.2.0 on my Arch machine. I uploaded the config and it worked fine.

The latest version does not work on my 3x1+K macro pad.

WayneManion avatar Jun 27 '24 22:06 WayneManion

I am experiencing the same issue with v1.4.2 on Windows 11. v1.2.0 works just fine but the latest version does not actually upload the config to the keyboard

southpaw5271 avatar Jul 16 '24 13:07 southpaw5271

Just to add, I have a 4x1 version (i.e. 4 keys, no knobs, such as this). v1.4.2 does not work, but v1.2.4 works just fine. I can map all 4 keys with this:

orientation: normal

rows: 1
columns: 4
knobs: 0

layers:
  - buttons:
      - ["volumedown", "volumeup", "mute", "play"]
    knobs:

Another happy customer, thanks @kriomant!

icyrockcom avatar Jul 22 '24 23:07 icyrockcom

Same with 1 column, 3 rows, 1 knob device on Windows.

1.42 seemingly uploads but nothing is changed, 1.24 works fine.

DeviceID: USB\VID_1189&PID_8890\9&2798F80&0&2 ClassGuid: {36fc9e60-c465-11cf-8056-444553540000} HardwareID: {USB\VID_1189&PID_8890&REV_0000, USB\VID_1189&PID_8890}

Attaching mapping yml and Wireshark captures as result of 'Get-Content mapping.yaml | .\ch57x-keyboard-tool.exe upload' for both versions.

captures.zip

mapping.zip

vBardys avatar Aug 22 '24 12:08 vBardys

Please try 1.4.4

kriomant avatar Aug 25 '24 15:08 kriomant

1.4.4 works for me, thanks!

Please try 1.4.4

vBardys avatar Aug 26 '24 10:08 vBardys