question

usernamepasswordbs avatar image
usernamepasswordbs asked

Node-red disconnects

Hi,

I'm having a problem where Nod-red disconnects all of the time with "Lost connection to server". It reconnects if I re-open it via VRM but will disconnect again a short time later.

It used to stay connected for days at a time but would eventually need re-opening but since a couple of months ago it's a question of minutes.

I haven't changed anything except added a few nodes here and there over that time.

thanks,

Node-RED
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

10 Answers
nickdb avatar image
nickdb answered ·

What GX device are you using?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

usernamepasswordbs avatar image
usernamepasswordbs answered ·

It's a Cerbo

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

nickdb avatar image nickdb ♦♦ commented ·
Ok, so it won't be a resource issue then.

So the issue is accessing it remotely via the VRM proxy which disconnects/timesout?

If you are confident your connection is fine, it could be related to changes on VRM, but as a single case that isn't easy to verify.

I will open a browser tab on mine and see if it behaves itself.

0 Likes 0 ·
nickdb avatar image nickdb ♦♦ commented ·
Ok, can't see that behaviour. Eventually the tunnel expires and you get a warning to that extent.

I would check your connectivity and see if anything might have changed.

0 Likes 0 ·
usernamepasswordbs avatar image
usernamepasswordbs answered ·

On the "console" it says "Websocket connection failed", "Error during handshake Error 403"

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

usernamepasswordbs avatar image
usernamepasswordbs answered ·

I have been reading a lot of things which are above my head but the one thing that makes sense is a comment somewhere that "the token has expired" which ties in with your " tunnel expires". This makes sense as I have no trouble reconnecting manually but why does the tunnel expire so soon and can I extend its active time ?

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

nickdb avatar image nickdb ♦♦ commented ·
I suspect its one of two things - a timeout that exists on how long the connection may remain open, or, the browser reports no activity and disconnects.

Tunnels tend to have idle timeouts to conserve resources but it shouldn't be that short.

0 Likes 0 ·
usernamepasswordbs avatar image
usernamepasswordbs answered ·

No, and it never used to be that short.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

nickdb avatar image nickdb ♦♦ commented ·
It has a 30 minute session timeout. The session is kept alive by http requests.

If there are no requests, it will end the session.

Depending what node red is up to, there could be constant requests (unless your device goes to sleep, for example).

The easiest way to check is to use the browsers dev tools to do traffic inspection, if there are requests it should stay connected, in which case you have a different issue.

I can't reproduce this on my systems, it times out if I switch tabs and the vrm tab effectively goes to sleep.


0 Likes 0 ·
usernamepasswordbs avatar image
usernamepasswordbs answered ·

That's probably about it, 30 minutes, but it didn't time out like that before. It would be great if there was a way to extend that period as I don't look at my Node-red page all the time but, when I do, it would be less hassle if it was actually connected. Sometimes I just want to adjust heating settings and it's not connected and I have to re-log in and all that.

By the way, thanks for your input, it is much appreciated.

Thanks,

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

nickdb avatar image nickdb ♦♦ commented ·
Not knowing your setup, I can suggest the following, you may well have done it already.

Are you connecting to the nodered "flow" pages and bumping triggers to make stuff happen, or have you built yourself a nodered dashboard?

If you haven't done the latter, construct a basic dash with a switch and an active element showing temp or something that updates with some regularity.

See if that helps.

Did you make any changes to your flows prior to the issue appearing?

Try another browser? Safari likes to go to sleep as an example.

If you are on a official venus release, try the beta, just to rule out anything there, it is easy enough to rollback versions.

The VRM gods didn't tell me if any changes were recent, there is constant change and work to try reduce the demands on the platform, so it's not impossible you have run into an "improvement" but I can't confirm or deny.

As a plan B, if your internet setup can, you could always configure your router to allow SSL VPN's, so you could tunnel in remotely and then connect directly to your local, LAN interface.

0 Likes 0 ·
usernamepasswordbs avatar image
usernamepasswordbs answered ·

Sounds like brilliant advice @nickdb , I will have to digest that a bit and then try those things you have suggested.

Thanks again and I will repost when I have an update to give.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

usernamepasswordbs avatar image
usernamepasswordbs answered ·

Done the dashboard with Victron node "Grid meter" as the regularly updating element but I get "connection lost" on the dash after some minutes. That's on Edge and Chrome.

I don't think my router box is capable of VPN as I remember trying for many hours one day to get a way of connecting to the cerbo remotely when on holiday. I never managed it and I think I need one of the more recent models of internet boxes to do that. Mine's from 2017 !!

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

nickdb avatar image nickdb ♦♦ commented ·

This is such an uncommon issue, I can only think, short of reflashing the GX, that your connection has become unstable in some way.

Your router may provide some stats for the WAN connection, which may help show if that is contributing.

Sorry, wish I could be more helpful, but it does not appear to be a broader platform issue.

You're not using both LAN and wifi connections by any chance?


0 Likes 0 ·
usernamepasswordbs avatar image usernamepasswordbs nickdb ♦♦ commented ·
No, Lan only.
0 Likes 0 ·
usernamepasswordbs avatar image
usernamepasswordbs answered ·

Hi,

I have accessed Node-Red via http(s) rather than using the "Venus OS Large" in the VRM menu, I have also been into settings on chrome, settings/performance/"always keep these sites active" and added the VRM and Node-Red sites and it seems to be staying connected !!

Not sure which change has sorted it but, for now, it seems to do the right thing.

Thanks for your help!

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

usernamepasswordbs avatar image
usernamepasswordbs answered ·

Just to confirm, when I access Node-Red via the VRM menu, venus OS large Features/Node-Red, it disconnects after a short time. When accessed via https://venus.local:1881 it stays connected without any problems.

Possibly something on the VRM site has changed.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.