-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from r-downing/dev
version 3.0
- Loading branch information
Showing
15 changed files
with
361 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
PersWiFiManager.ino | ||
PersWiFiManager.ino | ||
data/* | ||
!data/wifi* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/><title>ESP WiFi</title><script>function g(i){return document.getElementById(i);};function p(t,l){if(confirm(t)) window.location=l;};function E(s){return document.createElement(s)};var S="setAttribute",A="appendChild",H="innerHTML",X,wl;function scan(){if(X) return;X=new XMLHttpRequest(),wl=document.getElementById('wl');wl[H]="Scanning...";X.onreadystatechange=function(){if (this.readyState==4&&this.status==200){X=0;wl[H]="";this.responseText.split("\n").forEach(function (e){let t=e.split(","), s=t.slice(2).join(',');var d=E('div'),i=E('a'),c=E('a');i[S]('class','s'); c[S]('class','q');i.onclick=function(){g('s').value=s;g('p').focus();};i[A](document.createTextNode(s));c[H]=t[0]+"%"+(parseInt(t[1])?"\uD83D\uDD12":"\u26A0");wl[A](i); wl[A](c);wl[A](document.createElement('br'));});}};X.open("GET","wifi/list",true);X.send();};</script><style>input{padding:5px;font-size:1em;width:95%;filter:invert(100%);}body{text-align:center;font-family:verdana;background-color:black;color:white;}a{color:#1fa3ec;}button{border:0;border-radius:0.3em;background-color:#1fa3ec;color:#fff;line-height:2.4em;font-size:1.2em;width:100%;display:block;}.q{float:right;}.s{display:inline-block;width:14em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}#wl{line-height:1.5em;}</style></head><body><div style='text-align:left;display:inline-block;width:320px;padding:5px'><button onclick="scan()">↻ Scan</button><p id='wl'></p><form method='post' action='/wifi/connect'><input id='s' name='n' length=32 placeholder='SSID'><br><input id='p' name='p' length=64 type='password' placeholder='password'><br><br><button type='submit'>Connect</button></form><br><br><button onclick="p('Start WPS?','/wifi/wps')">WPS Setup</button><br><button onclick="p('Reboot device?','/wifi/rst')">Reboot</button><br><a href="javascript:history.back()">Back</a> |<a href="/">Home</a></div></body></html> | ||
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/><title>ESP WiFi</title><script>function g(i){return document.getElementById(i);};function p(t,l){if(confirm(t)) window.location=l;};function E(s){return document.createElement(s)};var S="setAttribute",A="appendChild",H="innerHTML",X,wl;function scan(){if(X) return;X=new XMLHttpRequest(),wl=document.getElementById('wl');wl[H]="Scanning...";X.onreadystatechange=function(){if (this.readyState==4&&this.status==200){X=0;wl[H]="";this.responseText.split("\n").forEach(function (e){let t=e.split(","), s=t.slice(2).join(',');var d=E('div'),i=E('a'),c=E('a');i[S]('class','s'); c[S]('class','q');i.onclick=function(){g('s').value=s;g('p').focus();};i[A](document.createTextNode(s));c[H]=t[0]+"%"+(parseInt(t[1])?"\uD83D\uDD12":"\u26A0");wl[A](i); wl[A](c);wl[A](document.createElement('br'));});}};X.open("GET","wifi/list",true);X.send();};</script><style>input{padding:5px;font-size:1em;width:95%;filter:invert(100%);}body{text-align:center;font-family:verdana;background-color:black;color:white;}a{color:#1fa3ec;}button{border:0;border-radius:0.3em;background-color:#1fa3ec;color:#fff;line-height:2.4em;font-size:1.2em;width:100%;display:block;}.q{float:right;}.s{display:inline-block;width:14em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}#wl{line-height:1.5em;}</style></head><body><div style='text-align:left;display:inline-block;width:320px;padding:5px'><button onclick="scan()">↻ Scan</button><p id='wl'></p><form method='post' action='/wifi/connect'><input id='s' name='n' length=32 placeholder='SSID'><br><input id='p' name='p' length=64 type='password' placeholder='password'><br><br><button type='submit'>Connect</button></form><br><br><button onclick="p('Start WPS?','/wifi/wps')">WPS Setup</button><br><button onclick="p('Start AP mode?','/wifi/ap')">AP Mode</button><br><button onclick="p('Reboot device?','/wifi/rst')">Reboot</button><br><a href="javascript:history.back()">Back</a> | <a href="/">Home</a></div></body></html> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<h3>Current Data</h3> | ||
x: | ||
<span id="x"></span> | ||
<br/> y: | ||
<span id="y"></span> | ||
|
||
<h6>Last updated | ||
<span id="ut"></span> seconds ago. | ||
<span id="status"></span> | ||
</h6> | ||
|
||
<h3>Update Data</h3> | ||
<form id="xform" onsubmit="return transmit(this)"> | ||
x: | ||
<input type="number" name="x" /> | ||
<input type="submit" /> | ||
</form> | ||
<form id="yform" onsubmit="return transmit(this)"> | ||
y: | ||
<input type="text" name="y" /> | ||
<input type="submit" /> | ||
</form> | ||
|
||
<a href="wifi.htm">WiFi settings</a> | ||
|
||
<script> | ||
function g(i) { return document.getElementById(i) }; | ||
var xhttp, updateTime; | ||
|
||
function transmit(f) { | ||
if (!xhttp) { //prevent simultaneous requests | ||
g("status").innerHTML = "updating..."; | ||
xhttp = new XMLHttpRequest(); | ||
xhttp.open("POST", "/api"); | ||
xhttp.send(f ? (new FormData(f)) : ""); | ||
xhttp.onreadystatechange = function () { | ||
if (xhttp.readyState === XMLHttpRequest.DONE && xhttp.status === 200) { | ||
var data = JSON.parse(xhttp.responseText); | ||
g("x").innerHTML = data.x; | ||
g("y").innerHTML = data.y; | ||
xhttp = null; | ||
g("status").innerHTML = ""; | ||
updateTime = 0; | ||
} | ||
} | ||
} | ||
return false; //prevent form redirect | ||
} | ||
transmit(); | ||
setInterval(function () { g("ut").innerHTML = ++updateTime; }, 1000); | ||
setInterval(transmit, 5000); //autoupdate display every 5s | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> | ||
<title>ESP WiFi</title> | ||
<script> | ||
function g(i){return document.getElementById(i);}; | ||
function p(t,l){if(confirm(t)) window.location=l;}; | ||
function E(s){return document.createElement(s)}; | ||
var S="setAttribute",A="appendChild",H="innerHTML",X,wl; | ||
function scan(){ | ||
if(X) return; | ||
X=new XMLHttpRequest(),wl=document.getElementById('wl'); | ||
wl[H]="Scanning..."; | ||
X.onreadystatechange=function(){ | ||
if (this.readyState==4&&this.status==200) { | ||
X=0; | ||
wl[H]=""; | ||
this.responseText.split("\n").forEach(function (e) { | ||
let t=e.split(","), s=t.slice(2).join(','); | ||
var d=E('div'),i=E('a'),c=E('a'); | ||
i[S]('class','s'); c[S]('class','q'); | ||
i.onclick=function(){g('s').value=s;g('p').focus();}; | ||
i[A](document.createTextNode(s)); | ||
c[H]=t[0]+"%"+(parseInt(t[1])?"\uD83D\uDD12":"\u26A0"); | ||
wl[A](i); wl[A](c); | ||
wl[A](document.createElement('br')); | ||
}); | ||
} | ||
}; | ||
X.open("GET","wifi/list",true); | ||
X.send(); | ||
}; | ||
</script> | ||
<style> | ||
input { | ||
padding:5px; | ||
font-size:1em; | ||
width:95%; | ||
filter:invert(100%); | ||
} | ||
|
||
body { | ||
text-align:center; | ||
font-family:verdana; | ||
background-color:black; | ||
color:white; | ||
} | ||
|
||
a { | ||
color:#1fa3ec; | ||
} | ||
|
||
button { | ||
border:0; | ||
border-radius:0.3em; | ||
background-color:#1fa3ec; | ||
color:#fff; | ||
line-height:2.4em; | ||
font-size:1.2em; | ||
width:100%; | ||
display:block; | ||
} | ||
|
||
.q { | ||
float:right; | ||
} | ||
|
||
.s { | ||
display:inline-block; | ||
width:14em; | ||
overflow:hidden; | ||
text-overflow:ellipsis; | ||
white-space:nowrap; | ||
} | ||
#wl{ | ||
line-height:1.5em; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div style='text-align:left;display:inline-block;width:320px;padding:5px'> | ||
<button onclick="scan()">↻ Scan</button> | ||
<p id='wl'></p> | ||
<form method='post' action='/wifi/connect'> | ||
<input id='s' name='n' length=32 placeholder='SSID'> | ||
<br> | ||
<input id='p' name='p' length=64 type='password' placeholder='password'> | ||
<br> | ||
<br> | ||
<button type='submit'>Connect</button> | ||
</form> | ||
<br> | ||
<br> | ||
<button onclick="p('Start WPS?','/wifi/wps')">WPS Setup</button> | ||
<br> | ||
<button onclick="p('Start AP mode?','/wifi/ap')">AP Mode</button> | ||
<br> | ||
<button onclick="p('Reboot device?','/wifi/rst')">Reboot</button> | ||
<br> | ||
<a href="javascript:history.back()">Back</a> | | ||
<a href="/">Home</a> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/><title>ESP WiFi</title><script>function g(i){return document.getElementById(i);};function p(t,l){if(confirm(t)) window.location=l;};function E(s){return document.createElement(s)};var S="setAttribute",A="appendChild",H="innerHTML",X,wl;function scan(){if(X) return;X=new XMLHttpRequest(),wl=document.getElementById('wl');wl[H]="Scanning...";X.onreadystatechange=function(){if (this.readyState==4&&this.status==200){X=0;wl[H]="";this.responseText.split("\n").forEach(function (e){let t=e.split(","), s=t.slice(2).join(',');var d=E('div'),i=E('a'),c=E('a');i[S]('class','s'); c[S]('class','q');i.onclick=function(){g('s').value=s;g('p').focus();};i[A](document.createTextNode(s));c[H]=t[0]+"%"+(parseInt(t[1])?"\uD83D\uDD12":"\u26A0");wl[A](i); wl[A](c);wl[A](document.createElement('br'));});}};X.open("GET","wifi/list",true);X.send();};</script><style>input{padding:5px;font-size:1em;width:95%;filter:invert(100%);}body{text-align:center;font-family:verdana;background-color:black;color:white;}a{color:#1fa3ec;}button{border:0;border-radius:0.3em;background-color:#1fa3ec;color:#fff;line-height:2.4em;font-size:1.2em;width:100%;display:block;}.q{float:right;}.s{display:inline-block;width:14em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}#wl{line-height:1.5em;}</style></head><body><div style='text-align:left;display:inline-block;width:320px;padding:5px'><button onclick="scan()">↻ Scan</button><p id='wl'></p><form method='post' action='/wifi/connect'><input id='s' name='n' length=32 placeholder='SSID'><br><input id='p' name='p' length=64 type='password' placeholder='password'><br><br><button type='submit'>Connect</button></form><br><br><button onclick="p('Start WPS?','/wifi/wps')">WPS Setup</button><br><button onclick="p('Start AP mode?','/wifi/ap')">AP Mode</button><br><button onclick="p('Reboot device?','/wifi/rst')">Reboot</button><br><a href="javascript:history.back()">Back</a> | <a href="/">Home</a></div></body></html> |
Binary file not shown.
Oops, something went wrong.