Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved node.beginOTAA() before recalling LoRaWAN nonces & session, updated expected return values #53

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading