Examples
Example sketches in the ElegantOTA and ElegantOTA Pro repositories for the synchronous and asynchronous web servers and for update channels.
The ElegantOTA repositories include example sketches that show how to integrate OTA updates with different web servers. Each example builds on the setup described in the Integration Guide and registers the onStart, onProgress and onEnd callbacks, logging progress once per second.
ElegantOTA Lite
| Example | Description |
|---|---|
| Demo | Uses the built-in synchronous web server of the platform. Requires no additional libraries. |
| AsyncDemo | Uses ESPAsyncWebServer. Use it only if your project already uses ESPAsyncWebServer, and enable async mode before compiling it. |
All examples are available in the examples folder of the repository. In the Arduino IDE, you can also open them from File > Examples > ElegantOTA after installing the library.
ElegantOTA Pro
ElegantOTA Pro ships with the same Demo and AsyncDemo examples, plus:
| Example | Description |
|---|---|
| UpdateChannel | Configures an update channel with scheduled checks, reports the source of each update and decides when to install a new version in the onUpdateAvailable callback. |
RP2040 and RP2350
The examples work on the Raspberry Pi Pico W and Pico 2 W only with a LittleFS partition. In the Arduino IDE, select a flash layout with a filesystem, for example Tools > Flash Size > 2MB (Sketch 1MB, FS 1MB).