cancel
Showing results for 
Search instead for 
Did you mean: 

LoRaWAN Session keys store is already working on V2.1.0 ?

DPrie.1
Associate II

Hello everybody,

I'm using the AT code modified in order to join my own server with an OTAA configuration in a solar application, so every morning the system goes up, and late afternoon the system shuts down.

I want to store session keys, counters and all stuff necesary for not rejoining server each time a power down/up is done.

CONTEXT_MANAGEMENT_ENABLED is defined to 1, and I needed to add some libraries related to nvm (NvmDataMgmt.c/.h and nvmm.c/.h).

When firmware enters in LmHandlerConfigure(), I receive a "Restored", showing that we are here:

    // Restore data if required
    nbNvmData = NvmDataMgmtRestore( );
 
    // Try to restore from NVM and query the mac if possible.
    if( nbNvmData > 0 )
    {
    	MW_LOG(TS_OFF, VLEVEL_M, "###### RESTORED\r\n");
        CtxRestoreDone = true;
    }
    else
    {
    	MW_LOG(TS_OFF, VLEVEL_M, "###### NOT RESTORED\r\n");
        CtxRestoreDone = false;
    }

However, I try to send a message without doing a AT_JOIN and always returns AT_BUSY.

Need to send some special AT command before start sending messages? Or maybe the keys are not restored correctly?

Thank you very much!

Regards,

0 REPLIES 0