ribbit-network-frog-hardware icon indicating copy to clipboard operation
ribbit-network-frog-hardware copied to clipboard

ESP32: Store Wifi Credentials After OTA Update

Open keenanjohnson opened this issue 2 years ago • 4 comments

Our device will need to store the wifi credentials in a way that they can be saved and reapplied after a device firmware update.

keenanjohnson avatar Oct 18 '22 06:10 keenanjohnson

@akhilgupta1093 are you still up for tackling this?

I just made this post in the golioth forums to see if they had any examples or best practices to look at for this: https://forum.golioth.io/t/store-wifi-credentials-after-ota-update/110

keenanjohnson avatar Oct 18 '22 06:10 keenanjohnson

Yes! Thanks for making that post. Doing some general research tomorrow

akhilgupta1093 avatar Oct 18 '22 06:10 akhilgupta1093

Hi @keenanjohnson -- the response provided by Jonathan seems to make sense to me. The code that you implemented calls the NVS API to store the provided wifi credentials outside of the firmware. NVS stores other device-specific credentials, like the PSK ID. It seems like OTA updates won't interfere with these stored values, then. What do you think? If you do an OTA update, do you see this behavior?

akhilgupta1093 avatar Oct 18 '22 17:10 akhilgupta1093

Ah interesting. I haven't tried it yet @akhilgupta1093 so I was just assuming.

keenanjohnson avatar Oct 19 '22 01:10 keenanjohnson

As part of https://github.com/Ribbit-Network/ribbit-network-frog-sensor/pull/184, I have validated that this functions.

keenanjohnson avatar Nov 27 '22 21:11 keenanjohnson