zmkfirmware / zmk

ZMK Firmware Repository
https://zmk.dev/
MIT License
2.48k stars 2.56k forks source link

Soft off only turn off the left side of my Corne split keyboard #2274

Closed picrots closed 2 months ago

picrots commented 2 months ago

I recently built a wireless Corne keyboard on the original v3 PCB design which doesn't have a power switch.

To turn my keyboard off I setup a keymap to trigger the Soft Off feature and it does work however only on the master side and the right side stays up.

I tried to create additional key map on the right side but that also only turn the left side off.

I am using Corne V3 and Nice!nano controller. My last build was through github action on 15th Apr 2024.

pearl-omalishe commented 2 months ago

Same here, also there is a discord thread with some other people having same problem: https://discord.com/channels/719497620560543766/1225441220311126106/1225441220311126106

GermanG commented 2 months ago

Duplicating my comment from discord: Looking at https://github.com/zmkfirmware/zmk/blob/main/app/src/behaviors/behavior_soft_off.c#L79 and https://github.com/zmkfirmware/zmk/blob/main/app/dts/behaviors/soft_off.dtsi#L12 Tried

&soft_off {
    split-peripheral-off-on-press;
    hold-time-ms = <5000>; // Only turn off it the key is held for 5 seconds or longer.
};

Even commenting out hold-time-ms (just in case), but without luck

edit: Uploaded a USB logging firmware plugged into the right side, the messages are

[00:03:56.088,287] <dbg> zmk: split_listener:                                                                         
[00:03:58.442,138] <dbg> zmk: split_svc_run_behavior: offset 0 len 19                                                 
[00:03:58.442,169] <dbg> zmk: split_svc_run_behavior: keymap_s with params 0 0: pressed? 1                            
[00:03:58.442,291] <err> zmk: Failed to invoke behavior keymap_s: -22                                                 
[00:03:58.674,652] <dbg> zmk: split_svc_run_behavior: offset 0 len 19                                                 
[00:03:58.674,682] <dbg> zmk: split_svc_run_behavior: keymap_s with params 0 0: pressed? 0                            
[00:03:58.674,804] <err> zmk: Failed to invoke behavior keymap_s: -22     

Looks like the behavior_dev is being truncated somehow.

edit2:

[00:00:24.612,426] <dbg> zmk: split_bt_invoke_behavior_payload:                                                       
[00:00:24.612,487] <dbg> zmk: split_central_split_run_callback:                                                       
[00:00:24.706,176] <dbg> zmk: kscan_matrix_read: Sending event at 2,5 state off                                       
[00:00:24.706,268] <dbg> zmk: zmk_kscan_process_msgq: Row: 2, col: 5, position: 29, pressed: false                    
[00:00:24.706,268] <dbg> zmk: position_state_changed_listener: 29 bubble (no undecided hold_tap active)               
[00:00:24.706,329] <dbg> zmk: zmk_keymap_apply_position_state: layer: 3 position: 29, binding name: keymap_soft_off   
[00:00:24.706,420] <err> zmk: Truncated behavior label keymap_soft_off to keymap_s before invoking peripheral behavior
picrots commented 1 month ago

This problem has not been resolved for me yet and right side of my Corne stays awake. Build date: 10 May 2024 (using github actions)

GermanG commented 1 month ago

Can you check #2300? Also use my ZMK repo to verify if that's your case