Remis les mesures de courant pour voir si cela plante plus que 15mn

This commit is contained in:
Christian Zufferey
2020-06-15 19:40:03 +02:00
parent 42b137a2d3
commit ff5a7b605e
3 changed files with 7 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
-- Petit script pour faire office de crontab pour les mesures
print("\n 0_cron.lua zf200615.1605 \n")
print("\n 0_cron.lua zf200615.1934 \n")
cron1=tmr.create()
cron1:alarm(10*1000, tmr.ALARM_AUTO, function()
@@ -11,7 +11,7 @@ cron1:alarm(10*1000, tmr.ALARM_AUTO, function()
http_post(influxdb_url,"energy,memory=cron1_"..yellow_id.." ram="..node.heap())
-- if yellow_id == 60 then http_post(influxdb_url,"energy,compteur=3 puissance="..zpower/1000) end
-- if yellow_id == 64 then http_post(influxdb_url,"energy,compteur=4 puissance="..zpower/1000) end
if yellow_id == 64 then http_post(influxdb_url,"energy,compteur=4 puissance="..zpower/1000) end
-- http_post(influxdb_url,"energy,value=test2_"..yellow_id.." val=2")
-- http_post(influxdb_url,"energy,value=test3_"..yellow_id.." val=3")

View File

@@ -27,7 +27,7 @@ telnet -rN localhost 23000
]]
print("\n 0_tst4_socat.lua zf200615.1850 \n")
print("\n 0_tst4_socat.lua zf200615.1937 \n")
local node, table, tmr, uwrite, tostring =
node, table, tmr, uart.write, tostring
@@ -108,10 +108,8 @@ local function telnet_listener(socket)
if debug_rec~=nil then debug_rec("durée de connexion... "..zlaps..", "..node.heap()) end
if zlaps>1 then
-- if http_post~=nil then http_post(influxdb_url,"energy,memory=socat_disconnected_"..yellow_id.." ram="..node.heap()) end
print("rt_retry:",rt_retry)
if http_post~=nil then http_post(influxdb_url,"energy,memory=socat_disconnected_"..yellow_id.." ram="..node.heap()) end
rt_retry=rt_retry-1
print("rt_retry:",rt_retry)
if rt_retry>=0 then
local zstr="disconnect, reconnect 1x, "..node.heap()
print(zstr) if debug_rec~=nil then debug_rec(zstr) end

View File

@@ -1,6 +1,6 @@
-- Scripts à charger après le boot pour démarrer son projet
print("\n boot.lua zf200615.1852 \n")
print("\n boot.lua zf200615.1933 \n")
function zztime_format(ztime)
local tm = rtctime.epoch2cal(ztime + 2*3600)
@@ -40,8 +40,8 @@ function boot()
collectgarbage() print(node.heap())
zpower=0
-- f="0_get_power.lua" if file.exists(f) then dofile(f) end
-- collectgarbage() print(node.heap())
f="0_get_power.lua" if file.exists(f) then dofile(f) end
collectgarbage() print(node.heap())
f="0_cron.lua" if file.exists(f) then dofile(f) end
collectgarbage() print(node.heap())