Skip to content

Commit

Permalink
docs: add documentation for HTTPS OTA resumption feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mahavirj committed Jan 23, 2025
1 parent 7bce723 commit 50adc8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/en/api-reference/system/esp_https_ota.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ This option is useful while fetching image from a service like AWS S3, where mbe

Default value of mbedTLS Rx buffer size is set to 16 KB. By using ``partial_http_download`` with ``max_http_request_size`` of 4 KB, size of mbedTLS Rx buffer can be reduced to 4 KB. With this configuration, memory saving of around 12 KB is expected.

OTA Resumption
--------------

To use the OTA resumption feature, enable the ``ota_resumption`` configuration in the :cpp:struct:`esp_https_ota_config_t`. When OTA resumption is enabled, an OTA image download which has failed previously can be resumed from its intermediate state instead of restarting the whole OTA process from the beginning. This is implemented using the HTTP partial range request feature.

To specify the point from where the image download should resume, you need to set the ``ota_image_bytes_written`` field in :cpp:struct:`esp_https_ota_config_t`. This value indicates the number of bytes already written to the OTA partition in the previous OTA attempt.

For reference, you can check the :example:`system/ota/advanced_https_ota`, which demonstrates OTA resumption. In this example, the intermediate OTA state is saved in NVS, allowing the OTA process to resume seamlessly from the last saved state and continue the download.

Signature Verification
----------------------
Expand Down
8 changes: 8 additions & 0 deletions docs/zh_CN/api-reference/system/esp_https_ota.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ ESP HTTPS OTA 升级

mbedTLS Rx buffer 的默认大小为 16 KB,但如果将 ``partial_http_download`` 的 ``max_http_request_size`` 设置为 4 KB,便能将 mbedTLS Rx 的 buffer 减小到 4 KB。使用这一配置方式预计可以节省约 12 KB 内存。

OTA 恢复
--------

:cpp:struct:`esp_https_ota_config_t` 中启用 ``ota_resumption`` 配置,即可使用 OTA 恢复功能。启用此功能后,先前失败的 OTA 镜像下载便可以从中断处继续,无需重新开始整个 OTA 过程。此功能是基于 HTTP 的部分范围请求功能实现的。

要指定镜像下载的续传位置,需要在 :cpp:struct:`esp_https_ota_config_t` 中设置 ``ota_image_bytes_written`` 字段。此字段的值表示在上一次尝试过程中已写入到 OTA 分区的字节数。

如需了解更多,请参阅示例::example:`system/ota/advanced_https_ota`,该示例演示了 OTA 恢复功能。在此示例中, OTA 的中断状态保存在 NVS 中,从而使 OTA 过程能够从上次保存的状态中无缝恢复,并继续下载。

签名验证
-----------------
Expand Down

0 comments on commit 50adc8b

Please sign in to comment.