Repository navigation
Description
Problem
Per meshtastic/design#15, LoRa signal quality should be rated as SNR relative to the active modem preset's demodulation floor — a given SNR means very different things on different spreading factors (e.g. -15 dB is excellent on LongSlow/SF12 but would be unusable on ShortFast/SF7). A fixed SNR threshold mis-rates most presets.
The web client currently has two separate, uncoordinated fixed-threshold schemes, neither of which is preset-relative:
apps/web/src/core/utils/signalColor.ts—getSignalColor(snr, rssi?)uses fixedSNR_THRESHOLD = {GOOD: -7, FAIR: -15}andRSSI_THRESHOLD = {GOOD: -115, FAIR: -126}. Used by the map's SNR-colored line layer (SNRLayer.tsx).apps/web/src/components/PageComponents/Map/Popups/NodeDetail.tsxandapps/web/src/pages/Nodes/index.tsx— a separate, ad-hoc linear heuristic:clamp(round((snr + 10) * 5), 0, 100)(-10dB→0%, +10dB→100%), tiered green/yellow/red at 67%/34%. No RSSI, no preset.
Neither reads ModemPreset — the type only appears in the LoRa config form, never joined with SNR quality logic.
Reference implementation (Android/iOS)
Both mobile clients already implement the preset-relative model — this is the reference to port:
- Android —
core/ui/.../component/LoraSignalIndicator.kt'sdetermineSignalQuality(snr, modemPreset):Goodifsnr > limit,Fairifsnr > limit - 5.5,Badifsnr >= limit - 7.5, elseNone. The per-presetlimittable isChannelOption.snrLimitincore/model/.../ChannelOption.kt(e.g.LONG_FAST = -17.5,SHORT_FAST = -7.5,LONG_SLOW = -20). Android deliberately excludes RSSI from the rating (SNR alone determines demodulability without knowing the noise floor — see Meshtastic-Android#5446), though RSSI is still displayed separately. - iOS —
Meshtastic/Views/Helpers/LoRaSignalStrengthIndicator.swift+ModemPresets.snrLimit()inMeshtastic/Enums/LoraConfigEnums.swift— same preset-relative bands, but also blends in fixed RSSI thresholds (-115/-120/-126) alongside SNR.
Per-preset SNR floor table (verified matching between iOS/Android, in dB): LongFast -17.5, LongModerate -17.5, LongTurbo -12.5, LongSlow -20, MedSlow -15, MedFast -12.5, ShortSlow -10, ShortFast -7.5, ShortTurbo -7.5.
Fix
- Add a
ModemPreset → snrLimitlookup table (port the values above; the web client's protobuf schema already definesModemPresetsince it's shared across clients). - Replace both
getSignalColor()and the linear(snr+10)*5heuristic with a single preset-relative rating function, following the iOS behavior (settled — see comment below): use the receiving node's noise floor when available, fall back to preset thresholds when it isn't.- Shared tier function on the margin above the preset's demodulation floor:
margin > 0→ Good,> -5.5→ Fair,>= -7.5→ Bad, else None. - Noise-floor path (noise floor known and nonzero, RSSI present): rate two margins —
snr - presetLimitand(rssi - noiseFloor) - presetLimit— and take the more conservative of the two tiers. The noise floor comes from the node's most recent LocalStats telemetry (noise_floor, nonzero). - Fallback path (no noise floor):
rssi == 0→ SNR-only against the preset limit; otherwise the fixed-RSSI blend:rssi > -115 && snr > limit→ Good;rssi < -126 && snr < limit - 7.5→ None;rssi <= -120 || snr <= limit - 5.5→ Bad; else Fair.
- Shared tier function on the margin above the preset's demodulation floor:
- Consolidate to one signal-quality function used consistently by both the map SNR layer and the node list/detail displays, rather than the current two divergent implementations.
Reference
Cross-platform alignment tracking issue: meshtastic/design#15.
Activity
garthvh commentedon Aug 12, 2026
Settling the open question in step 2 of the fix plan: follow the iOS behavior — use noise-floor data when available, fall back to the preset values when it isn't (the body above now specifies the exact algorithm and thresholds).
Rationale, from the iOS implementation (
LoRaSignalStrengthIndicator.swift): when the receiving node reports a noise floor in its LocalStats telemetry, the real link margin (rssi − noiseFloor) is a second, more physical SNR estimate — rating both it and the reported SNR against the preset's demodulation floor and taking the more conservative tier is more accurate than trusting either alone. When no noise floor is available, SNR alone can't distinguish a genuinely weak link, so the guessed fixed RSSI thresholds (−115/−120/−126) stay in the blend as a sanity floor rather than dropping to SNR-only.RuffR1d3r commentedon Aug 26, 2026
Hi! I'd like to take this one — the
help wantedlabel and the settledalgorithm above make it a clear starting point.
Plan, following @garthvh's ruling (noise-floor dual-margin when available,
preset+RSSI blend otherwise):
ChannelOption.snrLimit(including the newer 2.8-era presets, with agraceful fallback to LONG_FAST limits for unknown preset values, as
Android does)
covering all presets and boundary margins
signalColor.tsand the linearheuristic in
NodeDetail.tsx/Nodes/index.tsx) with the sharedfunction
One scoping question I'll confirm while building: if the client doesn't
currently store
LocalStats.noise_floor, I'd ship the fallback path first(as specified) and propose the noise-floor wiring as a follow-up rather
than expanding scope unilaterally.
Will open a draft PR once the implementation and tests are up. Feedback
welcome at any stage.
fix(web): do not render missing SNR as 0 dB