Maintenant il arrive à s'arrêter quand il voir un wifi connu mais...

Comme il peut démarrer maintenant tout seul depuis un power off,
il n'a plus moyen d'aller chercher la date sur Internet.
Il faut donc régulièrement quand on est connecté sur Internet, sauver
la date dans la flash afin qu'il puisse au moins partir d'une date pas
trop fausse quand il démarre sans nternet
This commit is contained in:
Christian Zufferey
2020-08-14 19:36:49 +02:00
parent 017cff09d0
commit 0d1e801db4
4 changed files with 22 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
-- Scripts pour tester l'écoute des AP WIFI
print("\n wifi_scan.lua zf200812.1948 \n")
print("\n wifi_scan.lua zf200814.1924 \n")
f= "secrets_project.lua" if file.exists(f) then dofile(f) end
@@ -25,7 +25,7 @@ function scan_wifi()
if ssid == "3g-s7" then
print("ah je vois que je dois m'arrêter...")
-- node.restart()
zdsleep_stop =true
end
print("coucou: ."..ssid..".")
@@ -37,7 +37,11 @@ function scan_wifi()
save_flash(zstr)
end
print("end display...")
dsleep_on()
if zdsleep_stop then
node.restart()
else
dsleep_on()
end
end
print("wifi scan...")
wifi.sta.getap(1, listap)

View File

@@ -1,8 +1,12 @@
zf200724.1053
zf200814.1936
print(ztime())
dsleep_on()
f = "0_wifi_scan.lua" if file.exists(f) then dofile(f) end
wifi.setmode(wifi.STATION)
scan_wifi()
zcat_logs_ap_wifi()
print(node.bootreason())

View File

@@ -1,9 +1,16 @@
# Quelques commandes remote (luatool) à envoyer avec le plugin Atom-IDE-terminal de l'éditeur Atom
# zf200812.1928
# zf200814.1936
Todo à faire pour ce projet !
- il faut que quand il se réveille et que la date est en 1970, il doit alors aller
chercher la date dans un fichier sur la flash.
Et qu'à chaque fois qu'il écrit le log dans la flash il sauve aussi la date qu'il
a pour si jamais qu'il puisse repartir au moins depuis un temps connu
Convertisseur GPX to CSV
https://mygeodata.cloud/converter/gpx-to-csv

View File

@@ -1,7 +1,7 @@
-- Petit script pour initaliser la couche WIFI
function wifi_init()
print("\n wifi_init.lua zf200812.1938 \n")
print("\n wifi_init.lua zf200814.1917 \n")
f= "secrets_wifi.lua" if file.exists(f) then dofile(f) end
f= "secrets_project.lua" if file.exists(f) then dofile(f) end
@@ -75,7 +75,7 @@ function wifi_init()
if wifi.sta.getip() == nil then
print(i,"Connecting to AP...")
i=i+1
if i > 30 then
if i > 10 then
print("pas de wifi :-(")
file.putcontents("_setup_wifi_", "toto")
print("on restart pour le setup wifi")