diff --git a/Mesures/humidity/solar-grafana/0_1_htu21d.lua b/Mesures/humidity/solar-grafana/0_1_htu21d.lua index 1e93afe..5166cb3 100644 --- a/Mesures/humidity/solar-grafana/0_1_htu21d.lua +++ b/Mesures/humidity/solar-grafana/0_1_htu21d.lua @@ -2,8 +2,7 @@ -- https://github.com/zuzu59/NodeMCU_Lua/tree/master/Mesures/humidity/bolo-thingspeak/docu/HTU21D.txt function readHTU21D() - if verbose then print("\n 0_1_htu21d.lua zf200525.1153 \n") end - if verbose then print("1readHTU21D: "..ztime_stamp()) end + if verbose then print("\n 0_1_htu21d.lua zf200525.1402 \n") end id = 0 sda = 5 scl = 6 addr = 0x40 HUMIDITY = 0xE5 TEMPERATURE = 0xE3 @@ -37,7 +36,6 @@ function readHTU21D() id=nil addr=nil HUMIDITY=nil TEMPERATURE=nil r=nil read_HTU21D=nil readTemp=nil readHumi=nil readHTU21D=nil if verbose then print("End 1_htu21d:\n"..node.heap()) end - if verbose then print("1readHTU21D: "..ztime_stamp()) end collectgarbage() if verbose then print(node.heap()) end end diff --git a/Mesures/humidity/solar-grafana/0_2_htu21d.lua b/Mesures/humidity/solar-grafana/0_2_htu21d.lua index f886a90..72128b8 100644 --- a/Mesures/humidity/solar-grafana/0_2_htu21d.lua +++ b/Mesures/humidity/solar-grafana/0_2_htu21d.lua @@ -2,8 +2,7 @@ -- https://github.com/zuzu59/NodeMCU_Lua/tree/master/Mesures/humidity/bolo-thingspeak/docu/HTU21D.txt function readHTU21D() - if verbose then print("\n 0_2_htu21d.lua zf200525.1154 \n") end - if verbose then print("2readHTU21D: "..ztime_stamp()) end + if verbose then print("\n 0_2_htu21d.lua zf200525.1402 \n") end id = 0 sda = 5 scl = 7 addr = 0x40 HUMIDITY = 0xE5 TEMPERATURE = 0xE3 @@ -37,7 +36,6 @@ function readHTU21D() id=nil addr=nil HUMIDITY=nil TEMPERATURE=nil r=nil read_HTU21D=nil readTemp=nil readHumi=nil readHTU21D=nil if verbose then print("End 2_htu21d:\n"..node.heap()) end - if verbose then print("2readHTU21D: "..ztime_stamp()) end collectgarbage() if verbose then print(node.heap()) end end diff --git a/Mesures/humidity/solar-grafana/0_cron.lua b/Mesures/humidity/solar-grafana/0_cron.lua index 33dce85..9d53463 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.1915 \n") +print("\n 0_cron.lua zf200525.1402 \n") function tprint(t) @@ -14,7 +14,6 @@ ztemp1=20 zhum1=40 ztemp2=20 zhum2=40 cron1=tmr.create() cron1:alarm(10*1000, tmr.ALARM_AUTO, function() if verbose then print("cron1........................") end - if verbose then print("cron1: "..ztime_stamp()) 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()) @@ -32,7 +31,6 @@ cron1:alarm(10*1000, tmr.ALARM_AUTO, function() f = "0_zdyndns.lua" if file.exists(f) then dofile(f) end if verbose then print("End cron:\n"..node.heap()) end - if verbose then print("cron1: "..ztime_stamp()) end collectgarbage() if verbose then print(node.heap()) end end) diff --git a/Mesures/humidity/solar-grafana/0_http_post.lua b/Mesures/humidity/solar-grafana/0_http_post.lua index 9042312..f6509b5 100644 --- a/Mesures/humidity/solar-grafana/0_http_post.lua +++ b/Mesures/humidity/solar-grafana/0_http_post.lua @@ -1,13 +1,12 @@ -- Petit script pour envoyer en // es valeurs sur un serveur WEB (InfluxDB) -- via un http POST à travers un FIFO -if verbose then print("\n 0_http_post.lua zf200525.1153 \n") end +if verbose then print("\n 0_http_post.lua zf200525.1403 \n") end t_zurl={} t_zarg={} f_zpost=false function zpost() f_zpost=true zurl=t_zurl[1] zarg=t_zarg[1] - if verbose then print("zpost: "..ztime_stamp()) end if verbose then print("zurl: "..zurl) end if verbose then print("zarg: "..zarg) end http.post(zurl, 'Content-Type: application/x-www-form-urlencoded\r\n', zarg, function(code, data) @@ -25,7 +24,6 @@ function zpost() zpost() end if verbose then print("End zpost:\n"..node.heap()) end - if verbose then print("zpost: "..ztime_stamp()) end collectgarbage() if verbose then print(node.heap()) end @@ -34,12 +32,10 @@ end function http_post(zurl,zarg) - if verbose then print("http_post: "..ztime_stamp()) end table.insert(t_zurl, zurl) table.insert(t_zarg, zarg) print("t_zurl:") tprint(t_zurl) print("t_zarg:") tprint(t_zarg) if f_zpost==false then zpost() end if verbose then print("End http_post:\n"..node.heap()) end - if verbose then print("http_post: "..ztime_stamp()) end collectgarbage() if verbose then print(node.heap()) end end diff --git a/Mesures/humidity/solar-grafana/0_zdyndns.lua b/Mesures/humidity/solar-grafana/0_zdyndns.lua index f662113..bd23a74 100644 --- a/Mesures/humidity/solar-grafana/0_zdyndns.lua +++ b/Mesures/humidity/solar-grafana/0_zdyndns.lua @@ -1,8 +1,7 @@ -- Petit script pour s'inregistrer sur zdyndns function send_zdyndns() - if verbose then print("\n 0_zdyndns.lua zf200525.1237 \n") end - if verbose then print("send_zdyndns: "..ztime_stamp()) end + if verbose then print("\n 0_zdyndns.lua zf200525.1403 \n") end zip = wifi.sta.getip() zdyndns_str = "s "..node_id..","..console_host..":"..tostring(console_port).." "..zip.."\n" @@ -22,7 +21,6 @@ function send_zdyndns() if verbose then print("close...") end zdyndns_str=nil zip=nil srv_zdyndns=nil send_zdyndns=nil if verbose then print("End zdyndns:\n"..node.heap()) end - if verbose then print("send_zdyndns: "..ztime_stamp()) end collectgarbage() if verbose then print(node.heap()) end end) diff --git a/Mesures/humidity/solar-grafana/boot.lua b/Mesures/humidity/solar-grafana/boot.lua index ca815a4..d1593c5 100644 --- a/Mesures/humidity/solar-grafana/boot.lua +++ b/Mesures/humidity/solar-grafana/boot.lua @@ -1,21 +1,24 @@ -- Scripts à charger après le boot pour démarrer son projet -print("\n boot.lua zf200525.1229 \n") +print("\n boot.lua zf200525.1404 \n") function ztime_stamp() return tmr.now()/1000000 end function boot() verbose = true print("On lance le boot...") - print("boot: "..ztime_stamp()) print(node.heap()) collectgarbage() print(node.heap()) - f="0_tst3_socat.lua" if file.exists(f) then dofile(f) end - print(node.heap()) collectgarbage() print(node.heap()) - f = "0_http_post.lua" if file.exists(f) then dofile(f) end print(node.heap()) collectgarbage() print(node.heap()) + -- http_post(influxdb_url,"energy,memory=boot_"..yellow_id.." ram="..node.heap()) + -- http_post(influxdb_url,"energy,memory=cron1 ram="..node.heap()) + + + -- f="0_tst3_socat.lua" if file.exists(f) then dofile(f) end + print(node.heap()) collectgarbage() print(node.heap()) + f="0_btn_flipflop.lua" if file.exists(f) then dofile(f) end print(node.heap()) collectgarbage() print(node.heap()) @@ -26,7 +29,6 @@ function boot() print("verbose:",verbose) print("boot lancé...") - print("boot: "..ztime_stamp()) print(node.heap()) collectgarbage() print(node.heap()) f=nil boot=nil end