From 3138584dd6ecf576e138401f4ef4e41b51761497 Mon Sep 17 00:00:00 2001 From: Christian Zufferey Date: Sun, 21 Jun 2020 13:36:27 +0200 Subject: [PATCH] wip, je try encore quelque chose, ne marche pas --- .../0_tst4_socat.lua | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Mesures/energy/transfo_courant_clip_1p_1/0_tst4_socat.lua b/Mesures/energy/transfo_courant_clip_1p_1/0_tst4_socat.lua index 8fc1aaf..ec0f779 100644 --- a/Mesures/energy/transfo_courant_clip_1p_1/0_tst4_socat.lua +++ b/Mesures/energy/transfo_courant_clip_1p_1/0_tst4_socat.lua @@ -94,7 +94,13 @@ local function telnet_listener(socket) local function disconnect(_,zerr) node.output(nil) - print("................disconnect", socket,socket:getpeer()) + print("................disconnect") + + if socket~=nil then + -- if http_post~=nil then http_post(influxdb_url,"energy,memory=srv_rt_no_nil_"..yellow_id.." ram="..node.heap()) end + print("................disconnect 2e", socket, socket:getpeer()) + end + gpio.write(zLED, gpio.HIGH) fifo1, fifo1l, fifo2, fifo2l, s = nil, nil, nil, nil, nil collectgarbage() @@ -187,6 +193,22 @@ srv_rt:on("connection", function(sck) print("Welcome to NodeMCU world.") end) + +srv_rt:on("receive", function(sck) + print("zdebug, receive") +end) + +srv_rt:on("disconnection", function(sck) + print("zdebug, disconnection") +end) + +srv_rt:on("sent", function(sck) + print("zdebug, sent") +end) + + + + ztime_connect=tmr.now()/1000000 -- rt_launch()