Repository navigation
fix: keep SEGV traces, seed variables.cfg keys via SAVE_VARIABLE, re-enable networking at boot - #360
Merged
Merged
Conversation
…enable networking at boot
… after any Klippy state
RobeMartins
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three boot and shutdown problems seen on the RF50 boxes. A SEGV on stop left no trace, because the next run emptied the fault log. Repo variables.cfg keys never reached a box, because Klipper rewrites that file from memory. And a box with networking turned off stayed locked out until someone opened the Wi-Fi page. This PR keeps the fault log across runs, seeds missing variables.cfg keys through SAVE_VARIABLE, repairs a variables.cfg that Klipper cannot load (then restarts Klipper so it loads the fix), and turns networking back on at boot.
Changes
variable_defaults()returns the repo keys that can be sent (skips mmu_*, '%', ';' and non-literals)_repair_variablesruns the same checks as Klipper'ssave_variables.loadVariables; an unloadable file is backed up and rewritten as one sorted[Variables]section (the later duplicate wins, values Klipper rejects are dropped, an escaped%%is kept), written withatomic_write_textboot_changed, so Klipper is restarted (service restart, works from the error state) once Moonraker is up and no job runs_seed_variablessends SAVE_VARIABLE once for each repo key missing fromprinter.save_variables.variables, and sends again after any Klippy state change (a fast restart emits only "ready")_async_initializeruns_ensure_networking_enabled(), sonmcli networking offis cleared at boot, not only in the Wi-Fi preflightMotivation
Tests
TestVariableDefaults,TestRepairVariables(escaped '%', failed write keeps the original),TestBootChanged.test_variables_cfg_repaired, networking assert intest_happy_path_full_initFuture work