Add the possibility to upload OTA by http

This commit is contained in:
Mathieu Maret 2017-03-29 21:55:14 +02:00
parent abbfec48c9
commit fa042404b2
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,7 @@
#ifndef CONFIG_DISABLE_WEB
#include <ESP8266HTTPUpdateServer.h>
ESP8266HTTPUpdateServer httpUpdater;
String gpioControlHTML = "";
String pwmControlHTML = "";
@ -293,6 +295,7 @@ void WebSetupServer(int ) {
server.on("/wifiStatus", WebHandleWifiStatus);
server.onNotFound(WebHandleNotFound);
httpUpdater.setup(&server, "/upload");
server.begin();
SKETCH_DEBUG_PRINTLN("HTTP server started");
}

View File

@ -129,6 +129,10 @@ void WifiSetup(productConfig conf) {
SKETCH_DEBUG_PRINTLN("Error setting up MDNS responder!");
} else {
SKETCH_DEBUG_PRINTLN("mDNS responder started");
#ifndef CONFIG_DISABLE_WEB
//Needed for OTA by HTTP
MDNS.addService("http", "tcp", 80);
#endif
}
#endif
myIP = WiFi.localIP();