Skip to content

This ESP32 component enables devices to connect to an Over-The-Air (OTA) update server, and update themselves. Once a new firmware image is available, the device will receive a request and connect to the server to download the new image, and finally reboot.

Notifications You must be signed in to change notification settings

nubificus/ota-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ota-service

ESP32 Component for performing Over the Air updates

How to use

cd <path-to-your-esp-idf-project>
mkdir -p components
cd components
git clone https://github.com/nubificus/ota-service.git

Add the component to your project by simply adding the following line inside idf_component_register() of <path-to-your-esp-idf-project>/main/CMakeLists.txt:

REQUIRES ota-service

E.g:

idf_component_register(SRCS "test.c"
                       INCLUDE_DIRS "."
                       REQUIRES ota-service)

You may also have to add the following configuration to resolve some mbedtls issues:

idf.py menuconfig

and enable Component config -> mbedTLS -> HKDF Algorithm (RFC 6859)

Afterwards, you can include the component's header file:

#include "ota-service.h"

API Reference

/* 
 * this function can be passed as an
 * argument in `akri_set_update_handler()`
 * so that it only runs when we receive a
 * POST request at `/update` endpoint.
 * */
esp_err_t ota_request_handler(httpd_req_t *req);

The component follows the secure OTA workflow when OTA_SECURE macro is defined. Otherwise, the update is insecure.

About

This ESP32 component enables devices to connect to an Over-The-Air (OTA) update server, and update themselves. Once a new firmware image is available, the device will receive a request and connect to the server to download the new image, and finally reboot.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published