OTA update process
Posted: Sun Dec 01, 2019 3:02 pm
Hi,
I'm implementing application for ESP32 and got to the point where I need to start thinking of OTA update possibility for it.
I tested the native_ota_example and it worked okay. Only thing I'm having hard time grasping is the way that the 'real world applications' should implement the ota update.
The example pretty much writes the hello_world and after that it doesn't check the OTA updates anymore.
By default there is factory app and two ota - partitions. In native_ota_example the example itself acts as the factory_app as far as I've understood.
What is the proper way to initiate/do ota update once the application is running? Do I implement the functionality in my application or should I boot the device to factory_app that then would do the update? I tried the latter, but most likely due limit of the example it always updated although no changes where made to application that was 'updated' via ota.
Same for the rollback. I'm _guessing_ based on documentation application should call esp_ota_mark_app_valid_cancel_rollback or esp_ota_mark_app_invalid_rollback_and_reboot respectively and bootloader(not factory_app) will handle the rollback (if there is more than one image ie. not the first time for ota-update). I guess in case of first update bootloader would start factory_app?
Documentation has all the function calls etc. but I'm having bit hard time getting the whole picture of the process from there.
I'm implementing application for ESP32 and got to the point where I need to start thinking of OTA update possibility for it.
I tested the native_ota_example and it worked okay. Only thing I'm having hard time grasping is the way that the 'real world applications' should implement the ota update.
The example pretty much writes the hello_world and after that it doesn't check the OTA updates anymore.
By default there is factory app and two ota - partitions. In native_ota_example the example itself acts as the factory_app as far as I've understood.
What is the proper way to initiate/do ota update once the application is running? Do I implement the functionality in my application or should I boot the device to factory_app that then would do the update? I tried the latter, but most likely due limit of the example it always updated although no changes where made to application that was 'updated' via ota.
Same for the rollback. I'm _guessing_ based on documentation application should call esp_ota_mark_app_valid_cancel_rollback or esp_ota_mark_app_invalid_rollback_and_reboot respectively and bootloader(not factory_app) will handle the rollback (if there is more than one image ie. not the first time for ota-update). I guess in case of first update bootloader would start factory_app?
Documentation has all the function calls etc. but I'm having bit hard time getting the whole picture of the process from there.