[solved] Transmit Failure after days using LMIC library and Arduino IDE

Good morning,

I am currently stuck with troubleshooting the transmission failure of my sensor node. It can work for several days fine until it reports a failure detected by the LMIC library and stops transmitting. I am using Arduino IDE, ATMEGA328P and an external interrupt to wake up my sensor node after a certain time interval.

For troubleshooting, I have logged the events using an SD card and noticed following error msg:

Measurement done
23:40:18
Sending uplink packet...
FAILURE 

The failure arises from the LMIC library and most likely this part:

// start transmitter (buf=LMIC.frame, len=LMIC.dataLen)
static void starttx () {
ASSERT( (readReg(RegOpMode) & OPMODE_MASK) == OPMODE_SLEEP );
if(getSf(LMIC.rps) == FSK) { // FSK modem
txfsk();
} else { // LoRa modem
txlora();
}
// the radio will go back to STANDBY mode as soon as the TX is finished
// the corresponding IRQ will inform us about completion.
}

The assert function checks the statement and reports an error. How do you think shall I troubleshoot this problem?

I have thought about:

  1. editing the library to report no failures
  2. changing the code flow to allow
  3. best solution imo: add an if statement in the Arduino code to force sleep or restart the loop after detecting a failure.

Thank you!

I choose option 1 :upside_down_face:

  • update
    ’ add an if statement in the Arduino code to force sleep after detecting a failure.

option 3 is also promising … but I have to test this first, when the results are in I’ll get back to you.

Which LMIC library are you using?

I’ve got devices tested on 50,000 plus transmits with no issues on ATMEGA328P - there must be an reason your getting issues

Are you using ADR and linkcheck?
I’m alos having issues currently, my device stops sending after a couple of hour for no aparent reason, and if i disable linkcheck it works ok…
I’m trying to troubleshoot but without any success untill now.

Can you share with us your settings? Are you using ADR?

Hi Guys, thank you for all your helpful comments. I’ve used the LMIC library by IBM. To my knowledge, there is even a more recent one for Arduino IDE.

The problem was solved codewise by just forcing the MCU to sleep after a transmit failure has been reported.

1 Like

good to see you’ve solved it :sunglasses: