How to detect the first boot after OTA update
Posted: Thu Oct 29, 2020 2:03 pm
Hi!
I'm using OTA with esp32 and recently I decided to implement failsafe in case of me as a programmer mess up the code and after update the new firmware doesn't connect properly to my server and as a cosequence I cannot do any more updates.
I can easily store something in nvs(or rtc noinit memory) before starting OTA and delete it after successful connection to the server(and use esp_ota_mark_app_valid_cancel_rollback), but I was wondering if there's a cleverer way to detect first boot after update?
Extra points if I can do it with minimal initialization of peripherals as early after boot as possible.
Thanks
I'm using OTA with esp32 and recently I decided to implement failsafe in case of me as a programmer mess up the code and after update the new firmware doesn't connect properly to my server and as a cosequence I cannot do any more updates.
I can easily store something in nvs(or rtc noinit memory) before starting OTA and delete it after successful connection to the server(and use esp_ota_mark_app_valid_cancel_rollback), but I was wondering if there's a cleverer way to detect first boot after update?
Extra points if I can do it with minimal initialization of peripherals as early after boot as possible.
Thanks