Log packet length, RSSI and SNR when readData() fails - #15
Open
mmmorks wants to merge 1 commit into
Open
Conversation
recvRaw()'s readData() error line prints only the error code, which says nothing about the cause: a packet at the edge of the demodulator and one lost to a collision both produce -7 (CRC mismatch). Both existing packet loggers sit inside the success branch, so a failed receive is invisible to `log start` and MESH_PACKET_LOGGING alike. The modem's packet-status registers are written whether or not the CRC passed, so reading them here costs no extra SPI traffic and reports the same values a successful receive would. SNR is scaled by 4 rather than truncated, because the threshold this is meant to resolve is a fraction of a dB wide and %f is not portable across every platform this file builds for -- the same quarter-dB convention as Packet::_snr. Measured on a live repeater at SF7/62.5 kHz (490 failures against 961 successes over 25 min), the failure rate resolves into a clean waterfall against SNR, with 20% of failures at positive SNR where marginality cannot be the explanation. Debug output only: the line is inside MESH_DEBUG_PRINTLN and costs nothing on a build without MESH_DEBUG.
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.
Summary
recvRaw()'sreadData()error line prints only the error code, which says nothing about the cause: a packet at the edge of the demodulator and one lost to a collision both produce-7(CRC mismatch). Both existing packet loggers sit inside the success branch, so a failed receive is invisible tolog startandMESH_PACKET_LOGGINGalike.The modem's packet-status registers are written whether or not the CRC passed, so reading them here costs no extra SPI traffic and reports the same values a successful receive would. SNR is scaled by 4 rather than truncated, because the threshold this is meant to resolve is a fraction of a dB wide and
%fis not portable across every platform this file builds for — the same quarter-dB convention asPacket::_snr.Why it is worth having
Measured on a live repeater at SF7/62.5 kHz — 490 failures against 961 successes over 25 minutes — the failure rate resolves into a clean waterfall against SNR, with 20% of failures at positive SNR where marginality cannot be the explanation. That distinction is not available from the error code alone.
This is debug output: the line is inside
MESH_DEBUG_PRINTLNand costs nothing on a build withoutMESH_DEBUG.How it was tested
pio test -e native: all suites pass.meshnology_w12_repeater(ESP32-S3).Dependencies
Independent. Applies to
dev.