Basic HTTP OTA updater implemented

This commit is contained in:
cschwinne 2016-09-21 23:23:18 +02:00
parent ed2381ec70
commit 6f8ff7b02e
2 changed files with 9 additions and 2 deletions

View File

@ -4,12 +4,14 @@ additional color picker field
change slider height to relative values change slider height to relative values
improve firefox UI appearance improve firefox UI appearance
implement all settings setters implement all settings setters
implement OTA implement OTA lock / security
implement OTA lock
implement button implement button
implement HSB slider option implement HSB slider option
change color submit from get to post, rewrite with args, requires no buffer change color submit from get to post, rewrite with args, requires no buffer
change color submit from rgb to hex change color submit from rgb to hex
svg icons in html
(get rid of spiffs, use progmem for html??)
BUGS BUGS
static ip disables mdns static ip disables mdns
XXX authentification for security relevant areas (/edit, /update (!!!), /list, /down, [/settings, /reset, /cleareeprom])

View File

@ -1,6 +1,7 @@
#include <Arduino.h> #include <Arduino.h>
#include <ESP8266WiFi.h> #include <ESP8266WiFi.h>
#include <ESP8266WebServer.h> #include <ESP8266WebServer.h>
#include <ESP8266HTTPUpdateServer.h>
#include <ESP8266mDNS.h> #include <ESP8266mDNS.h>
#include <EEPROM.h> #include <EEPROM.h>
#include <Hash.h> #include <Hash.h>
@ -38,6 +39,8 @@ int nopwrled = 1;
char HTTP_req[150]; char HTTP_req[150];
ESP8266WebServer server(80); ESP8266WebServer server(80);
ESP8266HTTPUpdateServer httpUpdater;
File fsUploadFile; File fsUploadFile;
void down() void down()
@ -703,6 +706,8 @@ void setup() {
server.on("/down", HTTP_GET, down); server.on("/down", HTTP_GET, down);
//clear eeprom //clear eeprom
server.on("/cleareeprom", HTTP_GET, clearEEPROM); server.on("/cleareeprom", HTTP_GET, clearEEPROM);
//init ota page
httpUpdater.setup(&server);
} }
//called when the url is not defined here, ajax-in; get-settings //called when the url is not defined here, ajax-in; get-settings
server.onNotFound([](){ server.onNotFound([](){