tzapu / node-red-contrib-blynk

Blynk app integration with Node Red
MIT License
17 stars 5 forks source link

node-red deploy issue #18

Open Toshibass opened 8 years ago

Toshibass commented 8 years ago

I have had this problem for about a week now but didn't say anything because I hoped the resolution of #16 may have also resolved this problem but it doesn't...and I am not even sure its a node-red-contib-blynk issue, just wondering if you have any idea what's going on..?

The problem .. I have 4 blynk server connections, when I fully re-deploy node-red, 3 of the servers from connecting to connect take about 2 seconds but the 4th always takes ages like 3-4 minutes, its always the same server connection that has this problem and its every time I deploy nr here's the log:

1 Dec 10:43:16 - [info] Starting flows Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 1 Dec 10:43:46 - [info] Started flows Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 1 Dec 10:43:46 - [info] [mqtt-broker:8084e98a.7f7b18] Connected to broker: mqtt://192.168.0.98:1883 Connected Authorized 1 Dec 10:43:47 - [info] [blynk-server:c1c8f31f.3e371] key: 0cc7 bla bla connected Authorized 1 Dec 10:43:47 - [info] [blynk-server:39b0b4e1.c64f4c] key: 2972 bla bla connected Connecting to SSL: cloud.blynk.cc 8441 Connected Authorized 1 Dec 10:43:49 - [info] [blynk-server:c3307c50.3ccf8] key: f165 bla bla connected Connecting to SSL: cloud.blynk.cc 8441 Connected Connecting to SSL: cloud.blynk.cc 8441 Connected

same same repeated for in this case nearly 3 minutes until

Connecting to SSL: cloud.blynk.cc 8441 Connected Authorized 1 Dec 10:46:11 - [info] [blynk-server:7f2dce8b.80d23] key: adf0 bla bla connected

As you can appreciate its very frustrating having to wait 3-4 minutes for node-red to be working when you are developing a flow,

To ensure its not a problem with my code, I deleted the flow and pasted it into another instance of node-red on a pizero in this case the 3 remaining flows still load within seconds and the flow on the pizero also loads within seconds ...

Its almost like Blynk gets confused/overloaded when connecting to multiple server instances.

tzapu commented 8 years ago

i winder if this could be in some way linked to blynk server connection rate limiting... i need to test it myself in the mean time, if you can in a new flow, does having just one connection cause any issues?

Toshibass commented 8 years ago

Not sure I get your meaning, like I said I removed the flow that takes ages to load and pasted it into a different instance of node-red on a different pi, Result was it loads within seconds and so does the 3 remaining flows on my original pi.

Toshibass commented 8 years ago

Whoops that went wrong - Or do you mean, " just one connection " .. just one node?

tzapu commented 8 years ago

sorry, i meant just one token/server combo i think there is some rate limiting on blynk.cc, but i do not know if it would affect the connecting part as well

it kind of seems it does. if you add 3 server connections on the pi0 , does it behave the same?

Toshibass commented 8 years ago

Over the last 2 days here is what I have been testing:-


This is a pi2 running wheezy node-red v0.12.2 node.js v0.12.6 blynk v0.0.24 contrib-blynk v0.0.17 I loaded a node-red blank canvas and made 4 sheets with 1 inject node and 1 blynk write node on each sheet, each write node connects to an existing watch-dog led on 4 separate blynk servers, when I deploy node-red each node connects to its respective server immediately, so it appears the issue has nothing to do with "blynk server connection rate limiting" . deploying original flows still results in 3-4 minute load issue I also had to reboot node-red on 1 occasion due to issue #16 / #19


This is a pizero running noobs jessie with node-red pre installed v0.12.2 node.js v0.10.29 blynk v0.0.24 contrib-blynk v0.0.17 Then I exported all my original flows and imported them into the node-red instance on my pizero expecting the same issue but that's not what happened, all of the flows load within 10 seconds no sign of the 3 to 4 minute delay issue.


This is a pi b+ running wheezy node-red v0.12.2 node.js v0.12.6 blynk v0.0.24 contrib-blynk v0.0.17 importing & deploying original flows results in 3-4 minute load issue Downgrade node.js to v0.10.36 (because I couldn't find v0.10.29) flows load within 10 seconds no sign of the 3 to 4 minute delay issue.


So now I have 3 pi's with the original flows imported and I can switch between them recreating the issue and resolving it depending which one I use, so it appears to me the issue is related to the node.js version. I also notice that during the last 36 hrs test period pi b+ with node.js v0.10.36 I had no issues due to #16 / #19


So the question: is there a preferred node.js version associated with blynk / contrib-blynk. Of coarse I can down grade node.js on my pi2 to try it but didn't want to do that to soon as you may want some more info, so I propose to leave pi b+ running for a few days to see if it solves #16 / #19 as well.

Toshi

tzapu commented 8 years ago

wooow, nice going. for reference i've got Node.js version: v0.12.7 and am not seeing this, but i only use it to test stuff, it s not a complicated deployment like yours. looking forward to what results you get. if it disconnects, please find the node-red log pertinent to the moment it disconnects and what happened right above that. cheers

tzapu commented 8 years ago

btw, by "4 separate blynk servers" upi mean 4 blynk.cc project keys, right?

Toshibass commented 8 years ago

Yes 4 separate servers/project keys, in fact there the same 4 servers as original, each of the servers has a watch-dog led already so I just made the new write nodes switch just the existing watch-dog leds on each server page in the app.

Here's the log for the disconnect detailed in para 2 of my post.

Authorized 3 Dec 08:48:27 - [info] [blynk-server:c1c8f31f.3e371] key: bla bla connected Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 Connecting to SSL: cloud.blynk.cc 8441 3 Dec 09:17:42 - [red] Uncaught Exception: 3 Dec 09:17:43 - Error: write EIO at exports._errnoException (util.js:746:11) at WriteWrap.afterWrite (net.js:775:14)