Dashboard Error "Connection Lost"

When I do a manual update the same problem does not appear, that is. I will try to be as explicit as possible.
When I log the Node-Red and then go to the browser and enter the ip (example 10.6.4.101:1880/ui/#/0) of the Node-red, the dasboard normally appears, however if I do not refresh manually, after a period of time of about 10 minutes, the browser automatically refreshes and it is at that moment that Connection Lost appears, and after less than a second, the graphs and the sensor indicators reappear and show me the values ​​again, and at the end of again about 10 minutes if I do not refresh, he does the same again. I tried to be as explicit as possible.

You still have not said, if you hit Refresh in the browser while it is working correctly does it show disconnected?

[Edit] Also, are you using any ui_control nodes in your flow?
Also if you have two PCs connected do they both lose connection at the same time?

Let's be clear here.

This Dashboard works fine on a PC - yes?

The Dashboard keeps disconnecting on a Mobile Phone - yes?

If that is the case, the issue is most likely with the mobile phone not the Dashboard or Node-RED.

I've seen this happen regularly and I strongly suspect it is something to do with the power saving that mobiles do.

To really get to the bottom of this, you need a mobile browser that lets you see a developer dashboard. This would let you see what is happening at the network level.

Hey, Im also having the same issue on the computer .

Even with diferent PCs or diferent browsers it happens randomly.

Another problem is after I manually update the page, the image just turns white and I have to clean the cookies to see the dashboard again

when it is working normally does not appear to say that it is disconnected, after 10 minutes the message Connection Lost appears and then the message disappears when the browser refresh alone.

Solution for "Connection lost" in the Dashboard using Google Chrome, because Chrome when it is installed, it has the automatic refresh of tabs active and then it is necessary disable that, the process is as follows:

Open Google Chrome

copy this the URL bar --->> chrome://flags/#automatic-tab-discarding

in the topic Automatic tab discarding change Enable to Disable

copy this the URL bar --->> chrome://flags/#enable-offline-auto-reload-visible-only

in topic Only Auto-Reload Visible Tabs change Enable to Disable

Close Google Chrome

Open Google Chrome again

1 Like

Well I never knew that even existed... so well done for finding it.
And for reporting it here for others,

in other browsers the same problem happens, it is necessary to disable Auto Refresh but I do not know how to do it in others because I am using Chrome and I looked for it.

Sharing knowledge makes us all win and evolve this Node-Red community.

I also encounter the lost connection issue in Chrome browser after update Node-Red-Dashboard to the latest release version.
!! note that it has no issue when run on MS Edge, also Node-red Editor no issue.

My configuration:
Enable HTTPS with Username and Password protected
Node-Red-Dashboard 2.13.2
Node-Red 0.19.5
Node 10.13.0
Nodejs 8.12.0
NPM 6.4.1

I thought node and nodejs were the same, depending on the system installed on. Am I incorrect?

Do you know if Chromium has these same defaults? If not, it'd seem to explain my observations completely -- I use Chrome on the cellphones and Chromium on my desktop.

Pasting your URL into Chromium I see a really long list of "Warning advanced features ahead" with no Automatic tab discarding found with a search for "Automatic".

Did the fix posted by @smalhao work for you?
How did you get the versions for Node and Nodejs, it sounds as if you might have two versions installed.

I can't find any evidence that Firefox has an auto refresh capability, though there are add-ons you can get to provide that feature.

Yes, one is an old-style install and the other is the new. You have 2 different versions installed.

his site explains how to turn off auto refresh in Firefox

https://www.supportrix.com/kb/how-to-turn-off-the-auto-refresh-function-on-your-internet-browser/

For Chromium i do not found anything, only i found for Firefox, Opera and Chrome.

That is a different thing. That is preventing a website asking for a refresh. The situation in this thread (as I understand it) was that Chrome was automatically refreshing the page by itself.

Opera and Firefox have the same problem, and is necessary disble the auto refresh for not refreshing the page by itself

I'm afraid I've lost track of this thread - why is Chrome reloading a page? Why isn't this a common problem if it is happening? Until recently, I was using Chrome and used it for some years with UI/Dashboard without any problems. I'm confused.

The flag mentioned "chrome://flags/#enable-offline-auto-reload-visible-only" is purely for automatically retrying pages that weren't available when offline. Let me say again that I use the standard flags and I am not seeing this issue so I'm confused.

Unless you are saying that, for you, when the browser auto-reloads it doesn't reconnect the socket? Can we see the network log from the browser please - this is not my experience on any browser.

I have also been using the node-red-dashboard for a few years and with Chrome. Since Feb 2019 I am now seeing the issue described here, and the suggestions on the Chrome advance settings don't work for me. I can confirm that MS Edge browser works fine (Windows 10). I just did a full update of the full npm packages and the situation went from "sometimes works" to "nope". When you open the dashboard the "Connection lost" starts and refreshes every second or so. If you hit Refresh or F5 the error stops but you're left with a blank screen which doesn't update.
My configuration:
Raspberry Pi Zero
Enabled HTTPS with Username and Password protected
Node-Red-Dashboard 2.14.0
Node-Red 0.19.4
Nodejs 8.11.1
NPM 6.8.0

Since the update, Chrome on my iPhone also stops working. Safari doesn't even try due to the untrusted HTTPS site (self certified). Any hints on debug would be welcome.

I think that is a different issue to the one described earlier. However I have also seen that occasionally, but couldn't tie it down. I had a suspicion that it was something to do with unused config nodes so make sure you have none of them (you get a message in the Deployed popup if there are). Also try restarting node-red.