Commit a3e808ca authored by Eric Duminil's avatar Eric Duminil
Browse files

Note

parent cc3629e4
Pipeline #5903 passed with stage
in 2 minutes and 15 seconds
......@@ -104,13 +104,21 @@ namespace lorawan {
u1_t nwkKey[16];
u1_t artKey[16];
LMIC_getSessionKeys(&netid, &devaddr, nwkKey, artKey);
/**
* NOTE: This is experimental. Saving session to EEPROM seems like a good idea at first,
* to avoid joining every time the Ampel is started.
* But many other infos are needed too (e.g. a counter), and it wouldn't be wise
* to save the whole configuration every time data is sent via EEPROM.
*
* config::lora_session_saved can be set to false, and the Ampel will try to join again next time.
*/
config::lora_session_saved = true;
config::lora_netid = netid;
config::lora_devaddr = devaddr;
memcpy(config::lorawan_nwk_key, nwkKey, 16);
memcpy(config::lorawan_art_key, artKey, 16);
config::save();
//NOTE: Saving session to EEPROM seems like a good idea at first, but unfortunately: too much info is needed, and a counter would need to be save every single time data is sent.
Serial.print(F(" netid: "));
Serial.println(netid, DEC);
Serial.print(F(" devaddr: "));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment