Skip to content

Commit 627052c

Browse files
committed
Add basic authentification and OTA update
only web update is supported
1 parent 18d3550 commit 627052c

19 files changed

+887
-28
lines changed

Page1.png

21.9 KB
Loading

Page2.png

13.6 KB
Loading

Page3.png

6.87 KB
Loading

Page4.png

13.3 KB
Loading

Page6.png

9.26 KB
Loading

Page7.png

18.4 KB
Loading

Page8.png

14.5 KB
Loading

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Additionnaly:
4646
*Tools:
4747
--Use IDE to upload directly (latest version of board manager module generate one binary)
4848
-- to flash the htm files present in data directory you need to use another tool, installation and usage is explained here: http://arduino.esp8266.com/versions/1.6.5-1160-gef26c5f/doc/reference.html#file-system
49-
49+
Once flashed you also can use the web updater to flash new FW in System Configuration Page
5050

5151
*Connection
5252
--Connect GPIO0 to ground to be in update mode
@@ -78,6 +78,8 @@ Baud rate: 9600
7878
Web port:80
7979
Data port: 8888
8080
Web Page refresh: 3 secondes
81+
User: admin
82+
Password: admin
8183

8284
These are the pages defined using template:
8385
Home page :
@@ -94,6 +96,10 @@ Printer Status Page for more than 64K SPIFFS, fancy one:
9496
<img src=https://raw.githubusercontent.com/luc-github/ESP8266/master/page5.png><br>
9597
Extra Settings Page, for web UI and for printer:
9698
<img src=https://raw.githubusercontent.com/luc-github/ESP8266/master/Page6.png><br>
99+
Change password Page:
100+
<img src=https://raw.githubusercontent.com/luc-github/ESP8266/master/Page7.png><br>
101+
Login Page:
102+
<img src=https://raw.githubusercontent.com/luc-github/ESP8266/master/Page8.png><br>
97103
the template files are stored on SPIFFS:
98104
<img src=https://raw.githubusercontent.com/luc-github/ESP8266/master/files.png><br>
99105
and uploaded using [IDE](http://arduino.esp8266.com/versions/1.6.5-1160-gef26c5f/doc/reference.html#file-system)
@@ -110,6 +116,14 @@ Currently, I tested on ESP01 using 64K SPIFFS ( please use data directory conten
110116
*SSDP : on Station and AP mode (done)
111117
*Captive portal : on AP mode only (not yet functionnal)
112118

119+
##Basic Authentification
120+
Can be disabled in FW
121+
default user: admin
122+
default password: admin
123+
124+
#OTA support
125+
Currently only web update is supported not telnet one
126+
113127
##Commands/msg from/to serial(not fully implemented):
114128
*from module to printer by serial communication
115129
-M117 [Message], Error/status message from module (done)

esp8266/config.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ bool CONFIG::reset_config()
176176
if(!CONFIG::write_buffer(EP_XY_FEEDRATE,(const byte *)&DEFAULT_XY_FEEDRATE,INTEGER_LENGTH))return false;
177177
if(!CONFIG::write_buffer(EP_Z_FEEDRATE,(const byte *)&DEFAULT_Z_FEEDRATE,INTEGER_LENGTH))return false;
178178
if(!CONFIG::write_buffer(EP_E_FEEDRATE,(const byte *)&DEFAULT_E_FEEDRATE,INTEGER_LENGTH))return false;
179+
if(!CONFIG::write_string(EP_ADMIN_PWD,FPSTR(DEFAULT_ADMIN)))return false;
179180
return true;
180181
}
181182

esp8266/config.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
//CAPTIVE_PORTAL_FEATURE: In SoftAP redirect all unknow call to main page
3030
#define CAPTIVE_PORTAL_FEATURE
3131

32+
//AUTHENTICATION_FEATURE: protect pages by login password
33+
#define AUTHENTICATION_FEATURE
34+
3235
#ifndef CONFIG_h
3336
#define CONFIG_h
3437

@@ -38,7 +41,7 @@ extern "C" {
3841
#include "user_interface.h"
3942
}
4043
//version and sources location
41-
#define FW_VERSION "0.4"
44+
#define FW_VERSION "0.5"
4245
#define REPOSITORY "https://github.com/luc-github/ESP8266"
4346

4447

@@ -73,6 +76,7 @@ extern "C" {
7376
#define EP_XY_FEEDRATE 164//4 bytes = int
7477
#define EP_Z_FEEDRATE 168//4 bytes = int
7578
#define EP_E_FEEDRATE 172//4 bytes = int
79+
#define EP_ADMIN_PWD 176//21 bytes 20+1 = string ; warning does not support multibyte char like chinese
7680

7781

7882

@@ -99,13 +103,16 @@ const int DEFAULT_DATA_PORT = 8888;
99103
const int DEFAULT_XY_FEEDRATE=1000;
100104
const int DEFAULT_Z_FEEDRATE =100;
101105
const int DEFAULT_E_FEEDRATE=400;
106+
const char DEFAULT_ADMIN [] PROGMEM = "admin";
102107

103108
//sizes
104109
#define EEPROM_SIZE 256 //max is 512
105110
#define MAX_SSID_LENGTH 32
106111
#define MIN_SSID_LENGTH 1
107112
#define MAX_PASSWORD_LENGTH 64
108113
#define MIN_PASSWORD_LENGTH 8
114+
#define MAX_ADMIN_PASSWORD_LENGTH 16
115+
#define MIN_ADMIN_PASSWORD_LENGTH 1
109116
#define IP_LENGTH 4
110117
#define INTEGER_LENGTH 4
111118
#define MAX_HOSTNAME_LENGTH 32

0 commit comments

Comments
 (0)