Skip to content

feat(atx): surface extension board responsiveness in ATX power control - #1526

Open
ilyongnoh-ux wants to merge 1 commit into
jetkvm:devfrom
ilyongnoh-ux:fix/atx-board-responsiveness
Open

feat(atx): surface extension board responsiveness in ATX power control#1526
ilyongnoh-ux wants to merge 1 commit into
jetkvm:devfrom
ilyongnoh-ux:fix/atx-board-responsiveness

Conversation

@ilyongnoh-ux

Copy link
Copy Markdown

What

When the ATX extension board is unpowered, miswired, or the RJ-12 cable is bad, the board sends no status lines at all — but the UI shows only greyed-out LEDs, indistinguishable from "PC is off". Users cannot tell that the board itself is not talking to the device, and several reports of exactly this have gone unresolved for a long time.

How

  • App: track the unix time of the last status line received from the board (atxLastLineTime, reset on mount). ATXState gains a backward-compatible responsive field (existing fields untouched): true if a line arrived within the last 10s. The atxState events pushed by the worker set it to true (a line just arrived); rpcGetATXState and both MQTT snapshot publishers compute it via a shared helper so the retained topic doesn't flap.
  • UI: ATX Power Control polls getATXState every 5s while open and shows an amber warning above the controls when responsive === false: "No response from the ATX extension board. Check the RJ-12 cable and board power." Buttons stay enabled. Older backends (field absent) show no banner.
  • i18n: message added to en and all 13 other locales per localization/I18N_BEST_PRACTICES.md.

Testing

Deployed on a JetKVM (v2, system 0.2.8, 0.5.8-based build) with an ATX board that is genuinely unresponsive (0 bytes on the extension UART since boot): the banner appears in the popover and updates with the 5s poll; the rest of the UI is unaffected. UI build (paraglide compile + tsc + vite) passes.

🤖 Generated with Claude Code

When the ATX extension board is unpowered, miswired or broken, it never
sends a status line over serial. The UI showed only grey LEDs, giving
no hint that the board itself is not responding (see jetkvm#327 and similar
community reports).

Track the unix time of the last status line received by the ATX worker
(reset on mount) and consider the board responsive if a line arrived
within the last 10 seconds:

- ATXState gains a `responsive` field (existing fields unchanged).
- getATXState computes it from the last-line timestamp; the atxState
  events pushed right after a line is read report responsive=true, and
  the periodic/connect MQTT snapshots use the same helper so the
  retained topic does not flap.
- The ATX power control UI polls getATXState every 5 seconds while
  open and shows an amber warning when the board is not responding,
  suggesting to check the RJ-12 cable and board power. Controls stay
  enabled so the user can still try. The message is localized for all
  supported locales.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 111eb94b72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread mqtt_publish.go
HDD: ledHDDState.Load(),
Power: ledPWRState.Load(),
HDD: ledHDDState.Load(),
Responsive: atxBoardResponsive(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Publish ATX responsiveness changes through MQTT debounce

With the default MQTT debounce_ms of 500, this snapshot still goes through publishATXState, whose debouncer only republishes on Power/HDD changes or the first frame and otherwise returns early for unchanged LED states. When the board stops sending lines but the last Power/HDD values are unchanged, the periodic snapshot computes Responsive: false here but no retained atx/state update is emitted, so MQTT/Home Assistant keeps reporting the board as responsive until an LED transition or MQTT manager restart. Publish responsiveness-only changes outside the HDD debounce path or include Responsive in the debounce change detection.

Useful? React with 👍 / 👎.

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