Over-the-air updates
After deploying an IoT device, it doesn’t mean the development is finished forever. On the contrary, this is the most important stage in the life cycle of an IoT product and still requires active development. We might want to add new features as a response to the users’ needs or it might be a necessity to improve the product security after discovering a potential risk. In either case, we need to have a means to update the firmware remotely without physically touching the deployed IoT products. Over-the-air (OTA) update techniques provide this capability.
The basic OTA update mechanism in ESP-IDF works as follows:
- We configure the flash to have two different partitions,
ota_0
andota_1
, to accommodate the running firmware and a new firmware. - When we upload a new firmware, ESP-IDF chooses the free partition to save the incoming bytes. ESP-IDF marks it as the candidate active partition as soon as all the bytes are transferred. ...