Rssi and noise floor improvements#2842
Open
yg-ht wants to merge 13 commits into
Open
Conversation
# Conflicts: # examples/simple_repeater/MyMesh.cpp # examples/simple_room_server/MyMesh.cpp # examples/simple_sensor/SensorMesh.cpp # src/Dispatcher.h
This was referenced Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_thresholdfrom 0.It enables
stats-radioover 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 exposesstats-noiseover 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 --> ASo 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.