feat(ui): add "Try Wake Host" button to no-signal overlay#1236
feat(ui): add "Try Wake Host" button to no-signal overlay#1236jlian wants to merge 3 commits intojetkvm:devfrom
Conversation
06d6763 to
cf71baa
Compare
cf71baa to
f2c2be0
Compare
Set bmAttributes to 0xa0 (bus-powered + remote wakeup) in the USB configuration descriptor, and enable wakeup_on_write on all HID functions (keyboard, absolute mouse, relative mouse). Together with the corresponding kernel f_hid patch in rv1106-system, this allows the JetKVM to wake a sleeping host by sending keyboard or mouse input through the web UI or API. Tested on JetKVM v2 waking a Windows 11 host from S3 sleep. Requires: jetkvm/rv1106-system kernel patch (f_hid wakeup_on_write) Closes: jetkvm#120 Closes: jetkvm#674
When no HDMI signal is detected, the overlay now shows: - A hint that the target computer may be sleeping - A "Wake Host" button that sends a spacebar press/release via HID This helps users discover that they can wake a sleeping host directly from the JetKVM web interface, complementing the USB remote wakeup kernel support.
Move wakeup_on_write from attrs to optionalAttrs so it is written with IgnoreErrors=true. On kernels without rv1106-system#57, the configfs attribute does not exist and writing to it would fail, breaking the entire USB gadget initialization. With this change, wakeup_on_write is silently skipped on unpatched kernels while still being set on patched ones.
49c9efc to
9adfced
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| send("keyboardReport", { keys: [0, 0, 0, 0, 0, 0], modifier: 0 }, () => { | ||
| setTimeout(() => setIsWaking(false), 3000); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Wake button stuck forever if RPC send silently fails
Medium Severity
The handleWakeHost callback sets isWaking to true then relies on nested send callbacks to eventually reset it to false. However, the send function in useJsonRpc returns immediately without invoking the callback when rpcDataChannel?.readyState !== "open". If the data channel drops between button click and RPC completion, setIsWaking(false) is never called, leaving the button permanently disabled with "Sending wake signal..." text and no way to recover short of a page refresh.
| return files | ||
| } | ||
|
|
||
| func (tx *UsbGadgetTransaction) writeGadgetAttrsOptional(basePath string, attrs gadgetAttributes, component string, beforeChange []string) (files []string) { |
There was a problem hiding this comment.
Dead wakeup_on_write check after refactoring to optionalAttrs
Low Severity
The IgnoreErrors: key == "wakeup_on_write" check in writeGadgetAttrs is now dead code. This PR moved wakeup_on_write from attrs to optionalAttrs across all three HID configs, so writeGadgetAttrs will never see that key. The leftover condition is misleading and could confuse future maintainers about where optional attribute handling lives.


Summary
When JetKVM shows "No HDMI signal detected", add a hint about sleeping hosts and a "Try Wake Host" button that sends a spacebar press/release to attempt waking the host via USB HID.
Builds on #1235 (USB remote wakeup backend) and jetkvm/rv1106-system#57 (kernel f_hid patch). With those in place, this button provides a one-click way to wake a sleeping host directly from the JetKVM web UI.
Changes
VideoOverlay.tsx: AddonWakeHostandisWakingprops toHDMIErrorOverlay, render "Try Wake Host" button and sleep hint in the no-signal stateWebRTCVideo.tsx: AddhandleWakeHostcallback that sends spacebar HID keypress via JSON-RPC, wire it to the overlayen.json: Add 3 localization strings (video_overlay_no_hdmi_try_wake,video_overlay_no_hdmi_wake_host,video_overlay_no_hdmi_wake_host_sending)Checklist
make test_e2elocally and passedNote
Medium Risk
Adds a new user-triggered HID key injection path from the UI and tweaks USB gadget config attribute writing to tolerate missing kernel features, which could affect input behavior or gadget initialization on some devices/kernels.
Overview
Adds a "Try Wake Host" action to the No HDMI signal overlay that sends a spacebar press+release via JSON-RPC (
keyboardReport), with a short in-flight/disabled state and new i18n strings.On the backend USB gadget configuration side, introduces
optionalAttrsfor gadget items and a new writer that always setsIgnoreErrors, then moves HIDwakeup_on_writeinto these optional attributes for keyboard/absolute mouse/relative mouse to improve compatibility with kernels that lack the feature.Written by Cursor Bugbot for commit 9adfced. This will update automatically on new commits. Configure here.