espressif / idf-extra-components

Additional components for ESP-IDF, maintained by Espressif
152 stars 93 forks source link

Add esp_delta_ota component to component manager #156

Closed hmalpani closed 1 year ago

hmalpani commented 1 year ago

Add esp_delta_ota component to the component manager

This component helps in performing OTA upgrades with compressed delta binary. This helps in reducing the size of the file transferred over the channel.

The table below contains some data related to OTA upgrades using this component. For this data, the https_delta_ota example in examples directory if this component was built on IDF v5.0 and the updated binaries listed in the Updated to Example column were build on this IDF master commit.

Updated to Example F/W Size (B) Patch Size (B) Normal OTA time (s) Delta OTA time (s) Patch to file ratio (%)
hello_world 173200 44686 7.204 3.121 25.80%
esp_http_client 963984 305499 36.87 18.894 31.69%
wifi_prov_mgr 1092352 494368 42.154 26.133 45.26%

Memory Overhead: On comparing the minimum heap for native_ota_example and esp_delta_ota_example, around 1-2KB of memory overhead is observed with esp_delta_ota.

igrr commented 1 year ago

cc @wujiangang @WangYuxin-esp — since you folks worked on https://github.com/espressif/esp-bootloader-plus/blob/master/main/bootloader_diff_ddelta.c, could you please help with reviewing the code in this PR?

igrr commented 1 year ago

@hmalpani would it be possible to add an application example in the examples/esp_delta_ota subdirectory of the component?

WangYuxin-esp commented 1 year ago

cc @wujiangang @WangYuxin-esp — since you folks worked on https://github.com/espressif/esp-bootloader-plus/blob/master/main/bootloader_diff_ddelta.c, could you please help with reviewing the code in this PR?

This is a good solution. We need to pay attention to its memory consumption and the robustness of compression performance. One small issue is that even if it is an unsigned patch file(secure boot enabled), we have to accept it and try to apply it.

eerimoq commented 1 year ago

I'm happy to see that you are using detools (one of my projects) =)

hmalpani commented 1 year ago

@hmalpani would it be possible to add an application example in the examples/esp_delta_ota subdirectory of the component?

Hello @igrr Are you suggesting renaming the current example name from https_delta_ota to esp_delta_ota or to add the current example in another subdirectory i.e esp_delta_ota?

I used 'https_delta_ota' as example name because this component might also be used for other OTA channels like BLE or MQTT. As this particular example uses HTTPS protocol for downloading the patch file from the server, hence `https_delta_ota'