SDK 1.5.1; makefile and html tweaks

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

@ -33,7 +33,7 @@
# SSID hidden default 0, ( 0 | 1 ) # SSID hidden default 0, ( 0 | 1 )
# Max connections default 4, ( 1 ~ 4 ) # Max connections default 4, ( 1 ~ 4 )
# Beacon interval default 100, ( 100 ~ 60000ms ) # Beacon interval default 100, ( 100 ~ 60000ms )
#
# AP_SSID ?=esp_link_test # AP_SSID ?=esp_link_test
# AP_PASS ?=esp_link_test # AP_PASS ?=esp_link_test
# AP_AUTH_MODE ?=4 # AP_AUTH_MODE ?=4
@ -41,10 +41,8 @@
# AP_MAX_CONN ?=4 # AP_MAX_CONN ?=4
# AP_BEACON_INTERVAL ?=100 # AP_BEACON_INTERVAL ?=100
# If CHANGE_TO_STA is set to "yes" the esp-link module will switch to station mode # 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. # once successfully connected to an access point. Else it will stay in STA+AP mode.
CHANGE_TO_STA ?= yes CHANGE_TO_STA ?= yes
# hostname or IP address for wifi flashing # 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 # Base directory of the ESP8266 SDK package, absolute
# Typically you'll download from Espressif's BBS, http://bbs.espressif.com/viewforum.php?f=5 # 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 # Esptool.py path and port, only used for 1-time serial flashing
# Typically you'll use https://github.com/themadinventor/esptool # 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 \ 0x00000 "$(SDK_BASE)/bin/boot_v1.4(b1).bin" 0x01000 $(FW_BASE)/user1.bin \
$(ET_BLANK) $(SDK_BASE)/bin/blank.bin $(ET_BLANK) $(SDK_BASE)/bin/blank.bin
ifeq ($(OS),Windows_NT)
tools/$(HTML_COMPRESSOR): tools/$(HTML_COMPRESSOR):
$(Q) mkdir -p tools $(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://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) 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://github.com/yui/yuicompressor/releases/download/v2.4.8/$(YUI_COMPRESSOR)
cd tools; wget https://htmlcompressor.googlecode.com/files/$(HTML_COMPRESSOR) cd tools; wget https://htmlcompressor.googlecode.com/files/$(HTML_COMPRESSOR)
endif endif
ifeq ("$(COMPRESS_W_HTMLCOMPRESSOR)","yes") ifeq ("$(COMPRESS_W_HTMLCOMPRESSOR)","yes")
$(BUILD_BASE)/espfs_img.o: tools/$(HTML_COMPRESSOR) $(BUILD_BASE)/espfs_img.o: tools/$(HTML_COMPRESSOR)

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

@ -126,7 +126,7 @@
<tr><td>Current partition</td><td class="system-partition"></td></tr> <tr><td>Current partition</td><td class="system-partition"></td></tr>
<tr><td colspan=2 class="popup-target">Description:<br> <tr><td colspan=2 class="popup-target">Description:<br>
<div class="click-to-edit system-description"> <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> <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 <div class="popup">Click to edit!<br>A short description or memo for this esp-link
module, 128 chars max</div> module, 128 chars max</div>

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

@ -12,15 +12,19 @@
<div id="syslog-spinner" class="spinner spinner-small"></div> <div id="syslog-spinner" class="spinner spinner-small"></div>
</h1> </h1>
<form action="#" id="Syslog-form" class="pure-form" hidden> <form action="#" id="Syslog-form" class="pure-form" hidden>
<legend>Syslog settings</legend>
<div class="pure-form-stacked"> <div class="pure-form-stacked">
<label>Syslog Host</label> <label>Syslog Host</label>
<input type="text" name="syslog_host" /> <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>
<div class="pure-form-stacked"> <div class="pure-form-stacked">
<label>Min Heap</label> <label>Min Heap</label>
<div>
<input type="text" name="syslog_minheap" /> <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> <label>Filter</label>
<select name="syslog_filter" href="#"> <select name="syslog_filter" href="#">
<option value="0">EMERG</option> <option value="0">EMERG</option>
@ -32,15 +36,17 @@
<option value="6">INFO</option> <option value="6">INFO</option>
<option value="7">DEBUG</option> <option value="7">DEBUG</option>
</select> </select>
<div class="popup">Minimum severity to send</div>
</div> </div>
<div class="form-horizontal"> </div>
<label>Show ESP &#xb5;C Ticker in log message</label> <div>
<input type="checkbox" name="syslog_showtick" /> <input type="checkbox" name="syslog_showtick" />
<label>Include esp-link millisecond ticker</label>
</div> </div>
<div class="form-horizontal"> <div>
<label>Show date in log message</label>
<input type="checkbox" name="syslog_showdate" /> <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> </div>
<button id="Syslog-button" type="submit" class="pure-button button-primary"> <button id="Syslog-button" type="submit" class="pure-button button-primary">
Update Syslog settings! Update Syslog settings!
@ -56,12 +62,14 @@
<div class="form-horizontal"> <div class="form-horizontal">
<input type="checkbox" name="mdns_enable"/> <input type="checkbox" name="mdns_enable"/>
<label>Enable mDNS</label> <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> </div>
<br> <br>
<legend>mDNS server settings</legend>
<div class="pure-form-stacked"> <div class="pure-form-stacked">
<label>Server Name</label> <label>Service Name</label>
<input type="text" name="mdns_servername"/> <input type="text" name="mdns_servername"/>
<div class="popup">The default service is http. For the arduino IDE use arduino</div>
</div> </div>
<button id="mDNS-button" type="submit" class="pure-button button-primary"> <button id="mDNS-button" type="submit" class="pure-button button-primary">
Update mDNS settings! Update mDNS settings!
@ -76,12 +84,18 @@
<div id="sntp-spinner" class="spinner spinner-small"></div> <div id="sntp-spinner" class="spinner spinner-small"></div>
</h1> </h1>
<form action="#" id="SNTP-form" class="pure-form" hidden> <form action="#" id="SNTP-form" class="pure-form" hidden>
<legend>SNTP server settings</legend>
<div class="pure-form-stacked"> <div class="pure-form-stacked">
<label>Timezone Offset</label> <div>
<input type="text" name="timezone_offset" />
<label>SNTP Server</label> <label>SNTP Server</label>
<input type="text" name="sntp_server" /> <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> </div>
<button id="SNTP-button" type="submit" class="pure-button button-primary"> <button id="SNTP-button" type="submit" class="pure-button button-primary">
Update SNTP settings! Update SNTP settings!

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

Loading…
Cancel
Save