Node Red & Blynk Disconnecting

As noted in another thread yesterday in reply to @scargill, I’ve found recently that my Node Red Blynk nodes won’t connect to the Blynk server in SSL anymore. That’s odd, but no big deal at the moment.

However, I now have a similar problem that is a big deal.

I have three Blynk projects running with Node Red at the moment. This morning I discovered that on two of them all the Blynk nodes were showing as disconnected. I redeployed the flow for one of them in Node Red and that forced it to reconnect to Blynk successfully.

But within half an hour or so, that project had disconnected again.

However, the third project hadn’t disconnected at all.

They all have the SSL option UNticked. All three Blynk projects are talking to the same Node Red server (as RasPi on my local network).

Any ideas please as to why I am getting these disconnections, and why it is happening on two of my projects but not the third?

hi, did you have anything in the node red logs to suggest what happened?
are you using blynk.cc or local blynk server?

Here’s an update.

All day while I have been at work my Blynk app has been saying in 2 out of the 3 projects that the RasPi is offline. So I assumed that Node Red had disconnected again. But when I got home and looked at Node Red all the Blynk nodes in all 3 projects still say they are Connected. And the buttons in the Blynk app are actually working and are controlling my lights via the RasPi, even though the app says the Pi is not connected.

I looked at the logs and since 01:40 this morning all I can see is page after page of this:

Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442
Connected
Connected
Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442

Does that help?

PS - forgot to say, it is blynk.cc - but you can probably see that from the log extract. :wink:

hi, that log looks quite weird.
how many blynk servers/keys are you using?
as mentioned in the other thread are you all up to date with node/node-red/blynk js/blynk contrib?

Hi,

I’ve got 3 project pages in the Blynk app - and hence 3 Blynk servers in Node Red.

As far as I’m aware all is up to date.

it does look like some events that went haywire
could you find the log bit just above where

Connecting to TCP: cloud.blynk.cc 8442
Connecting to TCP: cloud.blynk.cc 8442

starts?

Sorry for the delay. I had a look but there was nothing out of the ordinary before that bit.

It ran fine from Tuesday last week until this afternoon when it disconnected again - but again it was only on 1 project out of the 3.

no problem,
the latest build of the blynk-library-js has some more reconnection logic built in, but it s awaiting release on the blynk github
cheers

Just published new NPM package.

1 Like

Thanks, it looks like cured my intermittent crash problems when I used the 0.26 version:

==> app-root/logs/nodejs.log-20160101024918 <==
Listening on 127.8.1.1, server_port 8080
events.js:74
        throw TypeError('Uncaught, unspecified "error" event.');
              ^
TypeError: Uncaught, unspecified "error" event.
    at TypeError (<anonymous>)
    at emit (events.js:74:15)
    at Blynk.error (/var/lib/openshift/*** key ***/app-root/runtime/repo/node_modules/blynk-library/blynk.js:571:8)
    at null.<anonymous> (/var/lib/openshift/*** key ***/app-root/runtime/repo/node_modules/blynk-library/blynk.js:534:48)
    at emit (events.js:95:17)
1 Like