From 6ac26d0c89c107ff340d77d360841482f55f4e4f Mon Sep 17 00:00:00 2001 From: Christian Zufferey Date: Sun, 24 May 2020 14:28:19 +0200 Subject: [PATCH] =?UTF-8?q?Super=20!=20Ma=20petite=20salle=20d'attente=20p?= =?UTF-8?q?our=20les=20http.post=20fonctionne=20=C3=A0=20merveille.=20Je?= =?UTF-8?q?=20graphe=20m=C3=AAme=20maintenant=20l'utilisation=20de=20la=20?= =?UTF-8?q?m=C3=A9moire=20pour=20suivre=20les=20fuites=20m=C3=A9moire=20;-?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mesures/humidity/solar-grafana/0_cron.lua | 28 +++++++------------ Mesures/humidity/solar-grafana/boot.lua | 10 ++++--- .../{ => goodies}/00test_cmd.lua | 0 .../{ => oldies}/0_send_data.lua | 0 4 files changed, 16 insertions(+), 22 deletions(-) rename Mesures/humidity/solar-grafana/{ => goodies}/00test_cmd.lua (100%) rename Mesures/humidity/solar-grafana/{ => oldies}/0_send_data.lua (100%) diff --git a/Mesures/humidity/solar-grafana/0_cron.lua b/Mesures/humidity/solar-grafana/0_cron.lua index 1c2ac8d..04177f4 100644 --- a/Mesures/humidity/solar-grafana/0_cron.lua +++ b/Mesures/humidity/solar-grafana/0_cron.lua @@ -1,5 +1,5 @@ -- Petit script pour faire office de crontab pour les mesures -print("\n 0_cron.lua zf200524.1246 \n") +print("\n 0_cron.lua zf200524.1416 \n") function tprint(t) @@ -12,31 +12,23 @@ ztemp1=20 zhum1=40 ztemp2=20 zhum2=40 cron1=tmr.create() -cron1:alarm(5*1000, tmr.ALARM_AUTO, function() +cron1:alarm(10*1000, tmr.ALARM_AUTO, function() if verbose then print("cron1........................") end if verbose then gpio.write(zLED, gpio.LOW) tmr.delay(10000) gpio.write(zLED, gpio.HIGH) end + http_post(influxdb_url,"energy,memory=cron1 ram="..node.heap()) + f = "0_1_htu21d.lua" if file.exists(f) then dofile(f) end - f = "0_2_htu21d.lua" if file.exists(f) then dofile(f) end - - - - http_post(influxdb_url,"energy,capteur=th1 humidity="..ztemp1) + http_post(influxdb_url,"energy,capteur=th1 temperature="..ztemp1) http_post(influxdb_url,"energy,capteur=th1 humidity="..zhum1) - http_post(influxdb_url,"energy,capteur=th1 humidity="..ztemp2) - http_post(influxdb_url,"energy,capteur=th1 humidity="..zhum2) - - - - - table.remove(t_zurl, 1) table.remove(t_zarg, 1) - print("t_zurl:") tprint(t_zurl) print("t_zarg:") tprint(t_zarg) + f = "0_2_htu21d.lua" if file.exists(f) then dofile(f) end + http_post(influxdb_url,"energy,capteur=th2 temperature="..ztemp2) + http_post(influxdb_url,"energy,capteur=th2 humidity="..zhum2) - - f = "0_send_data.lua" if file.exists(f) then dofile(f) end ztemp1=nil zhum1=nil ztemp2=nil zhum2=nil - f = "0_zdyndns.lua" if file.exists(f) then dofile(f) end + + --f = "0_zdyndns.lua" if file.exists(f) then dofile(f) end if verbose then print("End cron:\n"..node.heap()) end collectgarbage() diff --git a/Mesures/humidity/solar-grafana/boot.lua b/Mesures/humidity/solar-grafana/boot.lua index 83aba93..b255e7b 100644 --- a/Mesures/humidity/solar-grafana/boot.lua +++ b/Mesures/humidity/solar-grafana/boot.lua @@ -1,15 +1,17 @@ -- Scripts à charger après le boot pour démarrer son projet -print("\n boot.lua zf200524.1250 \n") +print("\n boot.lua zf200524.1357 \n") function boot() verbose = true print("On lance le boot...") print(node.heap()) collectgarbage() print(node.heap()) + f = "0_http_post.lua" if file.exists(f) then dofile(f) end + --f="0_tst3_socat.lua" if file.exists(f) then dofile(f) end - --f="0_btn_flipflop.lua" if file.exists(f) then dofile(f) end - --f="0_cron.lua" if file.exists(f) then dofile(f) end + f="0_btn_flipflop.lua" if file.exists(f) then dofile(f) end + f="0_cron.lua" if file.exists(f) then dofile(f) end --f = "web_ide2.lua" if file.exists(f) then dofile(f) end @@ -23,4 +25,4 @@ boot() --[[ verbose = true verbose = false -]] \ No newline at end of file +]] diff --git a/Mesures/humidity/solar-grafana/00test_cmd.lua b/Mesures/humidity/solar-grafana/goodies/00test_cmd.lua similarity index 100% rename from Mesures/humidity/solar-grafana/00test_cmd.lua rename to Mesures/humidity/solar-grafana/goodies/00test_cmd.lua diff --git a/Mesures/humidity/solar-grafana/0_send_data.lua b/Mesures/humidity/solar-grafana/oldies/0_send_data.lua similarity index 100% rename from Mesures/humidity/solar-grafana/0_send_data.lua rename to Mesures/humidity/solar-grafana/oldies/0_send_data.lua