Skip to content

Honour RX_BOOSTED_GAIN default on non-SX126x radios - #3864

Open
AlexandrTyshchenko wants to merge 1 commit into
meshcore-dev:devfrom
AlexandrTyshchenko:fix/lr-rx-boosted-gain-default
Open

AlexandrTyshchenko wants to merge 1 commit into
meshcore-dev:devfrom
AlexandrTyshchenko:fix/lr-rx-boosted-gain-default

Conversation

@AlexandrTyshchenko

Copy link
Copy Markdown

Problem

The default for rx_boosted_gain is only set under #if defined(USE_SX1262) || defined(USE_SX1268) in the repeater, companion and room server constructors. On LR1110 / LR1121 / LR2021 boards it stays 0, and begin() then applies it with radio_driver.setRxBoostedGainMode(_prefs.rx_boosted_gain).

So on boards whose variant sets RX_BOOSTED_GAIN=true (T1000-E, ThinkNode M3/M4/M7/M9, Wio WM1110, Minew ME25LS01, Muzi Base Duo, Waveshare ESP32-S3 LR1121), target.cpp enables boosted gain and begin() turns it off again right away. A freshly flashed node reports get radio.rxgain → off. The same happens to LR2021_RX_BOOSTED_GAIN set in CustomLR2021::std_init().

Change

Two #elif branches: when the radio is not SX1262/SX1268 and the variant defines RX_BOOSTED_GAIN (or LR2021_RX_BOOSTED_GAIN), use it as the default for rx_boosted_gain.

Not changed

  • SX1262 / SX1268: unchanged.
  • Radios without either flag keep the default 0.
  • Defaults only: existing nodes keep their saved radio.rxgain (set radio.rxgain on or a fresh install picks up the new default).
  • STM32WLx boards (Wio-E5, RAK3x72, Nucleo WL55JC, Tiny Relay, LilyGo T3 STM32): their wrapper does not implement setRxBoostedGainMode(), so the radio stays as target.cpp set it; get radio.rxgain now reports on, matching that.

Testing

Built t1000e_repeater, t1000e_room_server, t1000e_companion_radio_ble, Waveshare_S3_LR1121_repeater, wio-e5-mini_repeater, ProMicro_repeater, ProMicro_companion_radio_ble. Not tested on hardware.

Open question: should LR radios without a flag default to on like SX126x? I left that unchanged.

The rx_boosted_gain default was only set for USE_SX1262/USE_SX1268, so
on LR1110/LR1121/LR2021 boards it stayed 0. begin() then applied it to
the radio, turning off the boosted gain that the variant had just
enabled in target.cpp via RX_BOOSTED_GAIN (or LR2021_RX_BOOSTED_GAIN in
CustomLR2021::std_init()).

Use those flags as the default for the other radios in the repeater,
companion and room server. SX1262/SX1268 and radios without either
flag are unchanged.

This branch has not been deployed

No deployments
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