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

Save keys to EEPROM once #8

Open
Kevinvincentals opened this issue Feb 5, 2024 · 3 comments
Open

Save keys to EEPROM once #8

Kevinvincentals opened this issue Feb 5, 2024 · 3 comments

Comments

@Kevinvincentals
Copy link

Hi Jack!
Thanks for sharing this. I've pulled my hair out for ages to have Lora working correctly with my ESP32 deep sleep. This fixed it!

I am however interested in saving the keys to EEPROM, and reading them from there.
In your blog post, you wrote that is has a very limited lifespan - And I indeed understand that, so I am open for other ideas.

We are developing a edge device that will be set out in different areas. Battery life is VERY important for us, and thus if at any point the device should restart and do a join procedure, that would kill the battery completly.

I've tried different approaches to implement it, but I simply cannot get it working. Do you have an example or any other tips for how we can make it persistent with OTTA, and not use ABP?

@cyberman54
Copy link

In my sleep mode application i don't rejoin after sleep, so no need to persist the keys. Saving last LMIC state to backep RTC RAM on ESP32. But may depend on sleep time and Lorawan Network Server Settings.
Example (based on Jack's prior art): https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/lorawan.cpp#L515

@Kevinvincentals
Copy link
Author

In my sleep mode application i don't rejoin after sleep, so no need to persist the keys. Saving last LMIC state to backep RTC RAM on ESP32. But may depend on sleep time and Lorawan Network Server Settings. Example (based on Jack's prior art): https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/lorawan.cpp#L515

So the issue is not reading from sleep. The issue is a hard reboot (where we take power from the ESP32). Does your example account for that?

@cyberman54
Copy link

Not really. In my application the keys are compiled in the firmware and DEVEUI is derived of ESP32 MAC.

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

No branches or pull requests

2 participants