Skip to content

A Simple OTA web page implemented over ESPAsyncWebServer(by me-no-dev)

License

Notifications You must be signed in to change notification settings

IPdotSetAF/ESPAsyncHTTPUpdateServer

Repository files navigation

ESP Async HTTP Update Server

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 ❤️

Features

  • Supports:
    • ESP8266
    • ESP32
  • Can Update:
    • Firmware
    • FileSystem
  • Styling:
    • Stylized (Additional ~350 bytes)
    • Minimal
  • Update route customization (default: /update)
  • Update credentials customization (default: No credentials)
    • Username
    • Password
  • FileSystem Options:
    • SPIFFS
    • LittleFS

HowTo

Install

This Library is available in Arduino Library Repository and PIO and you can install it from:

  • Arduino IDE Library Manager

Arduino library manager

  • PlatformIO Libraries

pltformio library

ipdotsetaf/ESPAsyncHTTPUpdateServer@^2.0.0

Setup

  1. Include the library after ESPAsyncWebServer.h
#include <ESPAsyncWebServer.h>
#include <ESPAsyncHTTPUpdateServer.h>
  1. Create an object from ESPAsyncHTTPUpdateServer
ESPAsyncHTTPUpdateServer _updateServer;
AsyncWebServer _server(80);
  1. Setup the update server before starting the webServer
_updateServer.setup(&_server);
_server.begin();

Custom Route

_updateServer.setup(&_server, "/customroute");

Credentials

_updateServer.setup(&_server, "username", "password");

or

_updateServer.setup(&_server, "/customroute", "username", "password");

Styling

  • Stylized

Stylized OTA Page

  • Minimal

Minimal OTA Page

Important

By default styling is disabled to save ~350 bytes of flash memory.

You can enable the styling by adding the -DESPASYNCHTTPUPDATESERVER_PRETTY Build Flag to your environment.

Selecting FileSystem

Important

The library's default fileSystem is SPIFFS but if you are using LittleFS for your FileSystem, make sure to add the -DESPASYNCHTTPUPDATESERVER_LITTLEFS Build Flag to your environment.

Debugging

Tip

To debug the library functionality, you can add the -DESPASYNCHTTPUPDATESERVER_DEBUG Build Flag to your environment.

This will enable the library to print logs to the Serial.

Tip

If you are using another Serial port, you can override the default serial by adding the -DESPASYNCHTTPUPDATESERVER_SerialOutput=Serial1 Build Flag to your environment.

Server Working Example

Please refer to this fully working example

TODO:

  • Custom CSS support
  • Synchronous WebServer support

Contribution

  • You can open Issues for any bug report or feature request.
  • You are free to contribute to this project by following these steps:
    1. Fork this Repo.
    2. Create a new branch for your feature/bugfix in your forked Repo.
    3. Commit your changes to the new branch you just made.
    4. Create a pull request from your branch into the master branch of This Repo(https://github.com/IPdotSetAF/ESPAsyncHTTPUpdateServer).