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