mirror of
https://github.com/Crocmagnon/buzzer.git
synced 2024-11-23 08:28:06 +01:00
Add OTA
This commit is contained in:
parent
47267d9217
commit
0b34828376
3 changed files with 14 additions and 3 deletions
14
README.md
14
README.md
|
@ -1,11 +1,19 @@
|
||||||
# Buzzer
|
# Buzzer
|
||||||
## Build
|
## Build
|
||||||
```shell
|
```shell
|
||||||
platformio run --target uploadfs
|
pio run -t uploadfs
|
||||||
platformio run --target upload
|
pio run -t upload
|
||||||
```
|
```
|
||||||
|
|
||||||
## Monitor
|
## Monitor
|
||||||
```shell
|
```shell
|
||||||
platformio device monitor
|
pio device monitor
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OTA
|
||||||
|
```shell
|
||||||
|
pio run
|
||||||
|
pio run -t buildfs
|
||||||
|
```
|
||||||
|
|
||||||
|
Go to http://<IP>/upload and upload `firmware.bin` and `spiffs.bin` to the firmware and filesystem sections.
|
||||||
|
|
|
@ -21,3 +21,4 @@ lib_deps =
|
||||||
https://github.com/schreibfaul1/ESP32-audioI2S.git
|
https://github.com/schreibfaul1/ESP32-audioI2S.git
|
||||||
adafruit/Adafruit SSD1306
|
adafruit/Adafruit SSD1306
|
||||||
adafruit/Adafruit GFX Library
|
adafruit/Adafruit GFX Library
|
||||||
|
ayushsharma82/AsyncElegantOTA
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <Adafruit_GFX.h>
|
#include <Adafruit_GFX.h>
|
||||||
#include <Adafruit_SSD1306.h>
|
#include <Adafruit_SSD1306.h>
|
||||||
#include <Preferences.h>
|
#include <Preferences.h>
|
||||||
|
#include <AsyncElegantOTA.h>
|
||||||
|
|
||||||
// Toggle on to switch to AP mode.
|
// Toggle on to switch to AP mode.
|
||||||
// Leave commented for wifi station mode.
|
// Leave commented for wifi station mode.
|
||||||
|
@ -341,6 +342,7 @@ void setup()
|
||||||
server.on("/upload", HTTP_POST, onUpload, onUploadFile);
|
server.on("/upload", HTTP_POST, onUpload, onUploadFile);
|
||||||
server.onNotFound(onNotFound);
|
server.onNotFound(onNotFound);
|
||||||
server.serveStatic("/", SPIFFS, "/www/").setDefaultFile("index.html");
|
server.serveStatic("/", SPIFFS, "/www/").setDefaultFile("index.html");
|
||||||
|
AsyncElegantOTA.begin(&server);
|
||||||
server.begin();
|
server.begin();
|
||||||
|
|
||||||
Serial.println("Server ready!");
|
Serial.println("Server ready!");
|
||||||
|
|
Loading…
Reference in a new issue