diff --git a/SonOff/SonOff_2/z_index.html b/SonOff/SonOff_2/z_index.html
index 041f0a5..f12989b 100644
--- a/SonOff/SonOff_2/z_index.html
+++ b/SonOff/SonOff_2/z_index.html
@@ -5,7 +5,7 @@
SonOff home page
- SonOff home page 2001011.1233
+ SonOff home page 2001011.1351
Home...
Menu:
<%
- if (vars ~= nil) then
- zout("
vars: "..vars.."
")
- for k, v in string.gmatch(vars, "(%w+)=(%w+%p+%w+)&*") do
- _GET[k] = v
- zout(k..": "..v.."
")
- end
- end
- if (_GET.SetupWIFI == "true") then
- print("On demande le setup wifi depuis le browser !")
- zout("
Choisir comme WIFI AP: setup_gadget puis aller sur: http://192.168.4.1
")
- file.putcontents("_setup_wifi_", "toto")
- tmr.create():alarm(5*1000, tmr.ALARM_SINGLE, function()
- print("on restart pour le setup wifi")
- wifi.sta.config{ssid="", pwd="", auto=true, save=true}
- wifi.sta.autoconnect(1) wifi.sta.connect()
- node.restart()
- end)
- end
- if (_GET.RESTART == "true") then
-
- zout("oups restart...")
-
- end
+ if vars ~= nil then
+ zout("
vars: "..vars.."
")
+ for k, v in string.gmatch(vars, "(%w+)=(%w+%p+%w+)&*") do
+ _GET[k] = v
+ zout(k..": "..v.."
")
+ end
+ end
%>
-
Etat de la LED:
<%
+ if _GET.SetupWIFI == "true" then
+ print("On demande le setup wifi depuis le browser !")
+ wifi_setup_ok=(math.floor(100*node.random()))
+ zout("
Etes-vous vraiment certain ?
Si oui, faites: ")
+ zout(' Ok
')
+ end
+%>
+
+<%
+ if (wifi_setup_ok ~= nil) and (_GET.SetupWIFI == tostring(wifi_setup_ok)) then
+ print("On confirme le setup wifi depuis le browser !")
+ zout("
Choisir comme WIFI AP: setup_gadget puis aller sur: http://192.168.4.1
")
+ file.putcontents("_setup_wifi_", "toto")
+ tmr.create():alarm(5*1000, tmr.ALARM_SINGLE, function()
+ print("on restart pour le setup wifi")
+ wifi.sta.config{ssid="", pwd="", auto=true, save=true}
+ wifi.sta.autoconnect(1) wifi.sta.connect()
+ node.restart()
+ end)
+ end
+%>
+
+<%
+ if _GET.RESTART == "true" then
+ print("oups restart...")
+ zout("
oups restart...
")
+ tmr.create():alarm(5*1000, tmr.ALARM_SINGLE, function()
+ print("on restart...")
+ node.restart()
+ end)
+ end
+%>
+
+<%
+ zout("Etat de la LED:")
if gpio.read(zLED) == 1 then zout("OFF") else zout("ON") end
+ zout("
")
%>
-
Etat du RELAY:
-<%
- zRELAY=6
- if gpio.read(zRELAY) == 0 then zout("OFF") else zout("ON") end
+<%
+ if zRELAY ~= nil then
+ zout("Etat du RELAY:")
+ if gpio.read(zRELAY) == 0 then zout("OFF") else zout("ON") end
+ zout("
")
+ end
%>
-
<%
a,b,c = wifi.sta.getip()
if a ~= nil then
- zout("IP: "..a.." MASK: "..b.." GATEWAY: "..c.."
")
+ zout("
IP: "..a.." MASK: "..b.." GATEWAY: "..c.."
")
end
collectgarbage() zout("RAM: "..node.heap())
%>
+
+
Restart !
+