fix: apply all LoRa config changes live without rebooting - #9962
Conversation
|
Inside of MenuHandler.cpp are several menus that allow you to change Radio Preset, Frequency Slot, and LoRa Region - all of these still induce a reboot. Do you want to address this as part of this PR? |
b60ef84 to
923e536
Compare
|
Thanks for catching that! Fixed in |
Only caught it because I wrote it myself :D Looks good to me! |
All LoRa radio settings (SF, BW, CR, frequency, power, preset, sx126x_rx_boosted_gain) now apply immediately via reconfigure() without requiring a node reboot. - AdminModule: requiresReboot = false for all LoRa config changes; LoRa changes were already handled by the configChanged observer calling reconfigure() but the reboot flag was set unnecessarily - AdminModule: validate LORA_24 region against radio hardware at config time; reject with BAD_REQUEST if hardware lacks 2.4 GHz capability (wideLora() returns false or no radio instance) - SX126xInterface/LR11x0Interface: apply sx126x_rx_boosted_gain in reconfigure(); register 0x08AC is writable in STDBY mode (SX1261/2 datasheet §9.6); retention registers written so setting survives warm-sleep cycles; log warning on setter failure - DebugRenderer: show BW/SF/CR on debug screen when custom modem is active instead of the preset name - DisplayFormatters: clarify comment on getModemPresetDisplayName
…enus Region, frequency slot, and radio preset pickers in MenuHandler all called reloadConfig() then immediately set rebootAtMsec. reloadConfig() already fires the configChanged observer which calls reconfigure(), so the forced reboot was unnecessary — same rationale as the parent commit.
923e536 to
021f699
Compare
|
@Xaositek What do you think when will this get merged? |
|
I don't manage that - we'd still need CoPilot to review and @thebentern to sign off |
There was a problem hiding this comment.
Pull request overview
This PR aims to make LoRa configuration changes take effect immediately (via the existing configChanged → RadioInterface::reconfigure() path) rather than requiring a reboot, and improves LoRa debug display output.
Changes:
- Removes forced reboot behavior for LoRa config changes (admin + UI menu flows) and relies on live radio reconfiguration.
- Adds a runtime validation gate for selecting
LORA_24via admin config messages. - Applies
sx126x_rx_boosted_gainduringreconfigure()for SX126x/LR11x0 radios and improves debug rendering of custom BW/SF/CR.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/AdminModule.cpp | Stops requiring reboot for LoRa config changes; adds LORA_24 hardware validation in admin set-config handling. |
| src/mesh/SX126xInterface.cpp | Applies RX boosted gain mode during reconfigure() for live updates. |
| src/mesh/LR11x0Interface.cpp | Applies RX boosted gain mode during reconfigure() for live updates. |
| src/graphics/draw/MenuHandler.cpp | Removes post-change reboot scheduling for LoRa region/preset/slot menu actions. |
| src/graphics/draw/DebugRenderer.cpp | Displays explicit BW/SF/CR when using custom modem settings instead of preset name. |
| src/DisplayFormatters.cpp | Clarifies comment about "Custom" being a stable literal for non-preset mode. |
…-device menu Without a reboot, reconfigure() now applies region changes directly. Previously getRadio() caught the LORA_24-on-sub-GHz mismatch post-reboot and reverted to UNSET — that safety net is gone. Add an explicit wideLora() check in LoraRegionPicker so sub-GHz-only hardware silently ignores LORA_24 selection instead of attempting a live reconfigure with an invalid frequency.
…#9962) * fix: apply all LoRa config changes live without rebooting All LoRa radio settings (SF, BW, CR, frequency, power, preset, sx126x_rx_boosted_gain) now apply immediately via reconfigure() without requiring a node reboot. - AdminModule: requiresReboot = false for all LoRa config changes; LoRa changes were already handled by the configChanged observer calling reconfigure() but the reboot flag was set unnecessarily - AdminModule: validate LORA_24 region against radio hardware at config time; reject with BAD_REQUEST if hardware lacks 2.4 GHz capability (wideLora() returns false or no radio instance) - SX126xInterface/LR11x0Interface: apply sx126x_rx_boosted_gain in reconfigure(); register 0x08AC is writable in STDBY mode (SX1261/2 datasheet §9.6); retention registers written so setting survives warm-sleep cycles; log warning on setter failure - DebugRenderer: show BW/SF/CR on debug screen when custom modem is active instead of the preset name - DisplayFormatters: clarify comment on getModemPresetDisplayName * fix: remove redundant reboot after LoRa config changes in on-device menus Region, frequency slot, and radio preset pickers in MenuHandler all called reloadConfig() then immediately set rebootAtMsec. reloadConfig() already fires the configChanged observer which calls reconfigure(), so the forced reboot was unnecessary — same rationale as the parent commit. * fix: guard LORA_24 region selection against hardware capability in on-device menu Without a reboot, reconfigure() now applies region changes directly. Previously getRadio() caught the LORA_24-on-sub-GHz mismatch post-reboot and reverted to UNSET — that safety net is gone. Add an explicit wideLora() check in LoraRegionPicker so sub-GHz-only hardware silently ignores LORA_24 selection instead of attempting a live reconfigure with an invalid frequency. --------- Co-authored-by: elwimen <elwimen@users.noreply.github.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
…#9962) * fix: apply all LoRa config changes live without rebooting All LoRa radio settings (SF, BW, CR, frequency, power, preset, sx126x_rx_boosted_gain) now apply immediately via reconfigure() without requiring a node reboot. - AdminModule: requiresReboot = false for all LoRa config changes; LoRa changes were already handled by the configChanged observer calling reconfigure() but the reboot flag was set unnecessarily - AdminModule: validate LORA_24 region against radio hardware at config time; reject with BAD_REQUEST if hardware lacks 2.4 GHz capability (wideLora() returns false or no radio instance) - SX126xInterface/LR11x0Interface: apply sx126x_rx_boosted_gain in reconfigure(); register 0x08AC is writable in STDBY mode (SX1261/2 datasheet §9.6); retention registers written so setting survives warm-sleep cycles; log warning on setter failure - DebugRenderer: show BW/SF/CR on debug screen when custom modem is active instead of the preset name - DisplayFormatters: clarify comment on getModemPresetDisplayName * fix: remove redundant reboot after LoRa config changes in on-device menus Region, frequency slot, and radio preset pickers in MenuHandler all called reloadConfig() then immediately set rebootAtMsec. reloadConfig() already fires the configChanged observer which calls reconfigure(), so the forced reboot was unnecessary — same rationale as the parent commit. * fix: guard LORA_24 region selection against hardware capability in on-device menu Without a reboot, reconfigure() now applies region changes directly. Previously getRadio() caught the LORA_24-on-sub-GHz mismatch post-reboot and reverted to UNSET — that safety net is gone. Add an explicit wideLora() check in LoraRegionPicker so sub-GHz-only hardware silently ignores LORA_24 selection instead of attempting a live reconfigure with an invalid frequency. --------- Co-authored-by: elwimen <elwimen@users.noreply.github.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
|
Hi, @Elwimen thank you! This might also fix an issue where, when just changing LoRa max hops via the Android App, the node, with firmware 2.7.15, did not reboot. However, it did reboot with client.meshtastic.org when changing only LoRa max hops. meshtastic/Meshtastic-Android#4632 So am I correct in assuming that, with firmware 2.7.21 coming, the settings will apply right away? |
|
Hi @shalberd , I don't know when 2.7.21 will come. That is the question is probably for the @thebentern. Did you try latest Android app against develop branch? Does it behave the same? Idea is that setting are applied without node getting rebooted. |
|
The reason I am asking is: official releases, alpha like the coming 2.7.21, beta ... are based on the master branch as far as I know, and this particular commit as of now has not made it into the master branch. |
…#9962) * fix: apply all LoRa config changes live without rebooting All LoRa radio settings (SF, BW, CR, frequency, power, preset, sx126x_rx_boosted_gain) now apply immediately via reconfigure() without requiring a node reboot. - AdminModule: requiresReboot = false for all LoRa config changes; LoRa changes were already handled by the configChanged observer calling reconfigure() but the reboot flag was set unnecessarily - AdminModule: validate LORA_24 region against radio hardware at config time; reject with BAD_REQUEST if hardware lacks 2.4 GHz capability (wideLora() returns false or no radio instance) - SX126xInterface/LR11x0Interface: apply sx126x_rx_boosted_gain in reconfigure(); register 0x08AC is writable in STDBY mode (SX1261/2 datasheet §9.6); retention registers written so setting survives warm-sleep cycles; log warning on setter failure - DebugRenderer: show BW/SF/CR on debug screen when custom modem is active instead of the preset name - DisplayFormatters: clarify comment on getModemPresetDisplayName * fix: remove redundant reboot after LoRa config changes in on-device menus Region, frequency slot, and radio preset pickers in MenuHandler all called reloadConfig() then immediately set rebootAtMsec. reloadConfig() already fires the configChanged observer which calls reconfigure(), so the forced reboot was unnecessary — same rationale as the parent commit. * fix: guard LORA_24 region selection against hardware capability in on-device menu Without a reboot, reconfigure() now applies region changes directly. Previously getRadio() caught the LORA_24-on-sub-GHz mismatch post-reboot and reverted to UNSET — that safety net is gone. Add an explicit wideLora() check in LoraRegionPicker so sub-GHz-only hardware silently ignores LORA_24 selection instead of attempting a live reconfigure with an invalid frequency. --------- Co-authored-by: elwimen <elwimen@users.noreply.github.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
…#9962) * fix: apply all LoRa config changes live without rebooting All LoRa radio settings (SF, BW, CR, frequency, power, preset, sx126x_rx_boosted_gain) now apply immediately via reconfigure() without requiring a node reboot. - AdminModule: requiresReboot = false for all LoRa config changes; LoRa changes were already handled by the configChanged observer calling reconfigure() but the reboot flag was set unnecessarily - AdminModule: validate LORA_24 region against radio hardware at config time; reject with BAD_REQUEST if hardware lacks 2.4 GHz capability (wideLora() returns false or no radio instance) - SX126xInterface/LR11x0Interface: apply sx126x_rx_boosted_gain in reconfigure(); register 0x08AC is writable in STDBY mode (SX1261/2 datasheet §9.6); retention registers written so setting survives warm-sleep cycles; log warning on setter failure - DebugRenderer: show BW/SF/CR on debug screen when custom modem is active instead of the preset name - DisplayFormatters: clarify comment on getModemPresetDisplayName * fix: remove redundant reboot after LoRa config changes in on-device menus Region, frequency slot, and radio preset pickers in MenuHandler all called reloadConfig() then immediately set rebootAtMsec. reloadConfig() already fires the configChanged observer which calls reconfigure(), so the forced reboot was unnecessary — same rationale as the parent commit. * fix: guard LORA_24 region selection against hardware capability in on-device menu Without a reboot, reconfigure() now applies region changes directly. Previously getRadio() caught the LORA_24-on-sub-GHz mismatch post-reboot and reverted to UNSET — that safety net is gone. Add an explicit wideLora() check in LoraRegionPicker so sub-GHz-only hardware silently ignores LORA_24 selection instead of attempting a live reconfigure with an invalid frequency. --------- Co-authored-by: elwimen <elwimen@users.noreply.github.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Summary
All LoRa radio settings now apply immediately without requiring a node reboot.
requiresReboot = falsefor all LoRa config changes — theconfigChangedobserver already triggersreconfigure(), so the reboot was unnecessaryLORA_24region against radio hardware at config time; reject withBAD_REQUESTif the radio lacks 2.4 GHz capability (wideLora()returns false)setRxBoostedGainMode()insidereconfigure()sosx126x_rx_boosted_gainchanges apply live; register0x08ACis writable in STDBY mode (SX1261/2 datasheet §9.6); RadioLib writes retention registers so the setting survives warm-sleep cycles; logs warning on failureuse_presetis false, show actualBW/SF/CRvalues on the debug screen instead of the preset namegetModemPresetDisplayNameThis consolidates and supersedes #9931.
Hardware tested
sx126x_rx_boosted_gaintoggle, SF/BW/CR change, and preset change all apply live with no rebootNo access to T-Deck / T-Beam / T-1000E for regression testing.