This document describes OTA update support and the Web UI firmware flashing workflow.
OTA requires an IP connection but is not tied to WiFi. Call
ConfigManager.setupOTA() after WiFi or Ethernet has received an IP address.
The embedded single-page app exposes a Flash action beside the Settings tab.
Workflow:
- Enable
Allow OTA Updatesunder System and set anOTA Password.- Leave empty to allow unauthenticated uploads.
- Click Flash and select the compiled
.bin(or.bin.gz) produced by PlatformIO. - Enter the OTA password when prompted.
- The SPA sends it as an
X-OTA-PASSWORDheader.
- The SPA sends it as an
- Watch the upload progress popup.
- The popup stays visible while the browser is actively uploading the firmware and warns before accidental page navigation.
- On success, the device reboots automatically.
- The backend remains asynchronous (
ESPAsyncWebServer). - The
/ota_updatehandler streams chunks into the ArduinoUpdateAPI while performing password checks.
An espota environment can upload over WiFi or Ethernet:
[env:ota]
upload_protocol = espota
upload_port = 192.168.2.127
upload_flags =
-a
ota-password
-t
30-a supplies the ArduinoOTA password and -t sets the timeout in seconds.
Keep the password synchronized with the firmware setting. Do not specify both
-a and --auth for the same upload.
To remove OTA support from a firmware build:
[env:noota]
board_build.partitions = no_ota.csv
build_flags =
${env.build_flags}
-DCM_ENABLE_OTA=0The build flag removes ConfigurationsManager OTA code. The partition setting is separate and reclaims the second OTA application slot.
Uploads are rejected when:
- OTA is disabled
- the password is missing/incorrect
- the upload fails integrity checks
The runtime JSON includes OTA status information used by the Web UI:
runtime.system.otaActive: true while an ArduinoOTA or WebUI firmware upload is activeruntime.system.otaHasPassword: true when an OTA password is configured
See also docs/GUI-Runtime.md.
- ConfigurationsManager serves the UI/API over plain HTTP only.
- If you need transport security, provide it externally (VPN, trusted LAN, or a TLS reverse proxy that terminates HTTPS).
- See
docs/SECURITY.mdfor details.
| Method | Overloads / Variants | Description | Notes |
|---|---|---|---|
ConfigManager.setupOTA |
setupOTA(const String& hostname, const String& password = "") |
Initializes ArduinoOTA endpoint and callbacks. | Call after the active IP interface is ready. |
ConfigManager.handleOTA |
handleOTA() |
Processes OTA runtime events. | Must run regularly in loop(). |
ConfigManager.enableOTA |
enableOTA(bool enabled = true) |
Enables/disables OTA handling at runtime. | Runtime control for OTA availability. |