Espressif’s OTA guide explains how two app slots and the `otadata` partition allow the ESP32 to boot a newly installed firmware image without overwriting the previous working image. That is exactly the reliability feature missing from many hobby projects.
When rollback is enabled, the new image can remain pending verification until the app marks itself valid with `esp_ota_mark_app_valid_cancel_rollback()`. If startup checks fail, the firmware can mark itself invalid and return to the previous image. A successful upload alone is not proof that Wi-Fi, display and touch input still work.
For the CYD Hue remote, verify the actual flash layout and binary size before selecting OTA partitions. Then define a minimal health test: screen initializes, saved configuration loads, and network connection succeeds. Do not promise OTA until both images fit in flash with enough margin.
Go to Source — https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/ota.html