cancel
Showing results for 
Search instead for 
Did you mean: 

What is the proper way to do OTAA re-join after a successful JOIN?

roland van straten
Associate III

I have an application with LoRa using the L072-LORAWAN DISCOVERY board with the latest I-CUBE-LoRaWAN 1.2.2. software. I use the AT-Slave software and all I want is the proper way to join and rejoin the network.

So this is what I do in the following order:

1) Reset modem (ATZ)

2) Set the OTAA join mode (+NJM=1)

3) Set a private network to use (using multitech Conduit AEP) (+PNM=0)

4) Set the proper JOINEUI

5) Set the proper APPKEY

6) Set the proper APPEUI

7) Check if we already joined the network before from a flag in NVRAM

7.1) If we did, reload the DEVADDR and NWKID into the modem with +DADDR= and +NWKID=

7.2) Skip the join (+JOIN) as we were already joined before

8) In case we have not joined before or were unsuccessful for a number of tries 

8.1) JOIN the network (+JOIN)

8.2) Loop NetworkJoinStatus to wait for a connection (+NJS=?)

8.3)  If not JOINED retry this every 30 seconds

8.4) After trying 5 times, reboot as no connection can be made

9) After a successful join

9.1) Read the DEV_ADDR given by the network

9.2) Read the NetworkID given by the network

10) Store in NVRAM

10.1) Flag indicating a successful join

10.2) DEVADDR (derived from network after join)

10.3) NWKID (derived from network after join)

10.4) JOINEUI/APPKEY/APPEUI (already)

11) Send a message with +SEND

12) Now we reset the system

13) Go back to step 1

Remarks:

A) it seems that after using AT+JOIN once, calling it again has no effect. I wonder if it is working or get stuck?

B) Joining every time seems to work, but this doesn't seem to be it should be used.

C) changing to ABP needs different keys to set at both sides. OTAA is preferred.

D) It works only once when the NVRAM flag indicates there was no JOIN before (first time JOIN).

So what IS the proper way, I have not seen it in any of the samples that are available.

1 REPLY 1
roland van straten
Associate III

Update:

Using a certain interval I have added switching on "+CFM=1" to get a confirmation of the transmission

So now I send a message with "+SEND=1,'hello'" and check if I get a confirmation on the last message with "+CFS=?"

In case it the response is "0", the confirmation isn't there and I ASSUME that I have to rejoin the network. If I get a "1" as response I ASSUME that everything is still in working order and disable the confirmation mode again with "+CFM=0".

But still no expert advise on how to handle the above...