Description
The behavior of the LMIC changed between 2.3.2 and 3.10.0, which requires that apps be more careful about sending messages. With the upgraded MAC code, the LMIC and the network can get involved in lengthy discussions after an uplink. However, the LMIC correctly notifies the app whenever a transmission completes. We need to:
- document the behavior clearly
- add information about how best to deal with the situation of extended network conversations
- most important, update the sample apps to follow best practices.
Original comment from @DeveloppeurPascal follows.
I found the reason of the problem : automatic MAC response throw TXCOMPLETE event, so I send next message, but the previous payload was pending... a new payload is sent during send process from the previous one, so it disappear.
We must modify the do_send() function like this :
if (LMIC.opmode & OP_TXRXPEND) {
Serial.println(F("OP_TXRXPEND, not sending"));
} else if (LMIC.opmode & OP_TXDATA) {
Serial.println(F("OP_TXDATA, not sending"));
} else {
LMIC_setTxData2(1, LoRaWanMsgToSend, LoRaWanSizeOfMsgToSend, 0);
// Next TX is scheduled after TX_COMPLETE event.
}
Please add the OP_TXDATA test in your samples to prevent the problems I add.
Originally posted by @DeveloppeurPascal in #545 (comment)