Add ESP8266HTTPUpdateServer as alternative

This commit is contained in:
Tobias Blum 2018-03-18 01:47:13 +01:00
parent 9657b04ed9
commit 445e663ca0
2 changed files with 10 additions and 1 deletions

View file

@ -42,6 +42,10 @@
ESP8266WebServer server(80);
WebSocketsServer webSocket = WebSocketsServer(81);
#ifdef HTTP_OTA
#include <ESP8266HTTPUpdateServer.h>
ESP8266HTTPUpdateServer httpUpdater;
#endif
// ***************************************************************************
// Load libraries / Instanciate WS2812FX library
@ -572,6 +576,10 @@ void setup() {
getStatusJSON();
});
#ifdef HTTP_OTA
httpUpdater.setup(&server,"/update");
#endif
server.begin();
// Start MDNS service

View file

@ -6,6 +6,7 @@
const char HOSTNAME[] = "McLighting01"; // Friedly hostname
//#define HTTP_OTA // If defined, enable Added ESP8266HTTPUpdateServer
#define ENABLE_OTA // If defined, enable Arduino OTA code.
#define ENABLE_MQTT // If defined, enable MQTT client code, see: https://github.com/toblum/McLighting/wiki/MQTT-API
#define ENABLE_HOMEASSISTANT // If defined, enable Homeassistant integration, ENABLE_MQTT must be active