Cela commence à fonctionner, automatiquement le nodemcu du nord envoie sa température sur le hub du sud ;-)
This commit is contained in:
9
Temp_DS18B20/temp_zf/0_cron_temp.lua
Normal file
9
Temp_DS18B20/temp_zf/0_cron_temp.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
-- Petit script pour faire office de crontab pour les mesures de température
|
||||
print("\n 0_cron_temp.lua zf190727.1336 \n")
|
||||
|
||||
cron1=tmr.create()
|
||||
cron1:alarm(10*1000, tmr.ALARM_AUTO, function()
|
||||
get_temp()
|
||||
end)
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
-- programme pour faire un test depuis de le webide
|
||||
|
||||
function a4()
|
||||
print("\n a4.lua zf190617.1125 \n")
|
||||
|
||||
end
|
||||
|
||||
a4()
|
||||
|
||||
|
||||
cron1=tmr.create()
|
||||
cron1:alarm(20*1000, tmr.ALARM_AUTO, function()
|
||||
f= "a2.lua" if file.exists(f) then dofile(f) end
|
||||
end)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-- Scripts à charger après le boot pour démarrer son appli
|
||||
|
||||
print("\n boot.lua zf190727.1329 \n")
|
||||
print("\n boot.lua zf190727.1341 \n")
|
||||
|
||||
function heartbeat()
|
||||
f= "flash_led_xfois.lua" if file.exists(f) then dofile(f) end
|
||||
@@ -28,6 +28,7 @@ f= "web_srv2.lua" if file.exists(f) then dofile(f) end
|
||||
|
||||
f= "0_get_temp.lua" if file.exists(f) then dofile(f) end
|
||||
f= "0_send_temp.lua" if file.exists(f) then dofile(f) end
|
||||
f= "0_cron_temp.lua" if file.exists(f) then dofile(f) end
|
||||
|
||||
f=nil
|
||||
--heartbeat=nil
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Affichage des températures 190727.0951</h1>
|
||||
<h1>Affichage des températures 190727.1349</h1>
|
||||
<br>
|
||||
Les températures mesurées sont:<br>
|
||||
|
||||
@@ -17,11 +17,13 @@
|
||||
zout("<br>Température intérieure chambre à coucher "..ztemp1.."°C")
|
||||
end
|
||||
if (ztemp2 ~= nil) then
|
||||
zout("<br>Température extérieure sud "..ztemp2.."°C")
|
||||
zout("<br>Température extérieure sud (nodemcu 29) "..ztemp2.."°C")
|
||||
end
|
||||
if (ztemp3 ~= nil) then
|
||||
zout("<br>Température extérieure nord "..ztemp3.."°C")
|
||||
zout("<br>Température extérieure nord (nodemcu 30) "..ztemp3.."°C")
|
||||
end
|
||||
|
||||
zout("<br><br>RAM: "..node.heap().."<br>")
|
||||
%>
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user