|
1 | | -# ESP Async HTTP Update Server |
2 | | - |
3 | | -This is a copy of [ESP8266HTTPUpdateServer](https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266HTTPUpdateServer)/[ESP32's HTTPUpdateServer](https://github.com/espressif/arduino-esp32/tree/master/libraries/HTTPUpdateServer) library, modified to be compatible with [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer). |
4 | | - |
5 | | -It will provide a simple webpage for updating the firmware or filesystem of `ESP8266` or `ESP32` microcontrollers. |
6 | | - |
7 | | -## Features |
8 | | -- Supports: |
9 | | - - ESP8266 |
10 | | - - ESP32 |
11 | | -- Can Update: |
12 | | - - Firmware |
13 | | - - FileSystem |
14 | | -- Update route customization (default: `/update`) |
15 | | -- Update credentials customization (default: `No credentials`) |
16 | | - - Username |
17 | | - - Password |
18 | | -- FileSystem Options: |
19 | | - - SPIFFS |
20 | | - - LittleFS |
21 | | - |
22 | | -## HowTo |
23 | | - |
24 | | -### Setup |
25 | | -1. Include the library after `ESPAsyncWebServer.h` |
26 | | -``` C++ |
27 | | -#include <ESPAsyncWebServer.h> |
28 | | -#include <ESPAsyncHTTPUpdateServer.h> |
29 | | -``` |
30 | | -2. Create an object from `ESPAsyncHTTPUpdateServer` |
31 | | -``` C++ |
32 | | -ESPAsyncHTTPUpdateServer _updateServer; |
33 | | -AsyncWebServer _server(80); |
34 | | -``` |
35 | | -3. Setup the update server before starting the webServer |
36 | | -``` C++ |
37 | | -_updateServer.setup(&_server); |
38 | | -_server.begin(); |
39 | | -``` |
40 | | -#### Custom Route |
41 | | -``` C++ |
42 | | -_updateServer.setup(&_server, "/customroute"); |
43 | | -``` |
44 | | -#### Credentials |
45 | | -``` C++ |
46 | | -_updateServer.setup(&_server, "username", "password"); |
47 | | -``` |
48 | | -or |
49 | | -``` C++ |
50 | | -_updateServer.setup(&_server, "/customroute", "username", "password"); |
51 | | -``` |
52 | | - |
53 | | -> [!IMPORTANT] |
54 | | -> ### Selecting FileSystem |
55 | | -> 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. |
56 | | -
|
57 | | -> [!TIP] |
58 | | -> ### Debugging |
59 | | -> In order to debug the library funtionality, you can add the `-DESPASYNCHTTPUPDATESERVER_DEBUG` Build Flag to your environment. |
60 | | -> |
61 | | ->This will enable the library to print logs to the Serial. |
62 | | -
|
63 | | -## TODO: |
64 | | -- ESP8266 LittleFS support |
65 | | -- pio publish |
66 | | - |
67 | | -## Contribution |
68 | | -- You can open Issues for any bug report or feature request. |
69 | | -- You are free to contribute to this project by following these steps: |
70 | | - 1. Fork this Repo. |
71 | | - 2. Create a new branch for your feature/bugfix in your forked Repo. |
72 | | - 3. Commit your changes to the new branch you just made. |
73 | | - 4. Create a pull request from your branch into the `master` branch of This Repo([https://github.com/IPdotSetAF/ESPAsyncHTTPUpdateServer](https://github.com/IPdotSetAF/ESPAsyncHTTPUpdateServer)). |
| 1 | +# ESP Async HTTP Update Server |
| 2 | + |
| 3 | +This is a copy of [ESP8266HTTPUpdateServer](https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266HTTPUpdateServer)/[ESP32's HTTPUpdateServer](https://github.com/espressif/arduino-esp32/tree/master/libraries/HTTPUpdateServer) library, modified to be compatible with [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer). |
| 4 | + |
| 5 | +It will provide a simple webpage for updating the firmware or filesystem of `ESP8266` or `ESP32` microcontrollers. |
| 6 | + |
| 7 | +## Features |
| 8 | +- Supports: |
| 9 | + - ESP8266 |
| 10 | + - ESP32 |
| 11 | +- Can Update: |
| 12 | + - Firmware |
| 13 | + - FileSystem |
| 14 | +- Update route customization (default: `/update`) |
| 15 | +- Update credentials customization (default: `No credentials`) |
| 16 | + - Username |
| 17 | + - Password |
| 18 | +- FileSystem Options: |
| 19 | + - SPIFFS |
| 20 | + - LittleFS |
| 21 | + |
| 22 | +## HowTo |
| 23 | + |
| 24 | +### Install |
| 25 | + |
| 26 | +This Library is available in `Arduino Library Repository` and `PIO` and you can install it from: |
| 27 | +- Arduino IDE Library Manager |
| 28 | +- PlatformIO Libraries |
| 29 | + |
| 30 | +### Setup |
| 31 | +1. Include the library after `ESPAsyncWebServer.h` |
| 32 | +``` C++ |
| 33 | +#include <ESPAsyncWebServer.h> |
| 34 | +#include <ESPAsyncHTTPUpdateServer.h> |
| 35 | +``` |
| 36 | +2. Create an object from `ESPAsyncHTTPUpdateServer` |
| 37 | +``` C++ |
| 38 | +ESPAsyncHTTPUpdateServer _updateServer; |
| 39 | +AsyncWebServer _server(80); |
| 40 | +``` |
| 41 | +3. Setup the update server before starting the webServer |
| 42 | +``` C++ |
| 43 | +_updateServer.setup(&_server); |
| 44 | +_server.begin(); |
| 45 | +``` |
| 46 | +#### Custom Route |
| 47 | +``` C++ |
| 48 | +_updateServer.setup(&_server, "/customroute"); |
| 49 | +``` |
| 50 | +#### Credentials |
| 51 | +``` C++ |
| 52 | +_updateServer.setup(&_server, "username", "password"); |
| 53 | +``` |
| 54 | +or |
| 55 | +``` C++ |
| 56 | +_updateServer.setup(&_server, "/customroute", "username", "password"); |
| 57 | +``` |
| 58 | + |
| 59 | +> [!IMPORTANT] |
| 60 | +> ### Selecting FileSystem |
| 61 | +> 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. |
| 62 | +
|
| 63 | +> [!TIP] |
| 64 | +> ### Debugging |
| 65 | +> In order to debug the library funtionality, you can add the `-DESPASYNCHTTPUPDATESERVER_DEBUG` Build Flag to your environment. |
| 66 | +> |
| 67 | +>This will enable the library to print logs to the Serial. |
| 68 | +
|
| 69 | +## TODO: |
| 70 | +- ESP8266 LittleFS support |
| 71 | + |
| 72 | +## Contribution |
| 73 | +- You can open Issues for any bug report or feature request. |
| 74 | +- You are free to contribute to this project by following these steps: |
| 75 | + 1. Fork this Repo. |
| 76 | + 2. Create a new branch for your feature/bugfix in your forked Repo. |
| 77 | + 3. Commit your changes to the new branch you just made. |
| 78 | + 4. Create a pull request from your branch into the `master` branch of This Repo([https://github.com/IPdotSetAF/ESPAsyncHTTPUpdateServer](https://github.com/IPdotSetAF/ESPAsyncHTTPUpdateServer)). |
0 commit comments