feat: Add ACK batching to reduce airtime in busy meshes #9188
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
Fixes #9187
This PR adds ACK batching to reduce airtime consumption in busy meshes. Instead of sending individual ACK packets for each received message, ACKs are queued and sent as a single combined packet.
Problem
In busy meshes, ACK traffic can consume significant airtime. Each ACK requires a separate transmission with full packet overhead, even though ACKs are small.
Solution
Queue ACKs per-destination and flush them as a single batched packet after:
DEFAULT_BATCH_WINDOW_MS)Each batched ACK uses only 5 bytes (4-byte packet ID + 1-byte error code), significantly reducing overhead compared to individual ACK packets.
Features
Build-time Enable
Add to
platformio.ini:Runtime Enable
Send a direct message to yourself with one of these commands:
!ackbatch on- Enable ACK batching!ackbatch off- Disable ACK batching!ackbatch- Show current statusThe response appears in the serial log.
Testing
heltec-v3andheltec-v4test/test_ackbatcher/)Backwards Compatibility
ROUTING_APPportnum with a magic byte prefix (0xBA) for identificationFiles Changed
src/mesh/AckBatcher.h/.cpp- Core batching logicsrc/mesh/NextHopRouter.h- Periodic flush timersrc/mesh/ReliableRouter.cpp- Batched ACK detection and processingsrc/modules/RoutingModule.cpp- Queue ACKs instead of immediate sendsrc/modules/Modules.cpp- AckBatcher initializationsrc/modules/TextMessageModule.cpp- Runtime toggle commandtest/test_ackbatcher/test_main.cpp- Unit tests