Skip to content

Bridge voronFDM to Moonraker only once Moonraker has identified Klipper - #126

Merged
solutionphil merged 1 commit into
alphafrom
relay-wait-ready
Sep 5, 2026
Merged

solutionphil merged 1 commit into
alphafrom
relay-wait-ready

Conversation

@solutionphil

Copy link
Copy Markdown
Owner

Symptom: on a loaded boot the display comes up some 40 s late because Klipper restarts once, unasked.

Measured 2026-09-05 on the dev printer (boot with the post-update setup running in the background): Moonraker listening at 64 s; voronFDM's printer.objects.subscribe and its first printer.gcode.script refused with Method not found at 65–66 s, because Moonraker had not finished identifying Klipper and had not registered the printer.* methods yet; two FIRMWARE_RESTARTs at 66.7 s and 66.9 s (the second an internal error inside the first); Klipper back at 82 s. No kit script and no KAOS macro sends that command; the request strings are in the display binary.

Change: scripts/wsrelay/relay.py polls /server/info and makes the bridge only once klippy_state is ready, error or shutdown (an error is exactly what the panel must be allowed to show). Past UP_WAIT, now 120 s, it bridges regardless, so a Klipper that never comes up cannot take the display with it. voronFDM is held, not refused, as before.

Delivery: optimize-boot.sh already refreshes ~/wsrelay/relay.py from the kit when it differs, active after the next boot.

Checks: py_compile clean; the readiness poll is exception-safe (any failure keeps waiting, the cap ends the wait).

🤖 Generated with Claude Code

Between "Websocket Opened" and the end of its Klippy handshake Moonraker has not registered the
printer.* methods yet and answers them with "Method not found". That window is milliseconds on an
idle host and seconds on a loaded one, and voronFDM, refused on its subscribe and its first gcode,
answers with printer.firmware_restart. Measured 2026-09-05 on the dev printer during a boot with the
post-update setup running in the background: Moonraker listening at 64 s, voronFDM's requests refused
at 65-66 s, two FIRMWARE_RESTARTs at 66.7 s and 66.9 s (the second one an internal error inside the
first), Klipper back at 82 s, the panel some 40 s later than it needed to be. No kit script and no
KAOS macro sends that command; the request strings are in the display binary.

The relay now polls /server/info and makes the bridge only once klippy_state is ready, error or
shutdown -- an error is exactly what the panel must be allowed to show. Past UP_WAIT (now 120 s) it
bridges regardless, so a Klipper that never comes up still cannot take the display with it. voronFDM
is held, not refused, as before: it never retries a refused connection.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@solutionphil
solutionphil merged commit 5270fe1 into alpha Sep 5, 2026
5 checks passed
@solutionphil
solutionphil deleted the relay-wait-ready branch September 5, 2026 08:10
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.

1 participant