gablau / node-red-contrib-blynk-ws

Old/Legacy Blynk library implementation for Node-RED using WebSockets
MIT License
31 stars 10 forks source link

Crashing node-red #6

Closed shtirlic closed 5 years ago

shtirlic commented 6 years ago

When network is not available it's crashing node-red process

node-red 0.17.5 node-red-contrib-blynk-ws 0.5.0 node --version v6.14.1

Apr 15 12:06:52 lmc Node-RED[2054]: 15 Apr 12:06:52 - [error] [blynk-ws-client:Magellanic Clouds] Websocket error: Error: getaddrinfo ENOTFOU
ND blynk-cloud.com blynk-cloud.com:9443
Apr 15 12:06:52 lmc Node-RED[2054]: 15 Apr 12:06:52 - [info] [blynk-ws-client:Magellanic Clouds] Connection closed: wss://blynk-cloud.com:944
3/websockets
Apr 15 12:06:52 lmc Node-RED[2054]: 15 Apr 12:06:52 - [error] [blynk-ws-client:lmc wemos thermo] Websocket error: Error: getaddrinfo ENOTFOUN
D blynk-cloud.com blynk-cloud.com:9443
Apr 15 12:06:52 lmc Node-RED[2054]: 15 Apr 12:06:52 - [red] Uncaught Exception:
Apr 15 12:06:52 lmc Node-RED[2054]: 15 Apr 12:06:52 - Error: Uncaught, unspecified "error" event. (undefined)
Apr 15 12:06:52 lmc Node-RED[2054]:     at BlynkClientNode.emit (events.js:163:17)
Apr 15 12:06:52 lmc Node-RED[2054]:     at WebSocket.<anonymous> (/usr/lib/node_modules/node-red-contrib-blynk-ws/nodes/blynk-ws-client.js:42
8:10)
Apr 15 12:06:52 lmc Node-RED[2054]:     at emitOne (events.js:96:13)
Apr 15 12:06:52 lmc Node-RED[2054]:     at WebSocket.emit (events.js:188:7)
Apr 15 12:06:52 lmc Node-RED[2054]:     at ClientRequest.req.on (/usr/lib/node_modules/node-red-contrib-blynk-ws/node_modules/ws/lib/websocke
t.js:535:10)
Apr 15 12:06:52 lmc Node-RED[2054]:     at emitOne (events.js:96:13)
Apr 15 12:06:52 lmc Node-RED[2054]:     at ClientRequest.emit (events.js:188:7)
Apr 15 12:06:52 lmc Node-RED[2054]:     at TLSSocket.socketErrorListener (_http_client.js:310:9)
Apr 15 12:06:52 lmc Node-RED[2054]:     at emitOne (events.js:96:13)
Apr 15 12:06:52 lmc Node-RED[2054]:     at TLSSocket.emit (events.js:188:7)
Apr 15 12:06:52 lmc Node-RED[2054]:     at connectErrorNT (net.js:1040:8)
Apr 15 12:06:52 lmc Node-RED[2054]:     at _combinedTickCallback (internal/process/next_tick.js:80:11)
Apr 15 12:06:52 lmc Node-RED[2054]:     at process._tickCallback (internal/process/next_tick.js:104:9)
Apr 15 12:06:52 lmc systemd[1]: nodered.service: Main process exited, code=exited, status=1/FAILURE
gablau commented 6 years ago

Hi, this not append on node-red 0.18.4 and node 8.9.4, which what version of Websocket module are you using?

gablau commented 6 years ago

Test on my live system Rpi3 with node-red 0.17.5 - node 6.14.1 - websocket 5.1.1

16 Apr 08:21:32 - [info] [blynk-ws-client:uno] ping
16 Apr 08:21:32 - [info] [blynk-ws-client:uno] SEND -> Cmd: PING, Id: 5603, len: 0, data: ""
16 Apr 08:21:41 - [info] [blynk-ws-client:uno] Connection closed: ws://blynk-cloud.com/websockets
16 Apr 08:21:46 - [info] [blynk-ws-client:uno] Start connection: ws://blynk-cloud.com/websockets
16 Apr 08:21:46 - [info] [blynk-ws-client:uno] login -> ***************************b94d0
16 Apr 08:21:46 - [info] [blynk-ws-client:uno] SEND -> Cmd: LOGIN, Id: 1, len: 32, data: "***************************b94d0"
16 Apr 08:21:46 - [info] [blynk-ws-client:uno] RECV <- Cmd: RSP, Id: 1, responseCode: OK
16 Apr 08:21:46 - [info] [blynk-ws-client:uno] Client logged
16 Apr 08:21:46 - [info] [blynk-ws-client:uno] SEND -> Cmd: INTERNAL, Id: 5605, len: 82, data: "ver|0.5.2|h-beat|10|buff-in|32767|dev|node-red|con|Blynk-ws|build|0.5.0 2018-04-14"
16 Apr 08:21:46 - [info] [blynk-ws-client:uno] RECV <- Cmd: RSP, Id: 5605, responseCode: OK
16 Apr 08:21:52 - [info] [blynk-ws-client:uno] ping
16 Apr 08:21:52 - [info] [blynk-ws-client:uno] SEND -> Cmd: PING, Id: 5607, len: 0, data: ""

maybe you can try going to the node-red-contrib-blynk-ws folder, then delete the node_modules folder and do a npm install that should download the updated dependency modules.

let me know!!