Y'a de nouveau quelque chose qui ne marche plus, c'est dingue :-(

This commit is contained in:
Christian Zufferey
2020-01-10 20:05:18 +01:00
parent ac5e21678e
commit 3634607a34
3 changed files with 19 additions and 27 deletions

View File

@@ -3,7 +3,7 @@
-- le script repair.lua pendant xx secondes avant de continuer
--Source: https://nodemcu.readthedocs.io/en/master/en/modules/node/#nodebootreason
print("\n init.lua zf200110.1232 \n")
print("\n init.lua zf200110.1948 \n")
function initz()
@@ -12,6 +12,7 @@ function initz()
f= "wifi_init.lua" if file.exists(f) then dofile(f) end
f=nil initz=nil second_chance=nil hvbouton=nil initz_end=nil
print(node.heap()) collectgarbage() print(node.heap())
print("initz_end out...")
end
function hvbouton()

View File

@@ -1,7 +1,7 @@
-- Petit script pour initaliser la couche WIFI
function wifi_init()
print("\n wifi_init.lua zf200110.1236 \n")
print("\n wifi_init.lua zf200110.1956 \n")
function wifi_init_end()
wifi_init1:unregister() i=nil
@@ -27,6 +27,7 @@ function wifi_init()
enduser_setup.start(function()
node.restart()
end)
print("setup wifi out...")
else
-- charge les secrets pour le wifi
f= "secrets_wifi.lua" if file.exists(f) then dofile(f) end
@@ -68,6 +69,5 @@ wifi_init()
--[[
file.putcontents("_setup_wifi_", "")
boot2_go = true
]]

View File

@@ -5,23 +5,23 @@
<title>SonOff home page</title>
</head>
<body>
<h1>SonOff home page 200109.1847</h1>
<h1>SonOff home page 200109.1940</h1>
<h2>Menu:</h2>
<h3>
<a href="api_sonoff.html?LED=on">SonOff API LED On</a><br>
<a href="api_sonoff.html?LED=off">SonOff API LED OFF</a><br>
<a href="api_sonoff.html?RELAY=on">SonOff API RELAY On</a><br>
<a href="api_sonoff.html?RELAY=off">SonOff API RELAY OFF</a><br>
SonOff API LED
<a href="api_sonoff.html?LED=on"> On</a>
<a href="api_sonoff.html?LED=off"> Off</a><br>
SonOff API RELAY
<a href="api_sonoff.html?RELAY=on"> On</a>
<a href="api_sonoff.html?RELAY=off"> Off</a><br>
<br>
<a href="z_index.html?SetupWIFI=true">Wifi setup (setup_gadget, 192.168.4.1)</a><br>
<a href="wifi_clear.html?field1=11&field2=12&field3=13">Wifi clear, effacement configuration WIFI</a><br>
<a href="disp_temp.html">Affichage des températures, affiche les températures mesurées</a><br>
</h3>
<%
if (vars ~= nil) then
zout("<br>vars: "..vars.."<br>")
@@ -31,29 +31,20 @@
end
end
if (_GET.SetupWIFI == "true") then
print("toto")
zout("WIFI SETUP MODE")
file.putcontents("_setup_wifi_", "")
--zout("<br><br>Choisir comme WIFI AP: setup_gadget puis aller sur: http://192.168.4.1<br><br>")
file.putcontents("_setup_wifi_", "toto")
file.putcontents("_toto_", "toto")
tmr.create():alarm(3*1000, tmr.ALARM_SINGLE, function()
node.restart()
node.restart()
end)
end
if (_GET.RESTART == "true") then
zout("oups restart...")
end
%>
<br>Etat de la LED:<nsp>
<%
if gpio.read(zLED) == 1 then zout("OFF") else zout("ON") end