DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
ota_service.cpp File Reference

Authenticated streaming OTA firmware update (DETWS_ENABLE_OTA). More...

#include "ota_service.h"
#include "services/clock.h"

Go to the source code of this file.

Functions

void detws_ota_begin (DetWebServer &server, const char *path, const char *user, const char *pass)
 Register an authenticated streaming OTA endpoint.
 

Detailed Description

Authenticated streaming OTA firmware update (DETWS_ENABLE_OTA).

Definition in file ota_service.cpp.

Function Documentation

◆ detws_ota_begin()

void detws_ota_begin ( DetWebServer server,
const char *  path,
const char *  user,
const char *  pass 
)

Register an authenticated streaming OTA endpoint.

Call after begin(). A POST @p path carrying a raw firmware image and valid HTTP Basic credentials is streamed into Update; on success the device replies 200 and reboots. Unauthorized or failed uploads get 401 / 400.

Parameters
serverThe running server (the route + stream hooks are installed on it).
pathURL to accept the upload on (e.g. "/update"). Persistent string.
userRequired HTTP Basic username.
passRequired HTTP Basic password.
curl -u admin:s3cret --data-binary @firmware.bin http://<ip>/update

Definition at line 134 of file ota_service.cpp.