gablau / node-red-contrib-blynk-iot

Blynk IoT / Blynk 2.0 library implementation for Node-RED using TLS
MIT License
17 stars 7 forks source link

Nodes show disconnected after 1-2 minutes, but still work #1

Closed Peterkn2001 closed 3 years ago

Peterkn2001 commented 3 years ago

After a node-red-start, or a Deploy, the nodes show as "Connected to pin Vx" with a green dot. After 1-2 minutes the nodes change to "Disconnected" with a red dot.

The debug log shows:

26 Jun 17:36:30 - [info] [blynk-iot-client:Blynk 2.0 test] TLS: close
26 Jun 17:36:30 - [info] [blynk-iot-client:Blynk 2.0 test] Socket closed: blynk.cloud

but pings continue, and the nodes continue to receive and send data to Blynk.

Here's the full debug log...

26 Jun 17:35:05 - [info] Started flows
26 Jun 17:35:05 - [info] [blynk-iot-client:Blynk 2.0 test] TLS: connect
26 Jun 17:35:05 - [info] [blynk-iot-client:Blynk 2.0 test] TLS: ready
26 Jun 17:35:05 - [info] [blynk-iot-client:Blynk 2.0 test] login -> ***************************9QwAM
26 Jun 17:35:05 - [info] [blynk-iot-client:Blynk 2.0 test] SEND -> Cmd: HW_LOGIN, Id: 1, len: 32, data: "***************************9QwAM"
26 Jun 17:35:05 - [info] [blynk-iot-client:Blynk 2.0 test] Connection authorized by a Certificate Authority.
26 Jun 17:35:05 - [info] [blynk-iot-client:Blynk 2.0 test] RECV <- Cmd: RSP, Id: 1, responseCode: OK
26 Jun 17:35:05 - [info] [blynk-iot-client:Blynk 2.0 test] Client logged
26 Jun 17:35:05 - [info] [blynk-iot-client:Blynk 2.0 test] SEND -> Cmd: INTERNAL, Id: 2, len: 125, data: "ver|1.0.0|h-beat|45|buff-in|32767|dev|node-red|con|blynk-tls|fw-type|TMPLSCn-V8qq|fw|2.0.0|build|2021-06-15|tmpl|TMPLSCn-V8qq"
26 Jun 17:35:05 - [info] [blynk-iot-client:Blynk 2.0 test] RECV <- Cmd: RSP, Id: 2, responseCode: OK
26 Jun 17:35:50 - [info] [blynk-iot-client:Blynk 2.0 test] ping
26 Jun 17:35:50 - [info] [blynk-iot-client:Blynk 2.0 test] SEND -> Cmd: PING, Id: 3, len: 0, data: ""
26 Jun 17:35:50 - [info] [blynk-iot-client:Blynk 2.0 test] RECV <- Cmd: RSP, Id: 3, responseCode: OK
26 Jun 17:36:30 - [info] [blynk-iot-client:Blynk 2.0 test] TLS: close
26 Jun 17:36:30 - [info] [blynk-iot-client:Blynk 2.0 test] Socket closed: blynk.cloud
26 Jun 17:36:35 - [info] [blynk-iot-client:Blynk 2.0 test] ping
26 Jun 17:36:35 - [info] [blynk-iot-client:Blynk 2.0 test] SEND -> Cmd: PING, Id: 4, len: 0, data: ""
26 Jun 17:36:35 - [info] [blynk-iot-client:Blynk 2.0 test] RECV <- Cmd: RSP, Id: 4, responseCode: OK
26 Jun 17:37:20 - [info] [blynk-iot-client:Blynk 2.0 test] ping
26 Jun 17:37:20 - [info] [blynk-iot-client:Blynk 2.0 test] SEND -> Cmd: PING, Id: 5, len: 0, data: ""
26 Jun 17:37:20 - [info] [blynk-iot-client:Blynk 2.0 test] RECV <- Cmd: RSP, Id: 5, responseCode: OK
26 Jun 17:38:05 - [info] [blynk-iot-client:Blynk 2.0 test] ping
26 Jun 17:38:05 - [info] [blynk-iot-client:Blynk 2.0 test] SEND -> Cmd: PING, Id: 6, len: 0, data: ""
26 Jun 17:38:05 - [info] [blynk-iot-client:Blynk 2.0 test] RECV <- Cmd: RSP, Id: 6, responseCode: OK
26 Jun 17:38:14 - [info] [blynk-iot-client:Blynk 2.0 test] RECV <- Cmd: HW, Id: 71, len: 7, data: "vw|1|21"
26 Jun 17:38:14 - [info] [blynk-iot-client:Blynk 2.0 test] writeEvent: -> cmd {"type":20,"typeString":"HW","msgId":71,"len":7,"msgLength":12,"body":"vw\u00001\u000021","operation":"vw","pin":"1","value":"21","array":["21"]}
26 Jun 17:38:14 - [info] [blynk-iot-client:Blynk 2.0 test] writeEvent: -> output {"payload":"21","pin":"1","arrayOfValues":["21"]}
26 Jun 17:38:25 - [info] [blynk-iot-client:Blynk 2.0 test] virtualWrite: -> ["vw","1","73"]
26 Jun 17:38:25 - [info] [blynk-iot-client:Blynk 2.0 test] SEND -> Cmd: HW, Id: 7, len: 7, data: "vw|1|73"

The nodes don't change from "Disconnected", but continue to function normally, and the web dashboard and app show the device as "Online".

Pete.

gablau commented 3 years ago

Right handle of socket close/end connection. Fixed in the next release

Peterkn2001 commented 3 years ago

Fixed in v0.2.0

Many thanks!

Pete.