An Arduino library for ESP32/ESP8266 that provides an elegant web page for OTA (Over-The-Air) firmware and filesystem updates, with authentication and auto-detection.
π Built-in OTA web page - compressed HTML interface (gzip)
π Optional authentication - protects update access
π Auto-detection - recognizes update type by file extension
π Dual support - compatible with SPIFFS and LittleFS
π Backward compatibility - maintains old endpoints
β‘ Performance - uses ESPAsyncWebServer for async connections
Sketch β Include Library β Manage Libraries...
Search for "AsyncOTAManager"
Click Install
Download the latest version from here
Extract to the Arduino IDE libraries folder
Restart Arduino IDE
#include <WiFi.h>
#include <AsyncOTAManager.h>
AsyncWebServer server(80);
AsyncOTAManager otaManager(server);
void setup() {
Serial.begin(115200);
// Connect to WiFi
WiFi.begin("SSID", "password");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nConnected! IP: " + WiFi.localIP().toString());
// Configure OTA
otaManager.setAuthentication("admin", "password123"); // Optional
otaManager.enableAutoDetect(true); // Enabled by default
otaManager.begin("/update");
server.begin();
}
void loop() {
// Your main code
}AsyncOTAManager(AsyncWebServer &server);// Start OTA service
void begin(const char *path = "/update");
// Set authentication (optional)
void setAuthentication(const char *user, const char *pass);
// Enable/disable auto-detection
void enableAutoDetect(bool enable = true);| Endpoint | Method | Description |
|---|---|---|
/ota |
GET | OTA web upload page (default path) |
/update |
POST | Universal upload endpoint with auto-detection |
/update-fw |
POST | Legacy firmware upload endpoint |
/update-spiffs |
POST | Legacy SPIFFS upload endpoint |
/update-littlefs |
POST | LittleFS upload endpoint |
Usage Examples:
- Access
http://[ESP_IP]/otain your browser to see the upload page - Send POST request to
http://[ESP_IP]/updatewith your.binfile - For compatibility, you can still use
/update-fwand/update-spiffs
Authentication: All endpoints support optional HTTP Basic Authentication when configured.
| File Extension | Update Type |
|---|---|
.bin, .ino.bin |
Firmware |
.spiffs.bin |
SPIFFS |
.littlefs.bin |
LittleFS |
#include <AsyncOTAManager.h>
// Create server and OTA manager
AsyncWebServer server(80);
AsyncOTAManager otaManager(server);
void setup() {
Serial.begin(115200);
// WiFi
WiFi.mode(WIFI_STA);
WiFi.begin("NetworkSSID", "NetworkPassword");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.print("IP: ");
Serial.println(WiFi.localIP());
// Configure OTA
otaManager.setAuthentication("admin", "securepass");
otaManager.begin("/update"); // Change path if desired
// Other server routes...
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
request->send(200, "text/plain", "Hello! Go to /update for OTA");
});
server.begin();
Serial.println("Server started. Access http://" + WiFi.localIP().toString() + "/update");
}
void loop() {
// Run other tasks here
delay(1000);
}ESP Async WebServer
AsyncTCP (ESP32)
ESPAsyncTCP (ESP8266)
ESP32 (tested on ESP32 DevKit, NodeMCU-32S)
ESP8266 (tested on NodeMCU, Wemos D1 Mini)
AsyncOTAManager/
βββ examples/
β βββ BasicOTA/
β β βββ BasicOTA.ino
β βββ SecureOTA/
β βββ SecureOTA.ino
βββ src/
β βββ AsyncOTAManager.h
β βββ AsyncOTAManager.cpp
β βββ ota_html_gz.h (generated separately)
βββ library.properties
βββ keywords.txt
βββ README.md
βββ LICENSE
Fork the repository
Create a new branch (git checkout -b feature/new)
Commit your changes (git commit -am 'Add feature X')
Push to the branch (git push origin feature/new)
Open a Pull Request
ESPAsyncWebServer for the async web server
Arduino Core for ESP32/ESP8266 support