ESP Link - Connecting
Connecting to AP...
-Status:
-
Status: +...
diff --git a/html/wifi/connecting.html b/html/wifi/connecting.html
index 230b26f..3959512 100644
--- a/html/wifi/connecting.html
+++ b/html/wifi/connecting.html
@@ -11,16 +11,16 @@ function getStatus() {
xhr.onreadystatechange=function() {
if (xhr.readyState==4 && xhr.status>=200 && xhr.status<300) {
var data=JSON.parse(xhr.responseText);
- if (data.status=="idle") {
- $("#status").innerHTML="Preparing to connect...";
+ if (data.status=="idle" || data.status=="connecting") {
+ $("#status").innerHTML="Connecting...";
window.setTimeout(getStatus, 1000);
- } else if (data.status=="success") {
- $("#status").innerHTML="Connected! Got IP "+data.ip+". If you're in the same network, you can access it here.";
- } else if (data.status=="working") {
- $("#status").innerHTML="Trying to connect to selected access point...";
- window.setTimeout(getStatus, 1000);
- } else if (data.status=="fail") {
- $("#status").innerHTML="Connection failed. Check password and selected AP.
Go Back";
+ } else if (data.status=="got IP address") {
+ $("#status").innerHTML="Connected! Got IP "+data.ip+
+ ". If you're in the same network, you can access it here.";
+ } else {
+ $("#status").innerHTML="Oops: " + data.status + ". Reason: " + data.reason +
+ "
Check password and selected AP.
Go Back";
}
}
}
@@ -28,7 +28,7 @@ function getStatus() {
}
window.onload=function(e) {
- getStatus();
+ window.setTimeout(getStatus, 2000);
};
@@ -36,8 +36,8 @@ window.onload=function(e) {
Status:
-
Status: +...