Enlevé tous les codes de profiling de print timestamp

This commit is contained in:
Christian Zufferey
2020-05-25 14:09:23 +02:00
parent 099e257876
commit 03a20c0921
6 changed files with 13 additions and 23 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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)

View File

@@ -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