Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
LoRaWAN: Terminate RX when receiving uplink messages #11241
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.
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