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

[LoRaWAN] Fix session restore throwing unnecessary error #936

Merged
merged 1 commit into from
Jan 20, 2024
Merged

[LoRaWAN] Fix session restore throwing unnecessary error #936

merged 1 commit into from
Jan 20, 2024

Conversation

StevenCellist
Copy link
Collaborator

If a session is stored, the value returned by beginOTAA(), beginABP() and restore() is positive, returning the active mode (OTAA / ABP). This was not handled correctly. Plus reading this mode value from NVM was done in only 1 byte width. From #935 it appears this was accidentally not a relevant bug, fortunately.

@jerryneedell
Copy link

jerryneedell commented Jan 20, 2024

I hope you don't mind my commenting here -- I don't see the fix you gave me being implemented at lines 114/115 in LoraWAN.cpp
Just curious if one of the other changes made it unnecessary?

if(this->band->bandType == RADIOLIB_LORAWAN_BAND_DYNAMIC) {
  // 114: mod->hal->...
  // 115: execMacCommand(...)
}```

@StevenCellist
Copy link
Collaborator Author

I don't mind! You encountered two unrelated problems; this PR addresses the first, I'll send in a second one later that'll also solve the other small bug I found when looking at your logs.

@jerryneedell
Copy link

Great! I just wanted to make sure I was understanding things. Thank you for your quick attention to this and your patience.

@jgromes jgromes merged commit 86136d3 into jgromes:master Jan 20, 2024
28 checks passed
@jgromes
Copy link
Owner

jgromes commented Jan 20, 2024

@StevenCellist merged, thanks for keeping an eye out for LoRaWAN-related issues :)

@StevenCellist
Copy link
Collaborator Author

No problem! Trying my best to support the development. If I end up missing something, feel free to tag me.

barnslig added a commit to barnslig/lorawan-sensor-node that referenced this pull request Mar 4, 2024
+ beginOTAA now returns an unknown value >= 0 on success. This
  commit changes the comparison. See jgromes/RadioLib#936
+ Ensure the maximum duty cycle between transmissions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants