This is an advanced version ESP8266HTTPUpdateServer/ESP32's HTTPUpdateServer library, modified to be compatible with ESPAsyncWebServer and also add optional Styling 🌈 to the page.
It will provide a webpage for updating the firmware/filesystem of ESP8266 or ESP32 microcontrollers.
[!IMPORTANT] If you found this library helpful, please consider leaving a Star⭐
It helps a lot in maintaining the project ❤️
/update)No credentials)This Library is available in Arduino Library Repository and PIO and you can install it from:
| Arduino IDE Library Manager | PlatformIO Libraries |
|---|---|
![]() |
![]() |
ipdotsetaf/ESPAsyncHTTPUpdateServer@^3.0.0
ESPAsyncWebServer.h#include <ESPAsyncWebServer.h>
#include <ESPAsyncHTTPUpdateServer.h>
ESPAsyncHTTPUpdateServerESPAsyncHTTPUpdateServer updateServer;
AsyncWebServer server(80);
updateServer.setup(&server);
server.begin();
updateServer.setup(&server, "/customroute");
updateServer.setup(&server, "username", "password");
or
updateServer.setup(&server, "/customroute", "username", "password");
updateServer.onUpdateBegin = [](https://raw.githubusercontent.com/IPdotSetAF/ESPAsyncHTTPUpdateServer/refs/heads/master/const UpdateType type, int &result)
{
//...
};
updateServer.onUpdateEnd = [](https://raw.githubusercontent.com/IPdotSetAF/ESPAsyncHTTPUpdateServer/refs/heads/master/const UpdateType type, int &result)
{
//...
};
updateServer.onUpdateBegin = [](https://raw.githubusercontent.com/IPdotSetAF/ESPAsyncHTTPUpdateServer/refs/heads/master/const UpdateType type, int &result)
{
result = UpdateResult::UPDATE_ABORT;
};
| Stylized | Minimal |
|---|---|
![]() |
![]() |
[!IMPORTANT] By default styling is disabled to save ~350 bytes of flash memory.
You can enable the styling by adding the
-DESPASYNCHTTPUPDATESERVER_PRETTYBuild Flag to your environment.
[!IMPORTANT] Add the
-DESPASYNCHTTPUPDATESERVER_MODEBuild Flag with desired value to choose different update mode. Choose the right value based on your needs from bellow table:
Update mode value Firmware and FileSystem 0 Firmware only 1 FileSystem only 2
in case you liked to modify the html of any of the pages, you need to run the scripts/codeGenerator.py afterwards so html contents get processed and placed in the source.
Instructions:
pip install -r requirements.txtpython codeGenerator.py[!IMPORTANT] The library's default fileSystem is
SPIFFSbut if you are usingLittleFSfor your FileSystem, make sure to add the-DESPASYNCHTTPUPDATESERVER_LITTLEFSBuild Flag to your environment.
[!TIP] To debug the library functionality, you can add the
-DESPASYNCHTTPUPDATESERVER_DEBUGBuild Flag to your environment.This will enable the library to print logs to the Serial.
[!TIP] If you are using another
Serialport, you can override the default serial by adding the-DESPASYNCHTTPUPDATESERVER_SerialOutput=Serial1Build Flag to your environment.
Please refer to this fully working example
master branch of This Repo(https://github.com/IPdotSetAF/ESPAsyncHTTPUpdateServer).