[Feature Request]: FEM LNA AUTO should account for strong received packets saturating the radio

Open
#12,475 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
18/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
embedded-iot

Research direction

Start with RadioLibInterface::updateNoiseFloor() and LnaAutoSelector to see how noise pairs and the selector window currently feed AUTO. Then read SX126xInterface.cpp, especially the gain compensation around mp->rx_rssi -= getRxLnaGainDb(), and how setLnaControl() registers per-board LNA gain. The threshold must be sourced from the SX1262 datasheet or bench data per FEM, so a newcomer should first map where chip RSSI can be retained and counted; done means AUTO can prefer bypass when near-saturation packets are frequent, with hysteresis.

Written by the indexing model from the issue text.

Description

enhancement
Platform

ESP32 (any board with a switchable FEM LNA: Heltec V4 and KCT8103L boards; Station G3 once #12084 lands)

Description

fem_lna_mode = AUTO decides from noise only. RadioLibInterface::updateNoiseFloor() pairs a noise reading with the LNA in and one with it bypassed, and LnaAutoSelector keeps the LNA when the rise is short of its gain. Nothing looks at received packets.

  • Noise pairs are skipped while a packet is being received (isActivelyReceiving() || isIRQPending()), and the window median discards a pair a packet landed in.
  • The compression guard (MAX_PLAUSIBLE_BENEFIT_DB) only catches a strong signal present during the noise readings, such as a co-sited transmitter or broadband interference.
  • A received packet's RSSI is only gain-compensated (SX126xInterface.cpp, mp->rx_rssi -= getRxLnaGainDb()). It is never compared against the radio's input limit.

A node a few metres away arrives 12–23 dB hotter with the LNA in. That can compress the SX1262 front end or block weaker packets, and AUTO still keeps the LNA because the noise floor says it helps. This mostly affects stations sited near other nodes.

Proposal:

  • Keep the chip RSSI of each received packet, before gain compensation.
  • Count packets above a near-saturation threshold over the selector's window.
  • Prefer bypass when such packets are frequent, with hysteresis like the existing benefit thresholds.

The threshold has to come from the SX1262 datasheet or a bench measurement per FEM, not an estimate. It may need to be per-board, like the LNA gain registered through setLnaControl().

Dominant language
C++
Stars
8.4k
Forks
2.8k
Avg merge
3d 14h
Merged PRs (30d)
119

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from meshtastic/firmware

All issues in meshtastic/firmware

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.