Other

项目介绍

ESP32-Musings/esp32_compressed_delta_ota_update 是一个托管在 GitHub 上的开源项目,主要使用 C 编写,采用 Other 许可证,目前获得 76 个 Star、16 次 Fork。

仓库全名
ESP32-Musings/esp32_compressed_delta_ota_update
开源许可证
Other
Star 数
76
Fork 数
16
未关闭 Issue
1

README 摘要

ESP32 Compressed Delta OTA Updates About the Project The project aims at enabling firmware update of ESP32 Over-the-Air with compressed delta binaries. Testing was done with ESP32-DevKitC v4 board. Getting Started Hardware Required To run the OTA demo, you need an ESP32 dev board (e.g. ESP32-WROVER Kit) or ESP32 core board (e.g. ESP32-DevKitC). You can also try running on ESP32-S2, ESP32-C3 or ESP32-S3 dev boards…

完整内容见 GitHub 原始 README 或本页 。

常见问题

esp32_compressed_delta_ota_update 用什么语言开发?

主要使用 C 编写,采用 Other 许可证,目前有 76 个 Star。

esp32_compressed_delta_ota_update 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 esp32_compressed_delta_ota_update 的源码?

可以直接克隆仓库:git clone https://github.com/ESP32-Musings/esp32_compressed_delta_ota_update.git;安装与运行步骤见仓库 README。

esp32_compressed_delta_ota_update 最近还在维护吗?

仓库最近一次更新为 2024年4月26日,当前有 1 个未关闭 Issue;Star 数为 76,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Compressed Delta OTA Updates for ESP32

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
184
价值分
57
活跃状态
活跃

语言占比

C
CMake

README

Status

ESP32 Compressed Delta OTA Updates

About the Project

The project aims at enabling firmware update of ESP32 Over-the-Air with compressed delta binaries. Testing was done with ESP32-DevKitC v4 board.

Getting Started

Hardware Required

To run the OTA demo, you need an ESP32 dev board (e.g. ESP32-WROVER Kit) or ESP32 core board (e.g. ESP32-DevKitC). You can also try running on ESP32-S2, ESP32-C3 or ESP32-S3 dev boards and let me know how it worked out.

Prerequisites

  • ESP-IDF v4.3 and above

    You can visit the ESP-IDF Programmming Guide for the installation steps.

  • detools v0.49.0 and above

    Binary delta encoding in Python 3.6+. You can follow the instructions here for installation.

Usage

  1. Build the example examples/http_delta_ota - idf.py build. You can use the binary built here as the base_binary.

    For example usage, a while(1) loop printing ‘Hello World!’ was added to this example to create the updated_binary.

  2. To generate the patch, we need 2 application binaries, namely base_binary and updated_binary.

    detools create_patch -c heatshrink base_binary.bin updated_binary.bin patch.bin

  3. Open the project configuration menu (idf.py menuconfig) go to Example Connection Configuration ->

    1. WiFi SSID: WiFi network to which your PC is also connected to.
    2. WiFi Password: WiFi password
  4. In order to test the OTA demo -> examples/http_delta_ota :

    1. Flash the firmware idf.py -p PORT -b BAUD flash.
    2. Run idf.py -p PORT monitor and note down the IP assigned to your ESP module. The default port is 80.
  5. After getting the IP address, send the patch binary through a HTTP Post request over cURL.

    curl -v -X POST --data-binary @- < patch.bin 192.168.201.9:80/ota

Demo Results

  • Base binary: assets/v1.bin
  • Updated binary: assets/v2.bin
  • Patch binary: assets/patch_1_2.bin
  • After successfully patching and rebooting, you can see the Hello World logs.

https://user-images.githubusercontent.com/42297532/152674614-2f4d3b9d-08d2-45bc-a3b6-29f33a191fd7.mp4

Experiments

Chip Scenario Base binary Updated binary Compressed binary patch (Heatshrink) Patch-to-File %
ESP32 test_basic_enable_small_feature 168208 155136 11036 7.11%
ESP32 test_nvs_app_modification 190656 199824 16245 8.13%
ESP32 test_http_upgrade_with_ssl 672736 761184 138839 18.24%
ESP32 test_provisioning_upgrade_idf_patch_version 966656 924448 234096 25.32%
  • As Heatshrink uses static allocation with small look-ahead buffers, it has almost no impact on heap memory.

Test Scenarios: ESP-IDF 4.4-dev (Master branch)

  1. test_basic_enable_small_feature: Enabling a small feature in an update

    Base binary: Compile get-started/hello-world example

    Updated binary: Same, but disable CONFIG_VFS_SUPPORT_IO option in sdkconfig

  2. test_nvs_app_modification: Changing user application flow without changing the set of libraries used

    Base binary: Compile storage/nvs_rw_value example

    Updated binary: Compile storage/nvs_rw_blob example

  3. test_http_upgrade_with_ssl: Changing user application flow with new set of libraries added

    Base binary: Compile protocols/http_server/simple example

    Updated binary: Compile protocols/https_server/simple example

  4. test_provisioning_upgrade_idf_patch_version: Upgrading IDF to the next patch version

    Base binary: Using IDF 4.3, compile provisioning/wifi_prov_mgr example

    Update binary: Same, but with IDF 4.3.1; sdkconfig is generated from scratch.

To-do:

  • Experiments with more test scenarios, especially with bigger binaries

  • Add complete workflow example

    • Currently patch is applied to the ota_0 partition rather than the factory
  • Optimize Heatshrink compression parameters

    • Currently running on low memory usage mode (8, 7) and static allocation
    • Memory usage and app binary size analysis
  • Binary patch with LZMA compression in detools

    • LZMA is memory-heavy but will provide a greater compression ratio for the patch

Acknowledgements & Resources

  • detool: Binary delta encoding in Python 3 and C 🡒 Source | Docs
  • heatshrink: An Embedded Data Compression Library 🡒 Source | Blog
  • Delta updates for embedded systems 🡒 Source | Docs
  • bspatch for ESP32 🡒 Source

License

Distributed under the MIT License. See LICENSE for more information.

Note: The delta component is licensed under the Apache-2.0 License. Please see components/delta/LICENSE for more information.

评论

暂无评论