Skip to content

fix: apply all LoRa config changes live without rebooting - #9962

Merged
thebentern merged 5 commits into
meshtastic:developfrom
Elwimen:fix/lora-live-reconfig
Mar 22, 2026
Merged

fix: apply all LoRa config changes live without rebooting#9962
thebentern merged 5 commits into
meshtastic:developfrom
Elwimen:fix/lora-live-reconfig

Conversation

@Elwimen

@Elwimen Elwimen commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Summary

All LoRa radio settings now apply immediately without requiring a node reboot.

  • AdminModule: set requiresReboot = false for all LoRa config changes — the configChanged observer already triggers reconfigure(), so the reboot was unnecessary
  • AdminModule: validate LORA_24 region against radio hardware at config time; reject with BAD_REQUEST if the radio lacks 2.4 GHz capability (wideLora() returns false)
  • SX126xInterface / LR11x0Interface: call setRxBoostedGainMode() inside reconfigure() so sx126x_rx_boosted_gain changes apply live; register 0x08AC is writable in STDBY mode (SX1261/2 datasheet §9.6); RadioLib writes retention registers so the setting survives warm-sleep cycles; logs warning on failure
  • DebugRenderer: when use_preset is false, show actual BW/SF/CR values on the debug screen instead of the preset name
  • DisplayFormatters: clarify comment on getModemPresetDisplayName

This consolidates and supersedes #9931.

Hardware tested

  • Heltec Wireless Tracker v4 (SX1262) — confirmed sx126x_rx_boosted_gain toggle, SF/BW/CR change, and preset change all apply live with no reboot

No access to T-Deck / T-Beam / T-1000E for regression testing.

@github-actions github-actions Bot added the hardware-support Hardware related: new devices or modules, problems specific to hardware label Mar 20, 2026
@Xaositek

Copy link
Copy Markdown
Contributor

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?

@Elwimen
Elwimen force-pushed the fix/lora-live-reconfig branch 2 times, most recently from b60ef84 to 923e536 Compare March 20, 2026 15:07
@Elwimen

Elwimen commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for catching that! Fixed in 923e536 — removed the redundant rebootAtMsec from all three pickers since reloadConfig() already handles it via reconfigure().

@Xaositek

Xaositek commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Thanks for catching that! Fixed in 923e536 — removed the redundant rebootAtMsec from all three pickers since reloadConfig() already handles it via reconfigure().

Only caught it because I wrote it myself :D Looks good to me!

@Xaositek Xaositek added enhancement New feature or request and removed hardware-support Hardware related: new devices or modules, problems specific to hardware labels Mar 20, 2026
Elwimen added 2 commits March 20, 2026 22:19
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.
@Elwimen
Elwimen force-pushed the fix/lora-live-reconfig branch from 923e536 to 021f699 Compare March 20, 2026 21:20
@Elwimen

Elwimen commented Mar 21, 2026

Copy link
Copy Markdown
Contributor Author

@Xaositek What do you think when will this get merged?

@Xaositek

Copy link
Copy Markdown
Contributor

I don't manage that - we'd still need CoPilot to review and @thebentern to sign off

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make LoRa configuration changes take effect immediately (via the existing configChangedRadioInterface::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_24 via admin config messages.
  • Applies sx126x_rx_boosted_gain during reconfigure() 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.

Comment thread src/modules/AdminModule.cpp
Comment thread src/modules/AdminModule.cpp
Comment thread src/graphics/draw/MenuHandler.cpp
Comment thread src/mesh/SX126xInterface.cpp
Comment thread src/mesh/LR11x0Interface.cpp
Elwimen and others added 3 commits March 21, 2026 22:32
…-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.
@thebentern
thebentern merged commit 8384659 into meshtastic:develop Mar 22, 2026
69 of 70 checks passed
oumike pushed a commit to oumike/firmware that referenced this pull request Mar 25, 2026
…#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>
oumike pushed a commit to oumike/firmware that referenced this pull request Mar 27, 2026
…#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>
@shalberd

shalberd commented Mar 27, 2026

Copy link
Copy Markdown

Hi, @Elwimen thank you!
Will this be merged into master and make it into the next firmware release?

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?

@Elwimen

Elwimen commented Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

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.

@shalberd

shalberd commented Mar 31, 2026

Copy link
Copy Markdown

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.

mariotti pushed a commit to mariotti/firmware that referenced this pull request May 6, 2026
…#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>
@Elwimen
Elwimen deleted the fix/lora-live-reconfig branch July 31, 2026 11:57
Itzdavid01 pushed a commit to Itzdavid01/firmware that referenced this pull request Sep 5, 2026
…#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants