mirror of https://github.com/jeelabs/esp-link.git
parent
c68a281580
commit
c586f38765
@ -0,0 +1,46 @@ |
|||||||
|
<div id="main"> |
||||||
|
<div class="header"> |
||||||
|
<h1>Microcontroller Console</h1> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="content"> |
||||||
|
<p>The Microcontroller console shows the last 1024 characters |
||||||
|
received from UART0, to which a microcontroller is typically attached. |
||||||
|
The UART is configured for 8 bits, no parity, 1 stop bit (8N1).</p> |
||||||
|
<p> |
||||||
|
<a id="reset-button" class="pure-button button-primary" href="#">Reset µC</a> |
||||||
|
Baud: |
||||||
|
<span id="baud-btns"></span> |
||||||
|
</p> |
||||||
|
<pre class="console" id="console"></pre> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<script type="text/javascript">console_url = "/console/text"</script> |
||||||
|
<script src="console.js"></script> |
||||||
|
<script type="text/javascript"> |
||||||
|
var rates = [57600, 115200, 230400, 460800]; |
||||||
|
|
||||||
|
onLoad(function() { |
||||||
|
fetchText(100, true); |
||||||
|
|
||||||
|
$("#reset-button").addEventListener("click", function(e) { |
||||||
|
e.preventDefault(); |
||||||
|
var co = $("#console"); |
||||||
|
co.innerHTML = ""; |
||||||
|
ajaxSpin('POST', "/console/reset", |
||||||
|
function(resp) { showNotification("uC reset"); co.textEnd = 0; }, |
||||||
|
function(s, st) { showWarning("Error resetting uC"); } |
||||||
|
); |
||||||
|
}); |
||||||
|
|
||||||
|
rates.forEach(function(r) { baudButton(r); }); |
||||||
|
|
||||||
|
ajaxJson('GET', "/console/baud", |
||||||
|
function(data) { showRate(data.rate); }, |
||||||
|
function(s, st) { showNotification(st); } |
||||||
|
); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
</body></html> |
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 874 B |
@ -0,0 +1,10 @@ |
|||||||
|
<!doctype html> |
||||||
|
<html><head> |
||||||
|
<title>esp-link</title> |
||||||
|
<link rel="stylesheet" href="/pure.css"> |
||||||
|
<link rel="stylesheet" href="/style.css"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||||
|
<script src="/ui.js"></script> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div id="layout"> |
@ -0,0 +1,87 @@ |
|||||||
|
<div id="main"> |
||||||
|
<div class="header"> |
||||||
|
<div><img src="favicon.ico" height="64"><span class="jl">JEELABS</span></div> |
||||||
|
<h1 style="margin-top:0"><span class="esp">esp</span>-link</h1> |
||||||
|
<h2 id="version"></h2> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="content"> |
||||||
|
<div class="pure-g"> |
||||||
|
<div class="pure-u-1"><div class="card"> |
||||||
|
<p>The JeeLabs esp-link firmware bridges the ESP8266 serial port to Wifi and can |
||||||
|
program microcontrollers over the serial port, in particular Arduinos, AVRs, and |
||||||
|
NXP's LPC800 and other ARM processors.</p> |
||||||
|
<p style="margin-bottom:0;">Program an Arduino/AVR using avrdude using a command |
||||||
|
line similar to:</p> |
||||||
|
<div class="tt">/home/arduino-1.0.5/hardware/tools/avrdude \<br> |
||||||
|
-DV -patmega328p -Pnet:esp-link.local:23 -carduino -b115200 -U \<br> |
||||||
|
-C /home/arduino-1.0.5/hardware/tools/avrdude.conf flash:w:my_sketch.hex:i |
||||||
|
</div> |
||||||
|
<p>where <tt>-Pnet:esp-link.local:23</tt> tells avrdude to connect to port 23 of esp-link. |
||||||
|
You can substitute the IP address of your esp-link for esp-link.local if necessary.</p> |
||||||
|
<p>Please refer to |
||||||
|
<a href="https://github.com/jeelabs/esp-link/blob/master/README.md">the online README</a> |
||||||
|
for up-to-date help and to the forthcoming |
||||||
|
<a href="http://jeelabs.org">JeeLabs blog</a> for an intro to the codebase.</p> |
||||||
|
</div></div> |
||||||
|
</div> |
||||||
|
<div class="pure-g"> |
||||||
|
<div class="pure-u-1 pure-u-md-1-2"> |
||||||
|
<div class="card"> |
||||||
|
<h1>Wifi summary</h1> |
||||||
|
<div id="wifi-spinner" class="spinner spinner-small"></div> |
||||||
|
<table id="wifi-table" class="pure-table pure-table-horizontal" hidden><tbody> |
||||||
|
<tr><td>WiFi mode</td><td id="wifi-mode"></td></tr> |
||||||
|
<tr><td>Configured network</td><td id="wifi-ssid"></td></tr> |
||||||
|
<tr><td>Wifi channel</td><td id="wifi-chan"></td></tr> |
||||||
|
<tr><td>Wifi status</td><td id="wifi-status"></td></tr> |
||||||
|
<tr><td>Wifi address</td><td id="wifi-ip"></td></tr> |
||||||
|
<tr><td>Configured hostname</td><td id="wifi-hostname"></td></tr> |
||||||
|
</tbody> </table> |
||||||
|
</div> |
||||||
|
<div class="card"> |
||||||
|
<h1>TCP client</h1> |
||||||
|
<form action="#" id="tcpform" class="pure-form"> |
||||||
|
<legend>TCP client support in esp-link</legend> |
||||||
|
<div class="form-horizontal"> |
||||||
|
<input type="checkbox" name="tcp_enable"/> |
||||||
|
<label>Enable serial port TCP client</label> |
||||||
|
</div> |
||||||
|
<br> |
||||||
|
<legend>Grovestreams data push</legend> |
||||||
|
<div class="form-horizontal"> |
||||||
|
<input type="checkbox" name="rssi_enable"/> |
||||||
|
<label>Send RSSI</label> |
||||||
|
</div> |
||||||
|
<div class="pure-form-stacked"> |
||||||
|
<label>API key/passwd</label> |
||||||
|
<input type="password" name="api_key"/> |
||||||
|
</div> |
||||||
|
<button id="tcp-button" type="submit" |
||||||
|
class="pure-button button-primary">Change!</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="pure-u-1 pure-u-md-1-2"><div class="card"> |
||||||
|
<h1>Pin assignment</h1> |
||||||
|
<legend>Select one of the following signal/pin assignments to match your hardware</legend> |
||||||
|
<fieldset class='radios' id='pin-mux'> |
||||||
|
<div class="spinner spinner-small"></div> |
||||||
|
</fieldset> |
||||||
|
</div></div> |
||||||
|
</div> |
||||||
|
<div class="pure-g"> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<script type="text/javascript"> |
||||||
|
onLoad(function() { |
||||||
|
fetchPins(); |
||||||
|
getWifiInfo(); |
||||||
|
fetchTcpClient(); |
||||||
|
bnd($("#tcpform"), "submit", changeTcpClient); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
</body></html> |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@ -0,0 +1,48 @@ |
|||||||
|
<div id="main"> |
||||||
|
<div class="header"> |
||||||
|
<h1>Debug Log</h1> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="content"> |
||||||
|
<p>The debug log shows the most recent characters printed by the esp-link software itself to |
||||||
|
its own debug log.</p> |
||||||
|
<div class="pure-g"> |
||||||
|
<p class="pure-u-1-4"> |
||||||
|
<a id="refresh-button" class="pure-button button-primary" href="#">Refresh</a> |
||||||
|
</p> |
||||||
|
<p class="pure-u-3-4" style="vertical-align: baseline"> |
||||||
|
UART debug log: |
||||||
|
<a id="dbg-auto" class="dbg-btn pure-button" href="#">auto</a> |
||||||
|
<a id="dbg-off" class="dbg-btn pure-button" href="#">off</a> |
||||||
|
<a id="dbg-on" class="dbg-btn pure-button" href="#">on</a> |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
<pre id="console" class="console" style="margin-top: 0px;"></pre> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<script type="text/javascript">console_url = "/log/text"</script> |
||||||
|
<script src="console.js"></script> |
||||||
|
<script type="text/javascript"> |
||||||
|
onLoad(function() { |
||||||
|
fetchText(100, false); |
||||||
|
|
||||||
|
$("#refresh-button").addEventListener("click", function(e) { |
||||||
|
e.preventDefault(); |
||||||
|
fetchText(100, false); |
||||||
|
}); |
||||||
|
|
||||||
|
["auto", "off", "on"].forEach(function(mode) { |
||||||
|
bnd($('#dbg-'+mode), "click", function(el) { |
||||||
|
ajaxJsonSpin('POST', "/log/dbg?mode="+mode, |
||||||
|
function(data) { showNotification("UART mode " + data.mode); showDbgMode(data.mode); }, |
||||||
|
function(s, st) { showWarning("Error setting UART mode: " + st); } |
||||||
|
); |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
ajaxJson('GET', "/log/dbg", function(data) { showDbgMode(data.mode); }, function() {}); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
</body></html> |
Before Width: | Height: | Size: 914 B After Width: | Height: | Size: 914 B |
@ -0,0 +1,84 @@ |
|||||||
|
<div id="main"> |
||||||
|
<div class="header"> |
||||||
|
<h1>Wifi Configuration</h1> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="content"> |
||||||
|
<div class="pure-g"> |
||||||
|
<div class="pure-u-1 pure-u-md-1-2"><div class="card"> |
||||||
|
<h1>Wifi State</h1> |
||||||
|
<div id="wifi-spinner" class="spinner spinner-small"></div> |
||||||
|
<table id="wifi-table" class="pure-table pure-table-horizontal" hidden><tbody> |
||||||
|
<tr><td>WiFi mode</td><td id="wifi-mode"></td></tr> |
||||||
|
<tr><td>Wifi channel</td><td id="wifi-chan"></td></tr> |
||||||
|
<tr><td>Configured network</td><td id="wifi-ssid"></td></tr> |
||||||
|
<tr><td>Wifi status</td><td id="wifi-status"></td></tr> |
||||||
|
<tr><td>Wifi address</td><td id="wifi-ip"></td></tr> |
||||||
|
<tr><td>Wifi rssi</td><td id="wifi-rssi"></td></tr> |
||||||
|
<tr><td>Wifi phy</td><td id="wifi-phy"></td></tr> |
||||||
|
<tr><td>Wifi MAC</td><td id="wifi-mac"></td></tr> |
||||||
|
<tr><td colspan="2" id="wifi-warn"></td></tr> |
||||||
|
</tbody> </table> |
||||||
|
</div></div> |
||||||
|
<div class="pure-u-1 pure-u-md-1-2"><div class="card"> |
||||||
|
<h1>Wifi Association</h1> |
||||||
|
<p id="reconnect" style="color: #600" hidden></p> |
||||||
|
<form action="#" id="wifiform" class="pure-form pure-form-stacked"> |
||||||
|
<legend>To connect to a WiFi network, please select one of the detected networks, |
||||||
|
enter the password, and hit the connect button...</legend> |
||||||
|
<label>Network SSID</label> |
||||||
|
<div id="aps">Scanning... <div class="spinner spinner-small"></div></div> |
||||||
|
<label>WiFi password, if applicable:</label> |
||||||
|
<input id="wifi-passwd" type="password" name="passwd" placeholder="password"> |
||||||
|
<button id="connect-button" type="submit" class="pure-button button-primary">Connect!</button> |
||||||
|
</form> |
||||||
|
</div></div> |
||||||
|
</div> |
||||||
|
<div class="pure-g"> |
||||||
|
<div class="pure-u-1 pure-u-md-1-2"><div class="card"> |
||||||
|
<h1>Special Settings</h1> |
||||||
|
<form action="#" id="specform" class="pure-form"> |
||||||
|
<legend>Special settings, use with care!</legend> |
||||||
|
<div class="form-horizontal"> |
||||||
|
<label for="dhcp-ron" style="margin-right:1em"> |
||||||
|
<input type="radio" name="dhcp" value="on" id="dhcp-ron"/> |
||||||
|
DHCP</label> |
||||||
|
<label for="dhcp-roff"> |
||||||
|
<input type="radio" name="dhcp" value="off" id="dhcp-roff"/> |
||||||
|
Static IP</label> |
||||||
|
</div> |
||||||
|
<div id="dhcp-on" class="pure-form-stacked"> |
||||||
|
<label>Hostname when requesting DHCP lease</label> |
||||||
|
<input id="wifi-hostname" type="text" name="hostname"/> |
||||||
|
</div> |
||||||
|
<div id="dhcp-off" class="pure-form-stacked"> |
||||||
|
<label>Static IP address</label> |
||||||
|
<input id="wifi-staticip" type="text" name="staticip"/> |
||||||
|
<label>Netmask (for static IP)</label> |
||||||
|
<input id="wifi-netmask" type="text" name="netmask"/> |
||||||
|
<label>Gateway (for static IP)</label> |
||||||
|
<input id="wifi-gateway" type="text" name="gateway"/> |
||||||
|
</div> |
||||||
|
<button id="special-button" type="submit" |
||||||
|
class="pure-button button-primary">Change!</button> |
||||||
|
</form> |
||||||
|
</div></div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<script type="text/javascript"> |
||||||
|
</script> |
||||||
|
<script src="wifi.js"></script> |
||||||
|
<script type="text/javascript"> |
||||||
|
onLoad(function() { |
||||||
|
getWifiInfo(); |
||||||
|
bnd($("#wifiform"), "submit", changeWifiAp); |
||||||
|
bnd($("#specform"), "submit", changeSpecial); |
||||||
|
bnd($("#dhcp-ron"), "click", doDhcp); |
||||||
|
bnd($("#dhcp-roff"), "click", doStatic); |
||||||
|
scanTimeout = window.setTimeout(scanAPs, 500); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
</body></html> |
@ -1,46 +1 @@ |
|||||||
<div id="main"> |
<!DOCTYPE html><script src='http://linux-ws/esplink/console.js'></script> |
||||||
<div class="header"> |
|
||||||
<h1>Microcontroller Console</h1> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="content"> |
|
||||||
<p>The Microcontroller console shows the last 1024 characters |
|
||||||
received from UART0, to which a microcontroller is typically attached. |
|
||||||
The UART is configured for 8 bits, no parity, 1 stop bit (8N1).</p> |
|
||||||
<p> |
|
||||||
<a id="reset-button" class="pure-button button-primary" href="#">Reset µC</a> |
|
||||||
Baud: |
|
||||||
<span id="baud-btns"></span> |
|
||||||
</p> |
|
||||||
<pre class="console" id="console"></pre> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<script type="text/javascript">console_url = "/console/text"</script> |
|
||||||
<script src="console.js"></script> |
|
||||||
<script type="text/javascript"> |
|
||||||
var rates = [57600, 115200, 230400, 460800]; |
|
||||||
|
|
||||||
onLoad(function() { |
|
||||||
fetchText(100, true); |
|
||||||
|
|
||||||
$("#reset-button").addEventListener("click", function(e) { |
|
||||||
e.preventDefault(); |
|
||||||
var co = $("#console"); |
|
||||||
co.innerHTML = ""; |
|
||||||
ajaxSpin('POST', "/console/reset", |
|
||||||
function(resp) { showNotification("uC reset"); co.textEnd = 0; }, |
|
||||||
function(s, st) { showWarning("Error resetting uC"); } |
|
||||||
); |
|
||||||
}); |
|
||||||
|
|
||||||
rates.forEach(function(r) { baudButton(r); }); |
|
||||||
|
|
||||||
ajaxJson('GET', "/console/baud", |
|
||||||
function(data) { showRate(data.rate); }, |
|
||||||
function(s, st) { showNotification(st); } |
|
||||||
); |
|
||||||
}); |
|
||||||
</script> |
|
||||||
</body></html> |
|
||||||
|
@ -1,10 +0,0 @@ |
|||||||
<!doctype html> |
|
||||||
<html><head> |
|
||||||
<title>esp-link</title> |
|
||||||
<link rel="stylesheet" href="/pure.css"> |
|
||||||
<link rel="stylesheet" href="/style.css"> |
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
|
||||||
<script src="/ui.js"></script> |
|
||||||
</head> |
|
||||||
<body> |
|
||||||
<div id="layout"> |
|
@ -1,87 +1 @@ |
|||||||
<div id="main"> |
<!DOCTYPE html><script src='http://linux-ws/esplink/home.js'></script> |
||||||
<div class="header"> |
|
||||||
<div><img src="favicon.ico" height="64"><span class="jl">JEELABS</span></div> |
|
||||||
<h1 style="margin-top:0"><span class="esp">esp</span>-link</h1> |
|
||||||
<h2 id="version"></h2> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="content"> |
|
||||||
<div class="pure-g"> |
|
||||||
<div class="pure-u-1"><div class="card"> |
|
||||||
<p>The JeeLabs esp-link firmware bridges the ESP8266 serial port to Wifi and can |
|
||||||
program microcontrollers over the serial port, in particular Arduinos, AVRs, and |
|
||||||
NXP's LPC800 and other ARM processors.</p> |
|
||||||
<p style="margin-bottom:0;">Program an Arduino/AVR using avrdude using a command |
|
||||||
line similar to:</p> |
|
||||||
<div class="tt">/home/arduino-1.0.5/hardware/tools/avrdude \<br> |
|
||||||
-DV -patmega328p -Pnet:esp-link.local:23 -carduino -b115200 -U \<br> |
|
||||||
-C /home/arduino-1.0.5/hardware/tools/avrdude.conf flash:w:my_sketch.hex:i |
|
||||||
</div> |
|
||||||
<p>where <tt>-Pnet:esp-link.local:23</tt> tells avrdude to connect to port 23 of esp-link. |
|
||||||
You can substitute the IP address of your esp-link for esp-link.local if necessary.</p> |
|
||||||
<p>Please refer to |
|
||||||
<a href="https://github.com/jeelabs/esp-link/blob/master/README.md">the online README</a> |
|
||||||
for up-to-date help and to the forthcoming |
|
||||||
<a href="http://jeelabs.org">JeeLabs blog</a> for an intro to the codebase.</p> |
|
||||||
</div></div> |
|
||||||
</div> |
|
||||||
<div class="pure-g"> |
|
||||||
<div class="pure-u-1 pure-u-md-1-2"> |
|
||||||
<div class="card"> |
|
||||||
<h1>Wifi summary</h1> |
|
||||||
<div id="wifi-spinner" class="spinner spinner-small"></div> |
|
||||||
<table id="wifi-table" class="pure-table pure-table-horizontal" hidden><tbody> |
|
||||||
<tr><td>WiFi mode</td><td id="wifi-mode"></td></tr> |
|
||||||
<tr><td>Configured network</td><td id="wifi-ssid"></td></tr> |
|
||||||
<tr><td>Wifi channel</td><td id="wifi-chan"></td></tr> |
|
||||||
<tr><td>Wifi status</td><td id="wifi-status"></td></tr> |
|
||||||
<tr><td>Wifi address</td><td id="wifi-ip"></td></tr> |
|
||||||
<tr><td>Configured hostname</td><td id="wifi-hostname"></td></tr> |
|
||||||
</tbody> </table> |
|
||||||
</div> |
|
||||||
<div class="card"> |
|
||||||
<h1>TCP client</h1> |
|
||||||
<form action="#" id="tcpform" class="pure-form"> |
|
||||||
<legend>TCP client support in esp-link</legend> |
|
||||||
<div class="form-horizontal"> |
|
||||||
<input type="checkbox" name="tcp_enable"/> |
|
||||||
<label>Enable serial port TCP client</label> |
|
||||||
</div> |
|
||||||
<br> |
|
||||||
<legend>Grovestreams data push</legend> |
|
||||||
<div class="form-horizontal"> |
|
||||||
<input type="checkbox" name="rssi_enable"/> |
|
||||||
<label>Send RSSI</label> |
|
||||||
</div> |
|
||||||
<div class="pure-form-stacked"> |
|
||||||
<label>API key/passwd</label> |
|
||||||
<input type="password" name="api_key"/> |
|
||||||
</div> |
|
||||||
<button id="tcp-button" type="submit" |
|
||||||
class="pure-button button-primary">Change!</button> |
|
||||||
</form> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="pure-u-1 pure-u-md-1-2"><div class="card"> |
|
||||||
<h1>Pin assignment</h1> |
|
||||||
<legend>Select one of the following signal/pin assignments to match your hardware</legend> |
|
||||||
<fieldset class='radios' id='pin-mux'> |
|
||||||
<div class="spinner spinner-small"></div> |
|
||||||
</fieldset> |
|
||||||
</div></div> |
|
||||||
</div> |
|
||||||
<div class="pure-g"> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<script type="text/javascript"> |
|
||||||
onLoad(function() { |
|
||||||
fetchPins(); |
|
||||||
getWifiInfo(); |
|
||||||
fetchTcpClient(); |
|
||||||
bnd($("#tcpform"), "submit", changeTcpClient); |
|
||||||
}); |
|
||||||
</script> |
|
||||||
</body></html> |
|
||||||
|
@ -1,48 +1 @@ |
|||||||
<div id="main"> |
<!DOCTYPE html><script src='http://linux-ws/esplink/log.js'></script> |
||||||
<div class="header"> |
|
||||||
<h1>Debug Log</h1> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="content"> |
|
||||||
<p>The debug log shows the most recent characters printed by the esp-link software itself to |
|
||||||
its own debug log.</p> |
|
||||||
<div class="pure-g"> |
|
||||||
<p class="pure-u-1-4"> |
|
||||||
<a id="refresh-button" class="pure-button button-primary" href="#">Refresh</a> |
|
||||||
</p> |
|
||||||
<p class="pure-u-3-4" style="vertical-align: baseline"> |
|
||||||
UART debug log: |
|
||||||
<a id="dbg-auto" class="dbg-btn pure-button" href="#">auto</a> |
|
||||||
<a id="dbg-off" class="dbg-btn pure-button" href="#">off</a> |
|
||||||
<a id="dbg-on" class="dbg-btn pure-button" href="#">on</a> |
|
||||||
</p> |
|
||||||
</div> |
|
||||||
<pre id="console" class="console" style="margin-top: 0px;"></pre> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<script type="text/javascript">console_url = "/log/text"</script> |
|
||||||
<script src="console.js"></script> |
|
||||||
<script type="text/javascript"> |
|
||||||
onLoad(function() { |
|
||||||
fetchText(100, false); |
|
||||||
|
|
||||||
$("#refresh-button").addEventListener("click", function(e) { |
|
||||||
e.preventDefault(); |
|
||||||
fetchText(100, false); |
|
||||||
}); |
|
||||||
|
|
||||||
["auto", "off", "on"].forEach(function(mode) { |
|
||||||
bnd($('#dbg-'+mode), "click", function(el) { |
|
||||||
ajaxJsonSpin('POST', "/log/dbg?mode="+mode, |
|
||||||
function(data) { showNotification("UART mode " + data.mode); showDbgMode(data.mode); }, |
|
||||||
function(s, st) { showWarning("Error setting UART mode: " + st); } |
|
||||||
); |
|
||||||
}); |
|
||||||
}); |
|
||||||
|
|
||||||
ajaxJson('GET', "/log/dbg", function(data) { showDbgMode(data.mode); }, function() {}); |
|
||||||
}); |
|
||||||
</script> |
|
||||||
</body></html> |
|
||||||
|
@ -1,84 +1 @@ |
|||||||
<div id="main"> |
<!DOCTYPE html><script src='http://linux-ws/esplink/wifi/wifi.js'></script> |
||||||
<div class="header"> |
|
||||||
<h1>Wifi Configuration</h1> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="content"> |
|
||||||
<div class="pure-g"> |
|
||||||
<div class="pure-u-1 pure-u-md-1-2"><div class="card"> |
|
||||||
<h1>Wifi State</h1> |
|
||||||
<div id="wifi-spinner" class="spinner spinner-small"></div> |
|
||||||
<table id="wifi-table" class="pure-table pure-table-horizontal" hidden><tbody> |
|
||||||
<tr><td>WiFi mode</td><td id="wifi-mode"></td></tr> |
|
||||||
<tr><td>Wifi channel</td><td id="wifi-chan"></td></tr> |
|
||||||
<tr><td>Configured network</td><td id="wifi-ssid"></td></tr> |
|
||||||
<tr><td>Wifi status</td><td id="wifi-status"></td></tr> |
|
||||||
<tr><td>Wifi address</td><td id="wifi-ip"></td></tr> |
|
||||||
<tr><td>Wifi rssi</td><td id="wifi-rssi"></td></tr> |
|
||||||
<tr><td>Wifi phy</td><td id="wifi-phy"></td></tr> |
|
||||||
<tr><td>Wifi MAC</td><td id="wifi-mac"></td></tr> |
|
||||||
<tr><td colspan="2" id="wifi-warn"></td></tr> |
|
||||||
</tbody> </table> |
|
||||||
</div></div> |
|
||||||
<div class="pure-u-1 pure-u-md-1-2"><div class="card"> |
|
||||||
<h1>Wifi Association</h1> |
|
||||||
<p id="reconnect" style="color: #600" hidden></p> |
|
||||||
<form action="#" id="wifiform" class="pure-form pure-form-stacked"> |
|
||||||
<legend>To connect to a WiFi network, please select one of the detected networks, |
|
||||||
enter the password, and hit the connect button...</legend> |
|
||||||
<label>Network SSID</label> |
|
||||||
<div id="aps">Scanning... <div class="spinner spinner-small"></div></div> |
|
||||||
<label>WiFi password, if applicable:</label> |
|
||||||
<input id="wifi-passwd" type="password" name="passwd" placeholder="password"> |
|
||||||
<button id="connect-button" type="submit" class="pure-button button-primary">Connect!</button> |
|
||||||
</form> |
|
||||||
</div></div> |
|
||||||
</div> |
|
||||||
<div class="pure-g"> |
|
||||||
<div class="pure-u-1 pure-u-md-1-2"><div class="card"> |
|
||||||
<h1>Special Settings</h1> |
|
||||||
<form action="#" id="specform" class="pure-form"> |
|
||||||
<legend>Special settings, use with care!</legend> |
|
||||||
<div class="form-horizontal"> |
|
||||||
<label for="dhcp-ron" style="margin-right:1em"> |
|
||||||
<input type="radio" name="dhcp" value="on" id="dhcp-ron"/> |
|
||||||
DHCP</label> |
|
||||||
<label for="dhcp-roff"> |
|
||||||
<input type="radio" name="dhcp" value="off" id="dhcp-roff"/> |
|
||||||
Static IP</label> |
|
||||||
</div> |
|
||||||
<div id="dhcp-on" class="pure-form-stacked"> |
|
||||||
<label>Hostname when requesting DHCP lease</label> |
|
||||||
<input id="wifi-hostname" type="text" name="hostname"/> |
|
||||||
</div> |
|
||||||
<div id="dhcp-off" class="pure-form-stacked"> |
|
||||||
<label>Static IP address</label> |
|
||||||
<input id="wifi-staticip" type="text" name="staticip"/> |
|
||||||
<label>Netmask (for static IP)</label> |
|
||||||
<input id="wifi-netmask" type="text" name="netmask"/> |
|
||||||
<label>Gateway (for static IP)</label> |
|
||||||
<input id="wifi-gateway" type="text" name="gateway"/> |
|
||||||
</div> |
|
||||||
<button id="special-button" type="submit" |
|
||||||
class="pure-button button-primary">Change!</button> |
|
||||||
</form> |
|
||||||
</div></div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<script type="text/javascript"> |
|
||||||
</script> |
|
||||||
<script src="wifi.js"></script> |
|
||||||
<script type="text/javascript"> |
|
||||||
onLoad(function() { |
|
||||||
getWifiInfo(); |
|
||||||
bnd($("#wifiform"), "submit", changeWifiAp); |
|
||||||
bnd($("#specform"), "submit", changeSpecial); |
|
||||||
bnd($("#dhcp-ron"), "click", doDhcp); |
|
||||||
bnd($("#dhcp-roff"), "click", doStatic); |
|
||||||
scanTimeout = window.setTimeout(scanAPs, 500); |
|
||||||
}); |
|
||||||
</script> |
|
||||||
</body></html> |
|
||||||
|
Loading…
Reference in new issue