Skip to content

Commit

Permalink
Moved node.beginOTAA() before recalling LoRaWAN nonces & session (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed Jun 5, 2024
1 parent ccdaf4f commit f4543b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions BresserWeatherSensorLW.ino
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,9 @@ void setup()
state = radio.begin();
debug(state != RADIOLIB_ERR_NONE, "Initalise radio failed", state, true);

// Setup the OTAA session information
node.beginOTAA(joinEUI, devEUI, nwkKey, appKey);

log_d("Recalling LoRaWAN nonces & session");
// ##### setup the flash storage
store.begin("radiolib");
Expand All @@ -802,9 +805,6 @@ void setup()
// LWsession var. At this point, bootCount has already been incremented, hence the > 2
debug((state != RADIOLIB_ERR_NONE) && (bootCount > 2), "Restoring session buffer failed", state, false);

// Setup the OTAA session information
node.beginOTAA(joinEUI, devEUI, nwkKey, appKey);

// loop until successful join
while ((state != RADIOLIB_LORAWAN_NEW_SESSION) && (state != RADIOLIB_LORAWAN_SESSION_RESTORED))
{
Expand Down

0 comments on commit f4543b7

Please sign in to comment.