Skip to content

Rssi and noise floor improvements#2842

Open
yg-ht wants to merge 13 commits into
meshcore-dev:mainfrom
yg-ht:rssi_and_noise_floor_improvements
Open

Rssi and noise floor improvements#2842
yg-ht wants to merge 13 commits into
meshcore-dev:mainfrom
yg-ht:rssi_and_noise_floor_improvements

Conversation

@yg-ht

@yg-ht yg-ht commented Jun 25, 2026

Copy link
Copy Markdown

This PR improves RSSI and noise-floor instrumentation. This should then re-enable the use of the interference threshold configuration, but I think this PR needs wider testing before that is done. So at the moment, it doesn't change the int.thresh / _prefs.interference_threshold from 0.

It enables stats-radio over Mesh as I have been diagnosing the RSSI behaviour from a number of sites concurrently. This might not be desirable, for example owing to concerns over bandwidth usage, but I am not sure I see any real harm in this. This particular stats call now has last_rssi and last_snr come from cached last-packet metrics rather than later instantaneous RSSI sampling. It also exposes stats-noise over the Mesh which goes into more detail about the noise floor sampling results. This reports the current approved noise floor, along with details about the current sampling for the next noise floor calibration. Details include: accepted sample count, sample min/median/max values, and rejected sample counts as the sample was erroneously low/high.

Noise floor calibration is performed after a small number of event triggers, as well as on a periodic basis. The rough execution flow is:

flowchart TD
    A[Periodic trigger<br/>or scheduled refresh] -- Start batch --> B0{batch loop}
    B0 -- Start sample --> B1{Batch maximum window size elapsed?}
    B1 -- No --> C{Radio idle in RX mode?}
    B1 -- Yes --> A

    C -- No --> B0
    C -- Yes --> D{Sample rate limit interval elapsed?}

    D -- No --> B0
    D -- Yes --> E[Read RSSI sample]

    E --> F{Sample acceptable?}
    F -- No --> G[Reject sample<br/>Update reject counters]
    G --> B0

    F -- Yes --> H[Accept sample<br/>Update min/median/max]
    H --> I{64 accepted samples?}

    I -- No --> B0
    I -- Yes --> J{Completed batch sane?}

    J -- No --> A
    J -- Yes --> K[Publish new noise floor]
    K --> A
Loading

So that people can tweak and understand the noise floor sampling process, there are now a few additional configuration options: sampling interval, calibration window, and clamp settings:

  • noise.sample.ms - in a calibration batch, how long do we sleep between samples (default: 50ms)
  • noise.window.secs - maximum time of a calibration batch (default: 60s)
  • noise.clamp.low - the "ludicrous" low RSSI value that can't be true (default: -125dBm)
  • noise.clamp.high - the "ludicrous" high RSSI value that can't be true (default: -80dBm)

I have been testing this on a few different repeaters in different locations and using different boards. I haven't seen any anomalous behaviour anywhere and wherever possible I have checked the noisefloor with a calibrated VNA. The values that are being generated by the VNA agree with those established by this codebase.

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