cancel
Showing results for 
Search instead for 
Did you mean: 

How to save LoRa key context into the flash so that it don't have to send the join request every time it wakes up or restart?

MAwan.1
Associate

Hi! 

I'm working on STM32WLE5JC micro-controller. Is there any way to write the firmware in such a way that I don't have to send the join request every time the controller wakes up or restarts?

I mean when I first time join the network, what are the specific parameters that I get in return and by saving them into the flash, retrieving them after a restart and get connected to network without sending the join request.

Any help if you can, I shall be very grateful.

Thank you.

Regards.0693W00000Uo58AQAR.png

2 REPLIES 2
Louis AUDOLY
ST Employee

Hello @MAwan.1​ welcome to the community,

Yes this is possible to restart your board and to not have to send a JoinRequest. To do so, you have to store your context just before shutting down your device.

This include session keys, params received with the JoinAccept frame, and params that are modified in run time like the frame counter that is used to avoid reply attacks from another device.

0693W00000UoPx8QAF.png(table from the link layer specification 1.0.4)

Then at the next startup, restore your context and with all needed informations you could comunicate without issue.

Best regards

Louis

MAwan.1
Associate

Thank you so much for your valuable response.

Okay. So, now I know that which parameters are required to store and retrieve such that we don't have to send a join request every next time. My query is how can I implement this thing in STM32Cube IDE? I am using the "LoRaWAN_End_Node" example and STM32WLE5JC micro-controller. There are some built-in functions that I think are to implement the subject but the example maybe not using those functions and that's why I am unable to send an uplink without a join request.

Here are some snaps of the those functions:

0693W00000UoWi5QAF.png0693W00000UoWiKQAV.png0693W00000UoWieQAF.png0693W00000UoWijQAF.pngIt would be great if you can highlight the particular thing in "LoRaWAN_End_Node" example so that I can make changes accordingly. I am new to STM32 and LoRa, your brief reply would be of great help.

Waiting for your kind response.

Regards,

Muhammad Bilal Awan