gablau / node-red-contrib-blynk-ws

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

Retrocompatibility with node-red-contrib-blynk-websockets #9

Closed pathwayx99 closed 5 years ago

pathwayx99 commented 5 years ago

Good morning,

I recently tried to upgrade my home automation system which I've based on Node Red (and which is integrated with Blynk via the node-red-contrib-blynk-websockets library) to the newer library node-red-contrib-blynk-ws.

I took the steps outlined in the readme and it looked to be working. However, after a while, I started getting random disconnects/reconnects from the Node Red Blynk nodes. I tried to troubleshoot it for a couple of days but couldn't make sense of what was going on. I didn't seem to be experiencing any network issues and the environment was stable.

What I could see were some messages in the log and at the same time that these were firing, the nodes in the Node Red designer would go offline, then online again. And again. And again. At the same time, the disconnects were also visible in the mobile Blynk app. In the end, I had to revert to the previous library which is working fine.

I'm including a syslog snippet below, in case this is helpful.

I realize this may not be a bug of the library per se, but I am raising it in case it can be helpful to the developer or somebody else.

If someone needs more info, I'll be happy to help.

Nov 14 18:48:12 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:12 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:12 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:12 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:12 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:12 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:12 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:12 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:12 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:12 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:12 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:12 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:12 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:12 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:12 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:12 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:13 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:13 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation] Client logged
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation] Client logged
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation] Client logged
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation]  ws://192.168.1.50:8082/websockets
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation] login -> ***************************0ff6d
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation] SEND -> Cmd: LOGIN, Id: 1, len: 32, data: "***************************0ff6d"
Nov 14 18:48:17 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:17 - [info] [blynk-ws-client:HomeAutomation] Client logged
Nov 14 18:48:18 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:18 - [info] [blynk-ws-client:HomeAutomation] Client logged
Nov 14 18:48:18 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:18 - [info] [blynk-ws-client:HomeAutomation] Client logged
Nov 14 18:48:18 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:18 - [info] [blynk-ws-client:HomeAutomation] Client logged
Nov 14 18:48:18 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:18 - [info] [blynk-ws-client:HomeAutomation] RECV <- Cmd: RSP, Id: 1, responseCode: OK
Nov 14 18:48:18 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:18 - [info] [blynk-ws-client:HomeAutomation] Client logged
Nov 14 18:48:18 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:18 - [info] [blynk-ws-client:HomeAutomation] SEND -> Cmd: INTERNAL, Id: 6881, len: 82, data: "ver|0.5.3|h-beat|10|buff-in|32767|dev|node-red|con|Blynk-ws|build|0.7.1 2018-08-04"
Nov 14 18:48:18 rPiHomeAutomation Node-RED[216]: 14 Nov 18:48:18 - [info] [blynk-ws-client:HomeAutomation] RECV <- Cmd: RSP, Id: 6881, responseCode: OK
gablau commented 5 years ago

Hi, is probably some compatibility problem, would you give me the nodered version and the node and npm version? in bash do: npm -n node -v

how did you install the new library? did you just copy the folder? or from the nodered interface?

pathwayx99 commented 5 years ago

Hello,

I installed it using the Node Red interface. Versions below:

pi@rPiHomeAutomation:~ $ npm -v
6.4.1
pi@rPiHomeAutomation:~ $ node -v
v11.1.0
pathwayx99 commented 5 years ago

Also, in case this can be relevant and/or helpful, this is running on a Raspberry Pi B+ with updated firmware:

pi@rPiHomeAutomation:~ $ grep Revision /proc/cpuinfo
Revision        : 0010
pi@rPiHomeAutomation:~ $ uname -a
Linux rPiHomeAutomation 4.14.80+ #1161 Mon Nov 12 18:14:02 GMT 2018 armv6l GNU/Linux
gablau commented 5 years ago

Hi, as you can see here the raccomanded version of nodejs is the 8.x, have you already tried to downgrade the version of nodejs?

Is the "Auth Token" you used for nodered used in some other device? possibly try to give a unique Auth Token for nodered.

pathwayx99 commented 5 years ago

Hi and sorry for the hiatus. Real life... :)

I've seen that the recommended version is 8.x, but no I have not tried downgrading. Strictly speaking, reverting to my previous library was less work and safer.

As for the auth token, it's the one being used on my mobile devices as well to connect to the project, but I assume you mean other Pis, in which case the answer is no. I am running a local server btw.

gablau commented 5 years ago

do not worry, life is like that.

Perhaps it could be a compatibility problem with the local version of blynk-server you use. the protocol went ahead, as for the multiple commands supported only by version 0.34 onwards. What version of the blynk server do you have? Have you tried to remove the check from "Use multiple command" in the configuration node?

pathwayx99 commented 5 years ago

Hi again,

server version: server-0.40.2-java8.jar and yes, I tried to check/uncheck "use multiple command" with no appreciable difference in what I was observing.

gablau commented 5 years ago

Hello, did you solve the problem? Could you try the new v0.8.0 library release? I corrected some problems with the log and the heartbeat. If you want we could better understand the problem, let me have new logs. Regards