Skip to content

fix(mesh): poll TX_DONE and stuck-TX timeout from main loop - #10436

Closed
DatanoiseTV wants to merge 2 commits into
meshtastic:developfrom
DatanoiseTV:fix/radio-stuck-tx-poll
Closed

fix(mesh): poll TX_DONE and stuck-TX timeout from main loop#10436
DatanoiseTV wants to merge 2 commits into
meshtastic:developfrom
DatanoiseTV:fix/radio-stuck-tx-poll

Conversation

@DatanoiseTV

Copy link
Copy Markdown
Contributor

The 60s stuck-TX detector in canSendImmediately only fires when more
packets enter the TX queue, because that's the only path that calls it.
If the queue empties after the radio wedges, no IRQ ever fires, no
poll runs, and the device sits in busyTx forever. pollMissedIrqs is
already invoked unconditionally from the main loop — extend it to
poll TX_DONE when sendingPacket is set, and trip the same reboot
path independently of queue activity.

Split out from #10424 per @thebentern's request — single-concern PR.

Build verification

pio run -e t-deck-tft succeeds, no new warnings.

Attestations

  • I have tested that my proposed changes behave as described — review/static-analysis only, not on-air.
  • On-hardware testing requested from community: build-verified t-deck-tft only.

The 60s stuck-TX detector in canSendImmediately only fires when more
packets enter the TX queue, because that's the only path that calls it.
If the queue empties after the radio wedges, no IRQ ever fires, no
poll runs, and the device sits in busyTx forever. pollMissedIrqs is
already invoked unconditionally from the main loop — extend it to
poll TX_DONE when sendingPacket is set, and trip the same reboot
path independently of queue activity.
@github-actions github-actions Bot added needs-review Needs human review bugfix Pull request that fixes bugs labels May 9, 2026
@thebentern
thebentern requested review from GUVWAF and Copilot May 9, 2026 17:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a reliability gap in the RadioLib-based radio driver where the existing “stuck TX” watchdog only ran when new packets entered the TX queue. If the radio wedges after the queue drains and no TX IRQ fires, the node could remain in busyTx indefinitely. The change extends the already-main-loop-driven pollMissedIrqs() fallback to also poll for TX_DONE and to trigger the same stuck-TX reboot path even when the TX queue is empty.

Changes:

  • Add a TX_DONE polling fallback (checkTxDoneIrqFlag) alongside the existing RX_DONE missed-IRQ polling.
  • Extend pollMissedIrqs() to (a) poll TX_DONE while sendingPacket is set and (b) enforce the existing 60s stuck-TX reboot guard independent of TX queue activity.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/mesh/RadioLibInterface.h Declares checkTxDoneIrqFlag() for missed TX_DONE polling support.
src/mesh/RadioLibInterface.cpp Implements TX_DONE polling in pollMissedIrqs() and adds a queue-independent stuck-TX timeout/reboot trigger.

@github-actions github-actions Bot added the Stale Issues that will be closed if not triaged. label Jun 24, 2026
@github-actions github-actions Bot closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs needs-review Needs human review Stale Issues that will be closed if not triaged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants