RAK811 accessing keys after successful OTAA join

(Seyedkaveh Mazloomi) #1

Hi
How can I get the join data after a successful OTAA join?

More details:

I clear device address, network session key and app session key via the following command:

at+set_config=dev_addr:00000000&nwks_key:00000000000000000000000000000000&apps_key:00000000000000000000000000000000

I do an at+join=otaa and get the 3,0,0 response and I’m able to send data through to TTN.

However, I get an ERROR-2 reply to all following commands:

at+get_config=dev_addr

at+get_config=nwks_key

at+get_config=apps_key

w=Which means information is not available, again, I’m able to send data to TTN in this situation (since the OTAA join was successful). I assume this means the keys and device address are not going to be stored in the flash.

I understand the at+get_config commands call the data from module flash. However, I want to get the actual address and keys that was sent down to the module via OTAA join.

(Vladislav Yordanov) #2

Hi @kavehoo,

The situaion is the followng I believe.
Those comands you are using are only possible to execute in the configuration window, before the actual OTAA join procedure. Since you have not keys yet (the OTAA procedure is what gets them), they are meaningless, and later they don’t work. This is just for your informatiom.
The solution is to run the following (should work at any time during normal operation after the OTAA procedure has finished)
at+abp_info

It will return the following in this order separated by a “,”:
NetworkID 4Byte
Network address 4Byte
Network session key 16Byte
Application session key 16Byte

You should get something similar to this:
OK0,1731fae,eeee383e27e65d3f08fde597ab170675,2bf596124d3a1731435c5fb8e7ee5823

NetworkID 0
Network address 1234fae
Network session key eeee383e27e65d3f08fde597ab170675
Application session key 1bf234567d8a9012345c6fb7e8ee9012

Please let me know if this help.

Regards

Vladislav

(Seyedkaveh Mazloomi) #3

Hi @Hobo,
Thank you very much for your reply. I’m pretty sure this is what I’m after. I appreciate your help. I’ll test this and post an update.

Kaveh