diff --git a/README.md b/README.md index 99f9e59..6892e11 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,19 @@ # Buzzer ## Build ```shell -platformio run --target uploadfs -platformio run --target upload +pio run -t uploadfs +pio run -t upload ``` ## Monitor ```shell -platformio device monitor +pio device monitor ``` + +## OTA +```shell +pio run +pio run -t buildfs +``` + +Go to http:///upload and upload `firmware.bin` and `spiffs.bin` to the firmware and filesystem sections. diff --git a/platformio.ini b/platformio.ini index db28d63..4ab07cf 100644 --- a/platformio.ini +++ b/platformio.ini @@ -21,3 +21,4 @@ lib_deps = https://github.com/schreibfaul1/ESP32-audioI2S.git adafruit/Adafruit SSD1306 adafruit/Adafruit GFX Library + ayushsharma82/AsyncElegantOTA diff --git a/src/main.cpp b/src/main.cpp index 0f8f78d..428f897 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,7 @@ #include #include #include +#include // Toggle on to switch to AP mode. // Leave commented for wifi station mode. @@ -341,6 +342,7 @@ void setup() server.on("/upload", HTTP_POST, onUpload, onUploadFile); server.onNotFound(onNotFound); server.serveStatic("/", SPIFFS, "/www/").setDefaultFile("index.html"); + AsyncElegantOTA.begin(&server); server.begin(); Serial.println("Server ready!");