SDK 1.5.1; makefile and html tweaks

pull/95/head
Thorsten von Eicken 9 years ago
parent 5dbebcd841
commit fa96de2fc0
  1. 24
      Makefile
  2. 32
      esp-link/cgiwifi.c
  3. 2
      html/home.html
  4. 17
      html/mqtt.html
  5. 66
      html/services.html
  6. 4
      html/style.css

@ -25,15 +25,15 @@
# The SOFTAP configuration can be hard-coded here, the minimum parameters to set are AP_SSID && AP_PASS
# The AP SSID has to be at least 8 characters long, same for AP PASSWORD
# The AP AUTH MODE can be set to:
# 0 = AUTH_OPEN,
# 1 = AUTH_WEP,
# 2 = AUTH_WPA_PSK,
# 3 = AUTH_WPA2_PSK,
# 4 = AUTH_WPA_WPA2_PSK
# 0 = AUTH_OPEN,
# 1 = AUTH_WEP,
# 2 = AUTH_WPA_PSK,
# 3 = AUTH_WPA2_PSK,
# 4 = AUTH_WPA_WPA2_PSK
# SSID hidden default 0, ( 0 | 1 )
# Max connections default 4, ( 1 ~ 4 )
# Beacon interval default 100, ( 100 ~ 60000ms )
#
# AP_SSID ?=esp_link_test
# AP_PASS ?=esp_link_test
# AP_AUTH_MODE ?=4
@ -41,10 +41,8 @@
# AP_MAX_CONN ?=4
# AP_BEACON_INTERVAL ?=100
# If CHANGE_TO_STA is set to "yes" the esp-link module will switch to station mode
# once successfully connected to an access point. Else it will stay in STA+AP mode.
CHANGE_TO_STA ?= yes
# hostname or IP address for wifi flashing
@ -58,7 +56,7 @@ XTENSA_TOOLS_ROOT ?= $(abspath ../esp-open-sdk/xtensa-lx106-elf/bin)/
# Base directory of the ESP8266 SDK package, absolute
# Typically you'll download from Espressif's BBS, http://bbs.espressif.com/viewforum.php?f=5
SDK_BASE ?= $(abspath ../esp_iot_sdk_v1.5.0)
SDK_BASE ?= $(abspath ../esp_iot_sdk_v1.5.1)
# Esptool.py path and port, only used for 1-time serial flashing
# Typically you'll use https://github.com/themadinventor/esptool
@ -387,15 +385,17 @@ flash: all
0x00000 "$(SDK_BASE)/bin/boot_v1.4(b1).bin" 0x01000 $(FW_BASE)/user1.bin \
$(ET_BLANK) $(SDK_BASE)/bin/blank.bin
ifeq ($(OS),Windows_NT)
tools/$(HTML_COMPRESSOR):
$(Q) mkdir -p tools
ifeq ($(OS),Windows_NT)
cd tools; wget --no-check-certificate https://github.com/yui/yuicompressor/releases/download/v2.4.8/$(YUI_COMPRESSOR) -O $(YUI_COMPRESSOR)
cd tools; wget --no-check-certificate https://htmlcompressor.googlecode.com/files/$(HTML_COMPRESSOR) -O $(HTML_COMPRESSOR)
else
else
tools/$(HTML_COMPRESSOR):
$(Q) mkdir -p tools
cd tools; wget https://github.com/yui/yuicompressor/releases/download/v2.4.8/$(YUI_COMPRESSOR)
cd tools; wget https://htmlcompressor.googlecode.com/files/$(HTML_COMPRESSOR)
endif
endif
ifeq ("$(COMPRESS_W_HTMLCOMPRESSOR)","yes")
$(BUILD_BASE)/espfs_img.o: tools/$(HTML_COMPRESSOR)

@ -522,8 +522,6 @@ int ICACHE_FLASH_ATTR cgiApSettingsChange(HttpdConnData *connData) {
char buff[96];
int len;
// Do we need a password or auth mode?
bool pass_need=true;
// Check extra security measure, this must be 1
len=httpdFindArg(connData->getArgs, "100", buff, sizeof(buff));
@ -540,32 +538,26 @@ int ICACHE_FLASH_ATTR cgiApSettingsChange(HttpdConnData *connData) {
os_memset(apconf.ssid, 0, 32);
os_memcpy(apconf.ssid, buff, len);
apconf.ssid_len = len;
pass_need = true; // ssid ok, look for a valid password
}else{
pass_need = false; // ssid wrong, neither pass nor auth mode are needed
jsonHeader(connData, 400);
httpdSend(connData, "SSID not valid or out of range", -1);
return HTTPD_CGI_DONE;
}
// Set new PASSWORD
if( pass_need ){
len=httpdFindArg(connData->getArgs, "ap_password", buff, sizeof(buff));
if(checkString(buff) && len>7 && len<64){
// String preprocessing done in client side, wifiap.js line 31
os_memset(apconf.password, 0, 64);
os_memcpy(apconf.password, buff, len);
pass_need = true; // pass ok, look for auth mode
}else if (len == 0){
pass_need = false; // pass wrong, don't look for auth mode
os_memset(apconf.password, 0, 64);
}else{
jsonHeader(connData, 400);
httpdSend(connData, "PASSWORD not valid or out of range", -1);
return HTTPD_CGI_DONE;
}
len=httpdFindArg(connData->getArgs, "ap_password", buff, sizeof(buff));
if(checkString(buff) && len>7 && len<64){
// String preprocessing done in client side, wifiap.js line 31
os_memset(apconf.password, 0, 64);
os_memcpy(apconf.password, buff, len);
}else if (len == 0){
os_memset(apconf.password, 0, 64);
}else{
jsonHeader(connData, 400);
httpdSend(connData, "PASSWORD not valid or out of range", -1);
return HTTPD_CGI_DONE;
}
// Set auth mode
if(pass_need){
if(len != 0){
// Set authentication mode, before password to check open settings
len=httpdFindArg(connData->getArgs, "ap_authmode", buff, sizeof(buff));
if(len>0){

@ -126,7 +126,7 @@
<tr><td>Current partition</td><td class="system-partition"></td></tr>
<tr><td colspan=2 class="popup-target">Description:<br>
<div class="click-to-edit system-description">
<div class="edit-off"></div>
<span class="edit-off" style="display:block; width:auto;"></span>
<textarea class="edit-on" rows=3 maxlength=127 hidden> </textarea>
<div class="popup">Click to edit!<br>A short description or memo for this esp-link
module, 128 chars max</div>

@ -28,11 +28,14 @@
<div id="mqtt-spinner" class="spinner spinner-small"></div>
</h1>
<form action="#" id="mqtt-form" class="pure-form" hidden>
<input type="checkbox" name="mqtt-enable"/>
<label>Enable MQTT client</label>
<br>
<label>MQTT client state: </label>
<b id="mqtt-state"></b>
<div>
<input type="checkbox" name="mqtt-enable"/>
<label>Enable MQTT client</label>
</div>
<div>
<label>MQTT client state: </label>
<b id="mqtt-state"></b>
</div>
<br>
<legend>MQTT server settings</legend>
<div class="pure-form-stacked">
@ -68,11 +71,11 @@
<label>Enable status reporting via MQTT</label>
</div>
<br>
<legend>Status reporting settings</legend>
<div class="pure-form-stacked">
<label>Topic</label>
<label>Status topic</label>
<input type="text" name="mqtt-status-topic"/>
Message: <tt id="mqtt-status-value"></tt>
<div class="popup">MQTT topic to which status message is sent</div>
</div>
<button id="mqtt-status-button" type="submit" class="pure-button button-primary">
Update status settings!

@ -12,35 +12,41 @@
<div id="syslog-spinner" class="spinner spinner-small"></div>
</h1>
<form action="#" id="Syslog-form" class="pure-form" hidden>
<legend>Syslog settings</legend>
<div class="pure-form-stacked">
<label>Syslog Host</label>
<input type="text" name="syslog_host" />
<div class="popup">Use server [hostname:port] as UDP Syslog server</div>
<div class="popup">Esp-link sends event/debug info to this syslog host
(hostname:port). Leave empty to disable syslog.</div>
</div>
<div class="pure-form-stacked">
<label>Min Heap</label>
<input type="text" name="syslog_minheap" />
<label>Filter</label>
<select name="syslog_filter" href="#">
<option value="0">EMERG</option>
<option value="1">ALERT</option>
<option value="2">CRIT</option>
<option value="3">ERR</option>
<option value="4">WARNING</option>
<option value="5">NOTICE</option>
<option value="6">INFO</option>
<option value="7">DEBUG</option>
</select>
<div>
<input type="text" name="syslog_minheap" />
<div class="popup">Stop sending syslog if free heap drops below this many bytes</div>
</div>
<div>
<label>Filter</label>
<select name="syslog_filter" href="#">
<option value="0">EMERG</option>
<option value="1">ALERT</option>
<option value="2">CRIT</option>
<option value="3">ERR</option>
<option value="4">WARNING</option>
<option value="5">NOTICE</option>
<option value="6">INFO</option>
<option value="7">DEBUG</option>
</select>
<div class="popup">Minimum severity to send</div>
</div>
</div>
<div class="form-horizontal">
<label>Show ESP &#xb5;C Ticker in log message</label>
<div>
<input type="checkbox" name="syslog_showtick" />
<label>Include esp-link millisecond ticker</label>
</div>
<div class="form-horizontal">
<label>Show date in log message</label>
<div>
<input type="checkbox" name="syslog_showdate" />
<div class="popup">Synology does a log rotate if timestamp is in the past so disable to prevent this</div>
<label>Include esp-link datetime</label>
<div class="popup">Some syslog servers rotate log if timestamp is in the past so disable to prevent this</div>
</div>
<button id="Syslog-button" type="submit" class="pure-button button-primary">
Update Syslog settings!
@ -56,12 +62,14 @@
<div class="form-horizontal">
<input type="checkbox" name="mdns_enable"/>
<label>Enable mDNS</label>
<div class="popup">Esp-link can advertise its hostname and service name (both
with a .local suffix) via multicast DNS.</div>
</div>
<br>
<legend>mDNS server settings</legend>
<div class="pure-form-stacked">
<label>Server Name</label>
<label>Service Name</label>
<input type="text" name="mdns_servername"/>
<div class="popup">The default service is http. For the arduino IDE use arduino</div>
</div>
<button id="mDNS-button" type="submit" class="pure-button button-primary">
Update mDNS settings!
@ -76,12 +84,18 @@
<div id="sntp-spinner" class="spinner spinner-small"></div>
</h1>
<form action="#" id="SNTP-form" class="pure-form" hidden>
<legend>SNTP server settings</legend>
<div class="pure-form-stacked">
<label>Timezone Offset</label>
<input type="text" name="timezone_offset" />
<label>SNTP Server</label>
<input type="text" name="sntp_server" />
<div>
<label>SNTP Server</label>
<input type="text" name="sntp_server" />
<div class="popup">Simple Network Time Protocol server to query.
Leave empty to disable SNTP</div>
</div>
<div>
<label>Timezone Offset</label>
<input type="text" name="timezone_offset" />
<div class="popup">Offset hours to apply (no daylight savings support)</div>
</div>
</div>
<button id="SNTP-button" type="submit" class="pure-button button-primary">
Update SNTP settings!

@ -85,10 +85,10 @@ a:hover {
.popup, div.popup {
position: absolute;
/*top: 100%;*/
bottom: 100%;
bottom: 125%;
background-color: #fff0b3;
border-radius: 5px;
border: 0px solid #000;
border: 1px solid #e6b800;
color: #333;
font-size: 80%;
line-height: 110%;

Loading…
Cancel
Save