Files
NodeMCU_Lua/Boot init.lua/mini/boot.lua
Christian Zufferey c4aaeb3e82 - super bien avancé avec mon init.lua mini.
- maintenant il s'endort pendant 30 secondes, se réveille, regarde s'il peut se connecter sur un wifi, si oui, démarre le web ide, autrement se rendort pour 30 secondes
- aussi, le tout mini web ide fonctionne, c'est à dire que je peux modifier depuis la connexion wifi le code lua sur le NodeMCU, sans devoir brancher le NodeMCU sur le port USB
- une sacrée avancée que voici pour mon WPS/GPS que je suis en train d'écrire :-)
2018-11-20 07:31:14 +01:00

25 lines
786 B
Lua

-- Scripts à charger après le boot pour démarrer son appli
print("\n boot.lua zf181120.0016 \n")
f= "wifi_ap_stop.lua" if file.exists(f) then dofile(f) end
f= "wifi_cli_conf.lua" if file.exists(f) then dofile(f) end
f= "wifi_cli_start.lua" if file.exists(f) then dofile(f) end
f= "telnet_srv.lua" if file.exists(f) then dofile(f) end
f= "web_ide2.lua" if file.exists(f) then dofile(f) end
f= "dsleep.lua" if file.exists(f) then dofile(f) end
x_dsleep=7 y_dsleep=30 dsleep()
i=1
jobtimer1=tmr.create()
tmr.alarm(jobtimer1, 1*1000, tmr.ALARM_AUTO, function()
print(i) i=i+1
if wifi.sta.getip() ~= nil then
tmr.stop(jobtimer1)
tmr.stop(ztmr_SLEEP)
x_dsleep=300 y_dsleep=30 dsleep()
print("c'est connecté...")
end
end)