Hello
I am using the library LMIC and I obrserved some time, the node can not send any more the data to TTN V3.
My node turn on a led while it is sending and the led turn off when the onEvent return
EV_COMPLETE
Some time, the led never turn off. It meens, the node is always trying the send, or waititng for a confirmation from TTN V3.
I inverstigated more, and I observed that this event occured because the onEvent return EV_LINK_DEAD after EV_COMPLETE
I also understand (with my words) the node lost connection or a new connection need to be etablished.
A recently exemple, my gateway had no credit on the GSM card. The gateway could not be seen at TTN V3 console. I charged my GSM card and the gateway was viewed at TTN V3 console. But all my nodes had the led on.
To solve that issue, I need to restart all my nodes and a join were done. My nodes work again
1494183: EV_JOINING
1523697: Unknown event
1916929: Unknown event
5909971: Unknown event
6231310: EV_JOINED
One of a solution I see, is to restart the nodes with the watchdog library.
I would add the bellow code after the line 179
wtime = Watchdog.enable(4000);
Serial.print(F("Restarting in "),2);
Serial.print(wtime,2);
Serial.println(F("ms"),2);
Watchdog.reset();
while(1);
But I wonder if I can do a rejoin , if onEvent return EV_LINK_DEAD. If yes how?
Would LMIC_reset() help if I call that function after the line 179?
Or should I call
os_init()
LMIC_reset()
Or is a function which does a rejoin, … or would it better to software restart?
Thanks