RAK3172 persistant session

Hello, I’m designing a ultra-low power device with LoRa-WAN connection and therefor I want to turn the RAK module completely off by turning off the power to the module.
Now the OTAA session data gets lost and i have to rejoin the network every time after wakeup.

Is there a possibility to save the session info in the EEPROM of the STM32 MCU or to read out all the session info and store it in the host EEPROM to feed it back to the RAK module again after powercycling?

This behavior is also recommended by the LoRa alliance to minimize network load on a power outage of many device which would then rejoin at the same time when power returns.

Thanks, Florian

Welcome to the forum @flo-ro

It is not possible to save the current OTAA session with RUI3.

An option is to save the OTAA keys and device address and start the next session in ABP mode, using the saved OTAA keys and device address.

Also @flo-ro ,

Using Beegee’s approach wont require you to have external EEPROM. You can store the session keys and device address to the flash of the RAK module.

Btw, you can potentially reach EEPROM wear-tear limits fast assuming your approach will be storing OTAA session each time you wake up. On this kind of scenario, FRAM is what you need.

Hello, thank you for the quick answer.

I will test this approach! What about the frame counters, ist there a possibility to restore them in ABP mode since they would start from zero again after power up.

@flo-ro ,

Frame counters are stored on ABP. Take note that this will write the flash each time.

Btw, this is part of the standard.

I would highly recommend that you keep on OTAA and keep the power on it and find other ways to save power. RAK3172 sleep current is already 2uA which is very low for an IoT device.

@carlrowan ,

I use a module for evaluation with RUI 4.1.0 and it seems like the frame counters are set back to zero every powercycle. This is bad because even when i keep the module in sleep mode i can not guarantee a continuous power supply.

I think I’m going to use the OTAA approach in combination with sleep mode and perform a rejoin when a power loss happens.

RUI3 4.1.0 is not yet LoRaWAN 1.0.4 compliant where ABP was mandated to have persistent frame counts. You have to use the latest RUI3 FW version - 4.2.3.

One alternative is to disable the framecounter tracking on your LNS side.