Conversation
RadioErrorHandler reported every WARNING from a radio-layer logger as a fault. LoRa reception noise arrives at WARNING, so a weak or distant transmitter flipped the header badge to "Radio Error" and flooded the console. The failing packets in the report arrive at RSSI -113 dBm and SNR -7 dB with DeviceErrors=0x0000, so the radio itself is healthy. - Classify CRC errors, header errors, and empty packets as reception noise. Only real errors reach the badge and the toasts. - Count the noise per category and write one summary line per minute. - Drop the noise from the console handler. The log file keeps every record for bug reports, and DEBUG level shows the noise again. - Report the counts in a read-only "RX Noise" row in Settings > Logging. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74da943eaf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex review on #93: a noise burst shorter than the summary window and then silence never reached the log, because only the next event ran the elapsed-time check. Window boundaries also depended on packet arrival instead of the configured interval. The first event now opens a window and arms a timer. The timer closes the window and writes the summary on schedule, whether or not more noise arrives. RadioErrorHandler.close() flushes the open window, so a log bundle carries the final tally. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Fixes #91.
Diagnosis
The CRC and header errors are real RF events, not a bug. In the log attached to the issue, the failing packets arrive at RSSI −113 dBm, SNR −7 dB, and the SX1262 reports
DeviceErrors=0x0000. The corrupt frame at16:02:25.326is the same RESPONSE relayed one more hop, received with a corrupt routing prefix. Decoding the clean copy perPacket.read_from()givespath_len=0x8a(3-byte hashes, 10 hops, 30 path bytes), so its payload starts at offset 32 with length 20 — matching the payload length the dispatcher logged. One further 3-byte hop predicts a 55-byte frame whose payload starts at offset 35, and that is exactly the length the SX1262 reported and exactly where the payload bytes sit. The 20-byte payload is byte-identical to the clean copy. But the frame arrived withheader=0x0candpath_len=0x11, which would place the payload at offset 23 with length 32 — inconsistent with its own contents. Four bytes are corrupt (the header,path_len, and two path bytes); the payload came through clean.IRQ=0x0042isRX_DONE | CRC_ERRwith noHEADER_ERRbit, so the LoRa physical header decoded and the payload CRC then failed. The radio is healthy.The defect is ours:
RadioErrorHandlertreated everyWARNINGfrom a radio-layer logger as a fault. pyMC_core logs reception noise atWARNING, so normal traffic flipped the header badge to "Radio Error" and flooded the console.Changes
meshcore/logging_setup.pyclassify_rf_noise()separates reception noise (CRC error, header error or corrupted header, empty packet) from real radio errors.RadioErrorHandlercounts the noise instead of reporting it. Only real errors reach the badge and the toasts.RfNoiseCounterkeeps per-category totals and writes one summary line per minute, so the rate stays visible without spam.RfNoiseFilteron the stderr handler drops the noise from the console. The rotating file handler still records every line for bug reports, and atDEBUGconsole level the filter steps aside.ui_gtk/views/settings.pyTests
10 new tests in
tests/unit/test_logging_setup.py. Full suite: 129 passed, 1 skipped.ruff check,ruff format --check, andmypyare clean on the touched files.Review notes
Xvfb. The RX Noise row needs a run on the Pi or in mock mode before merge.RX timeout detectedstays classified as a real error. It does not appear in the report, so silencing it would be a guess.NoiseFloor=-113.8dBmat 62.5 kHz bandwidth is roughly 8-10 dB above a quiet band. That is typical for SPI and display noise inside a uConsole, and it explains why weak packets fail CRC. It is an antenna and shielding matter, not software.🤖 Generated with Claude Code