Issues with LoRaWAN.joinOTAA(appEui, appKey, devEui); using LoRaWanMinimal

LoRaWAN.joinOTAA(appEui, appKey, devEui)

from the LoRaWanMinimal library does not seem to time out when running on cubecell or if it does its a very random, my understanding is if a gateway isnt present it should sleep for a specific amount of time in Send and Recieve Example. instead it never times out and constantly tries to connect draining battery life.

Example of current output without a gateway:

Does anyone have a work around for this?

Hi,
If there is no gateway, the node will repeatedly access the network 48 times, and then sleep for 30 seconds. Repeat the above process again.

The sleep cycle is relative, the issue is it never leave the join function because it doesn’t stop joining I’ve had one running for 4 days now with no luck!

Work around? it is simply stuck in the join loop as it fails to join and repeats, looking at the code something is wrong around the did it join/fail condition.

None of this code is running, when at least one options has to be true.

if (!LoRaWAN.isJoined()) {
//In this example we just loop until we’re joined, but you could
//also go and start doing other things and try again later
Serial.println(“JOIN FAILED! Sleeping for 30 seconds”);
lowPowerSleep(30000);
} else {
Serial.println(“JOINED”);
break;

Try >>> if (LoRaWAN.isJoined() == false) {

Looking at your log neither of the if joined condition options are getting run, when one of them should always be true - its a true/false status so something it wrong when it checks LoRaWAN.isJoined() in the code.

Looking at this more, I am not sure the ‘joined’ flag is getting set true or false hence the fast looping and both conditions fail.

Follow up, I was going to test the code but heltec have not updated PlatformIO libraries so we are so far behind on code versions - sadly I cant test anything here.

the joined flag never gets set because it is stuck on a constant while loop. what i need to know is why does the LORAMAC only intermittently get set to IDLE. the join flag has nothing to do with the issue.

This code is contributed by enthusiastic netizens, we have no systematic maintenance for it. But we will help you find the problem as soon as possible.

Hello, I would like to bring this issue back to life.

We’ve had this happen to us, 300 of lost over a year of battery life because of this joining issue. Wondering if there is a “suggested way” to implement sleeping between joins to prevent this from happening in the future.

Also using CubeCellModule Plus w PlatformIO