Skip to content

feat(ui): add "Try Wake Host" button to no-signal overlay#1236

Open
jlian wants to merge 3 commits intojetkvm:devfrom
jlian:feat/usb-remote-wakeup
Open

feat(ui): add "Try Wake Host" button to no-signal overlay#1236
jlian wants to merge 3 commits intojetkvm:devfrom
jlian:feat/usb-remote-wakeup

Conversation

@jlian
Copy link
Copy Markdown
Contributor

@jlian jlian commented Mar 2, 2026

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.

image

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: Add onWakeHost and isWaking props to HDMIErrorOverlay, render "Try Wake Host" button and sleep hint in the no-signal state
  • WebRTCVideo.tsx: Add handleWakeHost callback that sends spacebar HID keypress via JSON-RPC, wire it to the overlay
  • en.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

  • Ran make test_e2e locally and passed
  • Linked to issue(s) above by issue number
  • One problem per PR (no unrelated changes)
  • Lints pass; CI green

Note

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 optionalAttrs for gadget items and a new writer that always sets IgnoreErrors, then moves HID wakeup_on_write into 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.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 2, 2026

CLA assistant check
All committers have signed the CLA.

@jlian jlian force-pushed the feat/usb-remote-wakeup branch from 06d6763 to cf71baa Compare March 2, 2026 05:20
@jlian jlian marked this pull request as draft March 2, 2026 05:24
@jlian jlian force-pushed the feat/usb-remote-wakeup branch from cf71baa to f2c2be0 Compare March 2, 2026 05:34
@mithun3 mithun3 mentioned this pull request Mar 12, 2026
1 task
@adamshiervani adamshiervani mentioned this pull request Mar 25, 2026
jlian added 3 commits April 2, 2026 14:28
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.
@adamshiervani adamshiervani force-pushed the feat/usb-remote-wakeup branch from 49c9efc to 9adfced Compare April 2, 2026 12:34
@jlian jlian marked this pull request as ready for review April 2, 2026 16:46
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

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);
});
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

return files
}

func (tx *UsbGadgetTransaction) writeGadgetAttrsOptional(basePath string, attrs gadgetAttributes, component string, beforeChange []string) (files []string) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants