Skip to content

Commit 8eec186

Browse files
authored
Added Firmware update
Added ability to update firmware from a file
1 parent 33ffc2f commit 8eec186

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

OpenEVSE_RAPI_WiFi_ESP8266.ino

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
#include <ESP8266mDNS.h>
2222
#include <ArduinoOTA.h>
2323
#include <ESP8266WebServer.h>
24+
#include <ESP8266HTTPUpdateServer.h>
2425
#include <EEPROM.h>
2526

2627
ESP8266WebServer server(80);
28+
ESP8266HTTPUpdateServer httpUpdater;
2729

2830
//Default SSID and PASSWORD for AP Access Point Mode
2931
const char* ssid = "OpenEVSE";
@@ -213,7 +215,9 @@ void setup() {
213215
s += st;
214216
s += "<p>";
215217
s += "<form method='get' action='a'><label><b><i>WiFi SSID:</b></i></label><input name='ssid' length=32><p><label><b><i>Password :</b></i></label><input name='pass' length=64><p><label><b><i>Device Access Key:</b></i></label><input name='ekey' length=32><p><label><b><i>Node:</b></i></label><select name='node'><option value='0'>0 - Default</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option></select><p><label><b><i>Ohm Connect Key - Optional:</b></i></label><input name='ohm' length=64><p><input type='submit'></form>";
216-
s += "<a href='/status'>Status </a><a href='/rapi'>RAPI </a>";
218+
s += "<a href='/status'>Status </a><a href='/rapi'>RAPI </a><br><br>";
219+
s += "<p><b>Firmware Update</b><p>";
220+
s += "<iframe style='width:380px; height:50px;' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='/update'></iframe>";
217221
s += "</html>\r\n\r\n";
218222
server.send(200, "text/html", s);
219223
});
@@ -389,8 +393,10 @@ void setup() {
389393
s += "</html>\r\n\r\n";
390394
server.send(200, "text/html", s);
391395
});
392-
396+
397+
httpUpdater.setup(&server);
393398
server.begin();
399+
httpUpdater.setup(&server);
394400
//Serial.println("HTTP server started");
395401
delay(100);
396402
Timer = millis();

0 commit comments

Comments
 (0)