OTAA Join status showing NOT_JOINED after i power cycle RN2483 after using mac save command


(Interravikram) #1

Hi everyone
I am using RN2483 with a frimware version of 1.0.4.

Expected Flow
Init Lora
Send Data
Turn RN2483 Off.

Turn RN2483 on
Send Data
RN2483 off
Turn RN2483 on
Send Data
RN2483 off

But if i don’t reinitialize the LORA module after turning it ON , The response from LoRa device is not_joined.
However if i initialize the LoRa module , It works fine.
Because of reintialization , the downlink message gets enqueued everytime a uplink message is received , resulting into multiple downlink messages.
And also i see retry before the message which is not normal
Lora


(Jac Kersing) #2

The reinitialize cause the node to rejoin which causes a join response. (Your node can not join endlessly, joins use a random nonce which needs to be unique, after a few hundred joins you will start to see collisions resulting in failing joins)
The downlink seems to be generated by your application.

In your flow I do not see any save commands. You would need to save after every transmission, however this will cause significant wear on the eeprom device.

How much power is your node using? The RN2483 uses microamps when put to sleep, is that significant usage compared to the other components?


(Interravikram) #3

After joining once , i use mac save command.
Flow is like the below

Init RN2483
Join OTAA
mac save
Turn OFF RN2483(By cutting the power supply)

TURN ON RN2483
Send Data (This command returns not_joined)
Turn OFF LoRa RN2483


(Arjan) #4

I’m quite sure that after powering up you need to run mac join abp, to use the OTAA Join Accept settings that were saved by mac save? That’s at least how I’ve been doing it.

Still then, you’ll run into frame counter problems if you do not also issue mac save after each and every uplink. See @kersing’s thoughts on EEPROM wear above!

And probably not relevant for 1.0.4, but:


(Interravikram) #5

I tried using dummy values for ABP and then calling abp join , but , nope it doesn’t work for me


(Arjan) #6

What exactly did you try? Forget the dummy values for now. (That’s only after a factory reset, and before doing the OTAA join. Setting them after you did the OTAA join will of course replace the secrets that were received in the OTAA Join Accept.)

So: first just try mac join abp after powering up the device, when before powering down it joined using mac join otaa.


(Interravikram) #7

Here are the commands that i am using for OTAA join and to send data

Turn ON LoRa Module

sys reset
mac reset 868
sys set pindig GPIO0 1
sys get hweui
mac set deveui
mac set appkey
mac set adr on
mac set ar off
mac set pwridx 1
mac set dr 5
mac set rx2 3 869525000
sys set pindig GPIO0 0
mac join otaa
mac save

Turn OFF RN2483

TURN ON RN2483
mac tx uncnf 1 hello_world(This returns not_joined if i don’t re-join using mac join otaa,works fine if i reinit or rejoin )
Turn OFF RN2483


(Arjan) #8

So, please try:


mac join otaa
mac save

Turn OFF RN2483

TURN ON RN2483
mac join abp
mac tx uncnf 1 010203
Turn OFF RN2483

Unrelated, but above I’ve also replaced the text “hello world” with the 3 bytes 010203. Don’t send text.

Also, when using OTAA, you should not use:

mac set rx2 3 869525000


(Interravikram) #9

nope , no help , It says Keys_not_init and then i can’t also see any message on my application on TTN


(Interravikram) #10

The frames up on TTN is always zero , though there are messages on the application with reinit and send configuration


(Arjan) #11

I don’t see any mac set appeui? Then your mac join otaa should not show any success in TTN Console either? Please try to send something right after mac join otaa:


mac set deveui …
mac set appeui …
mac set appkey …

mac join otaa
mac save
mac tx uncnf 1 010203
mac save

If the above works, but mac join abp still gives you:

then you might also need the workaround with the dummy values, before the OTAA join:


mac set deveui …
mac set appeui …
mac set appkey …
mac set devaddr 00000000
mac set nwkskey 00000000000000000000000000000000
mac set appskey 00000000000000000000000000000000

mac join otaa
mac save

If things then still don’t work, then please show your full list of commands again.