node-red-contrib-blynk icon indicating copy to clipboard operation
node-red-contrib-blynk copied to clipboard

Doesn't recover from server down

Open scargill opened this issue 9 years ago • 109 comments

It SEEMS that the only way this recovers from the Blynk server being temporarily down - is to restart node-red... any chance of working on that?

scargill avatar Nov 21 '15 20:11 scargill

+1 for that, I have same same critical issue, I am currently using Blynk cloud so when away from home if the blynk server "goes down" or " I lose connection or whatever" Its not that easy to restart node-red.

Toshibass avatar Nov 23 '15 08:11 Toshibass

hi guys, any node red log files would be very helpful.

tzapu avatar Nov 23 '15 10:11 tzapu

As soon as I am at a desk.. certainly

On 23 November 2015 10:34:28 tzapu [email protected] wrote:

hi guys, any node red log files would be very helpful.


Reply to this email directly or view it on GitHub: https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-158900059

scargill avatar Nov 23 '15 11:11 scargill

have a good trip ;)

btw guys, i m experiencing the following issue randomly, resulting in a node red crash, maybe it is related. i get error

Assertion failed: (0), function uv_err_name, file ../deps/uv/src/uv-common.c, line 75.

have you seen anything similar? does your node red keep running (or being auto restarted) when the connection goes down, or is it dead as well?

tzapu avatar Nov 23 '15 11:11 tzapu

I don't see any errors in the node-red log for issue #16 just red dot "not connected" on the node, the ONLY way to get the blynk nodes reconnected is to reboot node-red, then I get a green dot "connected" on the node.

Regarding random issue, crashing node-red, I had only 2 a month apart as follows:

26 Oct 16:23:18 - [red] Uncaught Exception: 26 Oct 16:23:18 - Error: write EPIPE at exports._errnoException (util.js:746:11) at WriteWrap.afterWrite (net.js:775:14)

22 Nov 12:41:02 - [info] Started modified flows <--- 12.41pm (midday) was the last time I started a modified flow 23 Nov 01:39:50 - [red] Uncaught Exception: <--- Exception happened 1.39am (not like 48 minutes after starting flows) 23 Nov 01:39:50 - Error: write EIO at exports._errnoException (util.js:746:11) at WriteWrap.afterWrite (net.js:775:14)

One final point I don't use pm2 to auto start/stop node-red currently, I use a .sh file activated in rc.local when the raspi boots... just a wondering if using pm2 would be advantageous.

Toshi

Toshibass avatar Nov 23 '15 12:11 Toshibass

Well all I can say about pm2 is regardless of the odd crash in node red it ALWAYS restarts

On 23 November 2015 06:08:14 Toshibass [email protected] wrote:

I don't see any errors in the node-red log for issue #16 just red dot "not connected" on the node, the ONLY way to get the blynk nodes reconnected is to reboot node-red, then I get a green dot "connected" on the node.

Regarding random issue, crashing node-red, I had only 2 a month apart as follows:

26 Oct 16:23:18 - [red] Uncaught Exception: 26 Oct 16:23:18 - Error: write EPIPE at exports._errnoException (util.js:746:11) at WriteWrap.afterWrite (net.js:775:14)

22 Nov 12:41:02 - [info] Started modified flows <--- 12.41pm (midday) was the last time I started a modified flow 23 Nov 01:39:50 - [red] Uncaught Exception: <--- Exception happened 1.39am (not like 48 minutes after starting flows) 23 Nov 01:39:50 - Error: write EIO at exports._errnoException (util.js:746:11) at WriteWrap.afterWrite (net.js:775:14)

One final point I don't use pm2 to auto start/stop node-red currently, I use a .sh file activated in rc.local when the raspi boots... just a wondering if using pm2 would be advantageous.

Toshi


Reply to this email directly or view it on GitHub: https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-158916174

scargill avatar Nov 23 '15 22:11 scargill

guys, this is the behaviour of the blynk js library mentained by the guys at blynk. i will try to come up with a solution and issue a pull request to them.

tzapu avatar Nov 24 '15 05:11 tzapu

guys, created a pull request, as soon as it is merged this should be fixed after doing an update of the blynk-library package https://github.com/vshymanskyy/blynk-library-js/pull/11

tzapu avatar Nov 24 '15 06:11 tzapu

That's great, I had another crash this morning seams as soon as I tried to log on to node-red according to the times

23 Nov 18:54:38 - [info] Started modified flows 24 Nov 09:27:26 - [red] Uncaught Exception: 24 Nov 09:27:26 - Error: write EIO at exports._errnoException (util.js:746:11) at WriteWrap.afterWrite (net.js:775:14)

I think I will try pm2 once I get time today.

Toshibass avatar Nov 24 '15 09:11 Toshibass

Just saw the pull request, just to be clear @scargill is using local server and android I am using blynk cloud and Iphone so the issue appears to be a global one.

Toshibass avatar Nov 24 '15 18:11 Toshibass

hi, the pull request has been merged, but they also need to release a new version of the lib before it can be updated to the fix will be a gobal one as well, it will even work for espruino or whatever else they support in their js lib

tzapu avatar Nov 25 '15 06:11 tzapu

the pull request was accepted and the new version of the blynk lib released. if you update both that and node red contrib blynk you should have auto reconnect on server going away

tzapu avatar Dec 01 '15 07:12 tzapu

Hi tzapu .. Ok I Just did a update.

(one point about that, I didn't install the blynk lib separately, I use the one that comes with node-red-contrib-blynk so I just ..sudo npm uninstall node-red-contrib-blynk then install it again) so currently "blynk-library", "version": "0.0.24", & "node-red-contrib-blynk", "version": "0.0.17"

Re Node-red .. there was a maintenance release yesterday which solves the "EventEmitter memory leak detected. 11 listeners...." issue.

Obviously time will tell if the updated blynk lib will resolve this #16 issue, I will report back after a period of use,

Thanks for your continued support.

Toshi

Toshibass avatar Dec 01 '15 10:12 Toshibass

NOT solved.

Tonight – “your generic board is not in the network” – I went to Node-Red and the Blynk node had failed. The App was getting history so server ok but it must’ve gone off at sometime during the evening. A reset of Node-Red (latest release) brought it back up – but the node is NOT recovering from server down.

Pete.

From: Toshibass [mailto:[email protected]] Sent: 01 December 2015 10:19 To: tzapu/node-red-contrib-blynk [email protected] Cc: Peter Scargill [email protected] Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

Hi tzapu .. Ok I Just did a update.

(one point about that, I didn't install the blynk lib separately, I use the one that comes with node-red-contrib-blynk so I just ..sudo npm uninstall node-red-contrib-blynk then install it again) so currently "blynk-library", "version": "0.0.24", & "node-red-contrib-blynk", "version": "0.0.17"

Re Node-red .. there was a maintenance release yesterday which solves the "EventEmitter memory leak detected. 11 listeners...." issue.

Obviously time will tell if the updated blynk lib will resolve this #16 https://github.com/tzapu/node-red-contrib-blynk/issues/16 issue, I will report back after a period of use,

Thanks for your continued support.

Toshi

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-160925848 . https://github.com/notifications/beacon/ABzUg7WrusOMoK_6LW02-rv7EVryGZxEks5pLWuIgaJpZM4Gm_QF.gif

scargill avatar Dec 02 '15 04:12 scargill

@Toshibass "blynk-library", "version": "0.0.24", & "node-red-contrib-blynk", "version": "0.0.17" is right. @scargill i need a way to replicate your server going down then... if you quit the blynk server app and restart it, does it reconnect alright ? maybe when it dies, it dies in a different kind of way

tzapu avatar Dec 02 '15 10:12 tzapu

You are right. I’ve just done tests. Manually stopping and starting the Blynk server does NOT cause a problem. The whole thing recovers in a matter of several seconds. So it must be something else. I will wait for the next problem and send logs.

From: tzapu [mailto:[email protected]] Sent: 02 December 2015 10:19 To: tzapu/node-red-contrib-blynk [email protected] Cc: Peter Scargill [email protected] Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

@Toshibass https://github.com/Toshibass "blynk-library", "version": "0.0.24", & "node-red-contrib-blynk", "version": "0.0.17" is right. @scargill https://github.com/scargill i need a way to replicate your server going down then... if you quit the blynk server app and restart it, does it reconnect alright ? maybe when it dies, it dies in a different kind of way

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-161248655 . https://github.com/notifications/beacon/ABzUg0gRwNOMgOJXMBBvn3iP_UpyoZFCks5pLrz5gaJpZM4Gm_QF.gif

scargill avatar Dec 02 '15 12:12 scargill

I found and fixed an issue with Node-red - and so now my Node-Red/Pi installation runs without issue… however…

This morning I noted that the Android App said my installation was offline – sure emough I looked at Node Red – everything working EXCEPT the Blynk nodes – all with red circles. PM2 RESTART NODE-RED – and they were up and running… so clearly there is still an issue where the node does NOT come back up after a problem even though the local BLYNK server is running..

Don’t know if this helps – BLYNK LOG

00:35:15.232 INFO - [email protected] app joined.

02:37:30.395 INFO - [email protected] app joined.

03:18:18.766 INFO - [email protected] app joined.

04:29:08.117 INFO - [email protected] app joined.

06:06:09.310 INFO - [email protected] app joined.

06:06:11.069 ERROR - User has exceeded message quota limit.

07:50:37.612 INFO - [email protected] app joined.

08:06:18.690 INFO - [email protected] app joined.

08:09:50.750 INFO - [email protected] app joined.

08:35:33.285 INFO - [email protected] app joined.

09:49:26.579 INFO - [email protected] app joined.

10:05:09.537 INFO - [email protected] app joined.

10:26:51.624 INFO - [email protected] app joined.

11:45:51.682 INFO - [email protected] app joined.

11:45:53.073 ERROR - User not logged. /81.174.144.64:44953. Closing.

11:45:55.632 INFO - [email protected] app joined.

11:48:06.295 INFO - [email protected] hardware joined.

From: Peter Scargill [mailto:[email protected]] Sent: 02 December 2015 12:28 To: 'tzapu/node-red-contrib-blynk' [email protected]; 'tzapu/node-red-contrib-blynk' [email protected] Subject: RE: [node-red-contrib-blynk] Doesn't recover from server down (#16)

You are right. I’ve just done tests. Manually stopping and starting the Blynk server does NOT cause a problem. The whole thing recovers in a matter of several seconds. So it must be something else. I will wait for the next problem and send logs.

From: tzapu [mailto:[email protected]] Sent: 02 December 2015 10:19 To: tzapu/node-red-contrib-blynk <[email protected] mailto:[email protected] > Cc: Peter Scargill <[email protected] mailto:[email protected] > Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

@Toshibass https://github.com/Toshibass "blynk-library", "version": "0.0.24", & "node-red-contrib-blynk", "version": "0.0.17" is right. @scargill https://github.com/scargill i need a way to replicate your server going down then... if you quit the blynk server app and restart it, does it reconnect alright ? maybe when it dies, it dies in a different kind of way

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-161248655 . https://github.com/notifications/beacon/ABzUg0gRwNOMgOJXMBBvn3iP_UpyoZFCks5pLrz5gaJpZM4Gm_QF.gif

scargill avatar Dec 06 '15 11:12 scargill

06:06:11.069 ERROR - User has exceeded message quota limit. hi, this is a bit worrying. since it is your manual installation, could you increase the quota limit to something silly and see what happens? cheers

tzapu avatar Dec 07 '15 06:12 tzapu

A little more info would help – I’m not sure where I’m supposed to do that??

Pete.

From: tzapu [mailto:[email protected]] Sent: 07 December 2015 06:01 To: tzapu/node-red-contrib-blynk [email protected] Cc: Peter Scargill [email protected] Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

06:06:11.069 ERROR - User has exceeded message quota limit. hi, this is a bit worrying. since it is your manual installation, could you increase the quota limit to something silly and see what happens? cheers

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-162418504 . https://github.com/notifications/beacon/ABzUgwwTV5VtrnIlF5mZUI_RwXv-Qx2Dks5pNRgfgaJpZM4Gm_QF.gif

scargill avatar Dec 07 '15 06:12 scargill

let me check. i have seen something similar with blynk.cc and only when connecting the app to the server. it would cause a flood of requests on my esps which in turn kill the connection so they would have to reconnect

tzapu avatar Dec 07 '15 06:12 tzapu

from what they are saying here https://github.com/blynkkk/blynk-server under advanced setup, you have a property that you need to set

user.message.quota.limit=100

as per example config file https://github.com/blynkkk/blynk-server/blob/master/server/tcp-server/src/main/resources/server.properties

since this is a local instalation for you, you should not run into quota limitations at all maybe it is linked

tzapu avatar Dec 07 '15 06:12 tzapu

Right – I’ve added the file and taken that up to 250 max. Let’s see what happens and thanks for that. I’ll report back in a few days.

From: tzapu [mailto:[email protected]] Sent: 07 December 2015 06:09 To: tzapu/node-red-contrib-blynk [email protected] Cc: Peter Scargill [email protected] Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

from what they are saying here https://github.com/blynkkk/blynk-server under advanced setup, you have a property that you need to set

user.message.quota.limit=100

as per example config file https://github.com/blynkkk/blynk-server/blob/master/server/tcp-server/src/main/resources/server.properties

since this is a local instalation for you, you should not run into quota limitations at all maybe it is linked

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-162419365 . https://github.com/notifications/beacon/ABzUg46u3gOiTM7tI_cs0-UhNxwvoTP8ks5pNRoAgaJpZM4Gm_QF.gif

scargill avatar Dec 07 '15 06:12 scargill

really curiosu to see what will happen. if it were to default to 10 connections in the absence of that file, it would exaplain disconnecting node red (although it doesn t yet explain why it wouldn t reconnect)

tzapu avatar Dec 07 '15 06:12 tzapu

Well it is now set in 2 completely isolated installations – so with luck I’ll know in a matter of days if it has made a difference and will report back.

Pete

From: tzapu [mailto:[email protected]] Sent: 07 December 2015 06:41 To: tzapu/node-red-contrib-blynk [email protected] Cc: Peter Scargill [email protected] Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

really curiosu to see what will happen. if it were to default to 10 connections in the absence of that file, it would exaplain disconnecting node red (although it doesn t yet explain why it wouldn t reconnect)

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-162425386 . https://github.com/notifications/beacon/ABzUg0vEJ_Uh2_c_TzZVzRybtBR4prmcks5pNSGEgaJpZM4Gm_QF.gif

scargill avatar Dec 07 '15 06:12 scargill

Not entirely sure what happened here as I’ve not changed anything and I’m not using secure… This morning I noted that my my Node-Red installation in Spain (max increased to 250 as per earlier conversation) showed Blynk as dead….

Here is the log..

07:25:35.185 INFO - [email protected] hardware joined.

07:25:35.190 INFO - [email protected] hardware joined.

07:26:56.900 INFO - Using data dir '/var/blynk'

07:27:04.904 ERROR - Error parsing file '/var/blynk/server.properties'.

07:27:04.904 ERROR - Error parsing file '/var/blynk/admin-0.11.3.jar'.

07:27:04.904 ERROR - Error parsing file '/var/blynk/mail.properties'.

07:27:04.904 ERROR - Error parsing file '/var/blynk/server-0.11.3.jar'.

07:27:04.907 ERROR - Error parsing file '/var/blynk/server-0.11.3.jar.pid'.

07:27:07.268 INFO - Initializing mail transport. Username : [email protected]. SMTP host : smtp.gmail.com:587

07:27:13.256 INFO - Plain tcp/ip hardware server port 8442.

07:27:13.264 WARN - ATTENTION. Certificate /var/blynk and key /var/blynk paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.

07:27:19.894 INFO - SSL hardware port 8441.

07:27:19.924 INFO - Enabling SSL for application.

07:27:19.925 WARN - ATTENTION. Server certificate paths cert : '/var/blynk', key : '/var/blynk' - not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.

07:27:21.686 INFO - Application server port 8443.

07:27:21.703 INFO - Administration server port 8777.

07:27:43.689 INFO - [email protected] hardware joined.

A quick restart of Node-Red (pm2 restart node-red) – and all is well !!!

Any ideas?

From: tzapu [mailto:[email protected]] Sent: 07 December 2015 06:01 To: tzapu/node-red-contrib-blynk [email protected] Cc: Peter Scargill [email protected] Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

06:06:11.069 ERROR - User has exceeded message quota limit. hi, this is a bit worrying. since it is your manual installation, could you increase the quota limit to something silly and see what happens? cheers

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-162418504 . https://github.com/notifications/beacon/ABzUgwwTV5VtrnIlF5mZUI_RwXv-Qx2Dks5pNRgfgaJpZM4Gm_QF.gif

scargill avatar Dec 08 '15 06:12 scargill

hi

this 07:27:04.904 ERROR - Error parsing file '/var/blynk/server.properties'. would suggest it s not using the file. I don t know what all those errors mean really.

I am more interested anyway on the node-red side of the log, if possible, when it disconnected. I must setup a local server for myself i guess as i m not using one and let it running for a while.

tzapu avatar Dec 08 '15 06:12 tzapu

Another one for you..

This morning the Blynk nodes were dead again – a quick restart of Node-Red again brought them back to life. I checked – the Pi has not reset for over 2 days (and that was deliberate). For a second I wondered if it was down to Node-Red starting before the Blynk server but that theory is now dead.

Nothing in any of the Blynk logs to suggest any problems.

Pete.

From: tzapu [mailto:[email protected]] Sent: 08 December 2015 06:59 To: tzapu/node-red-contrib-blynk [email protected] Cc: Peter Scargill [email protected] Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

hi

this 07:27:04.904 ERROR - Error parsing file '/var/blynk/server.properties'. would suggest it s not using the file. I don t know what all those errors mean really.

I am more interested anyway on the node-red side of the log, if possible, when it disconnected. I must setup a local server for myself i guess as i m not using one and let it running for a while.

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-162795162 . https://github.com/notifications/beacon/ABzUg4KcxwLcuBVpJDLC_P9DYi36R-2Kks5pNnc1gaJpZM4Gm_QF.gif

scargill avatar Dec 09 '15 07:12 scargill

hi, i d like to see the node-red log at the moment of disconnection cheers

tzapu avatar Dec 09 '15 08:12 tzapu

I have attached the node-red log file…

From: tzapu [mailto:[email protected]] Sent: 09 December 2015 08:07 To: tzapu/node-red-contrib-blynk [email protected] Cc: Peter Scargill [email protected] Subject: Re: [node-red-contrib-blynk] Doesn't recover from server down (#16)

hi, i d like to see the node-red log at the moment of disconnection cheers

— Reply to this email directly or view it on GitHub https://github.com/tzapu/node-red-contrib-blynk/issues/16#issuecomment-163145889 . https://github.com/notifications/beacon/ABzUg_Cgvwm_Zka91_Fpey5l_WUbkDn0ks5pN9i3gaJpZM4Gm_QF.gif

scargill avatar Dec 09 '15 08:12 scargill

hi @scargill , i may be slow (so excuse me in advance), but all I am seeing above are blynk server logs, not node red logs...

tzapu avatar Dec 09 '15 11:12 tzapu