Storing the data is noting special, I have defined the locations because they will never change
#define memLoc_devEui 0
#define memLoc_appEui 8
#define memLoc_appKey 16
Saving the settings…
void saveSettings(){
Serial.println("saving config");
EEPROM.begin(512);
int memLoc = 0;
EEPROM.put(memLoc_devEui, devEui);
EEPROM.put(memLoc_appEui, appEui);
EEPROM.put(memLoc_appKey, appKey);
EEPROM.end();
Serial.println("config saved");
}
loading the settings
void loadSettings(){
Serial.println("get config");
EEPROM.begin(512);
EEPROM.get(memLoc_devEui, devEui);
EEPROM.get(memLoc_appEui, appEui);
EEPROM.get(memLoc_appKey, appKey);
EEPROM.end();
Serial.println("config set");
}
I think i just found a solution, when i push the new settings to the device doing an
LoRaWAN.init(loraWanClass,loraWanRegion);
instead of doing a restart seems to work.
And the change is instant allthough the settings dont seem to revert back to the older ones on reboot.