diff --git a/Arduino/E131_PixelPusher/E131_PixelPusher.ino b/Arduino/E131_PixelPusher/E131_PixelPusher.ino index dadd670..5e66efd 100644 --- a/Arduino/E131_PixelPusher/E131_PixelPusher.ino +++ b/Arduino/E131_PixelPusher/E131_PixelPusher.ino @@ -36,6 +36,7 @@ uint64_t PM = 0; float interval = 10 * 1000.0; // 10s #endif +bool shouldReboot = false; char update_html[] PROGMEM = R"=====(Firmware Update

Update Firmware


)====="; void setup() @@ -62,7 +63,7 @@ void setup() Serial.println(WiFi.localIP()); server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) { - request->send(200, "text/plain", "Send E1.31 Multicast UDP Request to " + WiFi.localIP().toString()); + request->send(200, "text/html", "

Send E1.31 Multicast UDP Request to " + WiFi.localIP().toString() + "



Update Firmware?

E131_PixelPusher by @debsahu"); }); server.on("/status", HTTP_GET, [](AsyncWebServerRequest *request) { request->send(200, "text/plain", SKETCH_VERSION); @@ -72,12 +73,11 @@ void setup() request->send(response); }); server.on("/update", HTTP_POST, [](AsyncWebServerRequest *request) { - bool shouldReboot = !Update.hasError(); - AsyncWebServerResponse *response = request->beginResponse(200, "text/plain", shouldReboot?"OK":"FAIL"); + shouldReboot = !Update.hasError(); + AsyncWebServerResponse *response = request->beginResponse(200, "text/html", shouldReboot ? "Update Success, rebooting..." : "FAIL"); response->addHeader("Connection", "close"); request->send(response); - if(shouldReboot) ESP.reset(); }, - [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) { + }, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) { if (!filename.endsWith(".bin")) { return; } @@ -175,4 +175,12 @@ void loop() frameCt = 0; } #endif + + if(shouldReboot) { + #ifdef SHOW_FPS_SERIAL + Serial.println("Rebooting..."); + #endif + delay(100); + ESP.reset(); + } } \ No newline at end of file diff --git a/Arduino/E131_PixelPusher/version.h b/Arduino/E131_PixelPusher/version.h index e9f4714..d570d09 100644 --- a/Arduino/E131_PixelPusher/version.h +++ b/Arduino/E131_PixelPusher/version.h @@ -1,4 +1,4 @@ -#define SKETCH_VERSION "1.1.1" +#define SKETCH_VERSION "1.1.2" /* * Dec 13, 2018 v1.0.0 @@ -12,4 +12,8 @@ * - Minor bug fixes * - Add MDNS (new implementation on ESP8266 core v 2.5.0) * - Remove dist folder, supply dist with release +* +* Dec 16,2018 v1.1.2 +* - Changes to webserver reponses +* - no FPS drop from above change */ \ No newline at end of file