LoRaWAN: Terminate RX when receiving uplink messages #11241
Merged
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.
This prevents RX2 window to be enabled at the same time when repeating transmission, when QoS repeated TX is in effect. Failure to do so seems to place the LoRaWAN stack in a state where send() always fails with WOULD_BLOCK error.
Description
During testing of a LoRa device, the LoRaWAN stack rarely ended up in state where all transmissions would fail (LoRaWANInterface::send() would always return LORAWAN_STATUS_WOULD_BLOCK). After further investigation, this can happen with the following circumstances:
The log looks similar to this (note that I've added some extra logging for window timing):
A more appropriate fix would be to delay QOS retransmission until RX2 window closes, but it seems to me that more extensive code changes would be needed for that. At least this should prevent the stack from ending up in an unusable state.
Pull request type
Reviewers
Release Notes