Repository navigation
Send last-hop TRACE forwards once through the normal TX gate - #26
Kernel-Error wants to merge 1 commit into
Conversation
The last hop before a TRACE destination pre-set sending_attempts to the resend maximum so that no retry is queued. Side effect: the first send was treated as a resend, i.e. it waited on the resend LBT gate and was counted in n_resent_direct. Use a runtime no_retry flag instead; the packet now goes out like any other first send and is never resent.
|
@Kernel-Error #25: Confirmed. The TRACE branch at the top of Mesh::onRecvPacket() always returns, so the generic resend-cancel block further down is never reached for TRACE, and every mid-path forward of a TRACE is re-sent up to max.resend times. Your fix reuses isRetryMatch(), skips the terminal leg and still processes the received packet normally. Looks correct to me. Both apply cleanly together on top of my meshcore-dev#2670 port and build for Heltec V3 (repeater, room server, companion BLE) and RAK4631 (repeater). One organisational note: mups18 is regenerated by my build script and force-pushed on every release, so a merge into mups18 would be lost on the next rebuild. I’ll cherry-pick both commits (your authorship is kept) into the branch that carries the meshcore-dev#2670 port and close the PRs with a reference to the commits. They will be in the next mups release. Both issues come from upstream PR meshcore-dev#2670 itself (the code is the same there), so I’ll report them there as well and point to your commits. About the noise floor sitting at −120 dBm on the Heltec: my port deliberately leaves out the noise-floor median estimator of meshcore-dev#2670 (it conflicts with RX power saving), so this may be specific to my firmware. If you can reproduce it, please open a separate issue with the board, firmware version and how you observed it. |
|
Cherry-picked into mu/pr-2670-ps18 as 360cc09 (authorship kept). It will be part of the next mups release. Thanks! |
…ast-hop TRACE Two TRACE issues in the resend logic, found by Sebastian van de Meer (Kernel-Error) and reviewed/measured by m0urs on a live repeater (m0urs#25, m0urs#26): 1. Queued resends of TRACE forwards were never cancelled: the TRACE branch in Mesh::onRecvPacket() always returns, so the generic echo-cancel block further down was never reached for TRACE. Each intermediate hop re-sent every TRACE up to max_resend_attempts times even though the next hop had already forwarded it (~40 redundant transmissions per 30 min on a busy repeater). The TRACE branch now scans the outbound queue for a matching queued TRACE resend (isRetryMatch) and removes it, for well-formed non-terminal legs, before normal TRACE processing. 2. The last-hop TRACE forward pre-set sending_attempts = max to suppress retries, which made the first (and only) send look like a resend: it went through the resend LBT gate instead of the normal channel check and was counted in the resend statistics. Replaced by a runtime-only no_retry flag on Packet (reset in the ctor and in the pool free()), checked first in resendPacket(). The packet is sent once like any other first send and never resent. Co-Authored-By: Claude Code <noreply@anthropic.com>
For the last hop before a TRACE destination the code sets
pkt->sending_attempts = getMaxResendAttempts()so no retry getsqueued. Side effect: the very first send already looks like a resend. It goes through isResendChannelActive() (IRQ or RSSI >=
noise floor + 12 dB) instead of the normal gate (which may use CAD, so the behaviour differs both ways), and it is counted in
n_resent_direct, so
get max.resendoverstates resends. The comment in Dispatcher.h calls the counting "by design" but the gatechange isnt mentioned anywhere.
This replaces the pre-set counter with a runtime only
no_retryflag (Packet, reset in the pool free(), checked first inDispatcher::resendPacket). The packet is sent once like any other first send and never resent.
Measured (same setup, 8 randomized 30 min blocks): 56-67 flagged packets per block, counted resends ~60 vs ~130 per block,
resend gate busy results about halved. No measurable delivery change (67.2 vs 65.7 %, p=0.74). On my Heltec the noise floor
estimate sometimes sits at -120 dBm and then the resend gate reports busy almost always, so the old path delayed these
forwards by up to 4 s, thats how I found it.
Built for heltec_v4_repeater on mups18 1194b08. Developed with AI assistance, reviewed and tested by me on the live repeater.