# Connection Lost After Some Time

**URL:** <https://discourse.nodered.org/t/connection-lost-after-some-time/30000>\
**Category:** General\
**Created:** [13 July 2020 13:10 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000 "2020-07-13T13:10:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 13:10 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/1 "2020-07-13T13:10:29Z")

</div>

Hi. Project works fine for a while, nearly an hour, then, it says "Connection Lost". I try to deploy again, but it never happens. Says "no response from server". I reboor/shutdown, and I see an empty flow named "Flow 1". I don't know why it keeps getting deleted... I keep getting it back from the backup file, but this is killing the use for a second time. This needs to be fixed.

I downloaded xscreensaver, and disabled it. Thought maybe this could help. I may need to do something on the browser (Chromium) too. I saw other people mentioning changing stuff on Google Chrome to solve this issue, but there was no explanation for Chromium, when someone asked on that post.

When I get it back from the backup, and deploy, it says something like "There are nodes that changed". Then, I click on "Review Changes". Then, I click on "Merge". It works fine like this, but this happens every single time, after I see "Connection Lost".

I am open to any advices to any of the problems above.

Edit: This is the post I was talking about, where people tried to solve this issue for Google Chrome, but no answer for Chromium.

> [@Dashboard Error "Connection Lost"](https://discourse.nodered.org/t/dashboard-error-connection-lost/7965):
>
> I'm having a problem with the dashboard which is as follows, sometimes when the Google Chrome browser does refresh I get a "Connection Lost" error. The sensor data upload server is connected to the network and I am programming the node-red to access this data on a VM Ware Windows7 machine and I access the dashboard on a physical computer with Linux Deepin, I have already cleared the navigation history of Google Chrome both in VM Ware and Linux and continue with this error, because the server is …

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 July 2020 13:31 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/2 "2020-07-13T13:31:52Z")

</div>

Are you powering off or just re-boooting?  
If you restore the flow file and check it works then immediately reboot (power off if that is what you have been doing) is it still there? If gone then put it back, check it works, stop node red and disable the service (on a Pi this would be `sudo systemctl disable nodered`) and check it is still there. Then reboot and see if it has gone. If it has gone then, if it is on an SD card, chuck it in the bin and use a new one.

If it isn't that then start node-red in a terminal so that the startup log appears in the terminal. Then leave it running till it fails and see what is in the log.

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 14:08 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/3 "2020-07-13T14:08:50Z")

</div>

I am using this to get temperature value:

> **[node-red-contrib-sensor-ds18b20](https://flows.nodered.org/node/node-red-contrib-sensor-ds18b20)**
>
> Node-RED node to get temperature in centigrades from DS18B20 sensors

This gives you a dropdown with all sensors you have. Whenever this fails to show 1 or more in the list, I see the "Connection Lost" at the same time with it. I keep getting that error... It is not refreshing, stays there, forever.

Sometimes I reboot, someties I shut it down. Same results mostly. It sometimes works after that, sometimes doesn't. Your advice is to use a new SD card?

There are no problems in the log.

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 14:12 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/4 "2020-07-13T14:12:06Z")

</div>

After "Merge" option appears and when it is done in a second or so, it works really fast and perfectly fine. This happened again. I did small changes (not like infinite loops or anything that can break it), deployed 6-7 times in 2-3 minutes. Last one took really long, and I got the no response error. Now, the problem is back. I don't understand why this is happening...

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 July 2020 14:34 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/5 "2020-07-13T14:34:36Z")

</div>

You said the flow file keeps getting deleted. Is that happening? Show us a directory listing of the .node-red folder before and after it gets deleted.

Are you running the browser on the pi?  
Are you using charts? If so how often are you adding data to the charts and how many lines are there?

Post the log here from startup to failure (use the `</>` button and paste it here. Copy/paste the text if possible please, not a screenshot.

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 14:41 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/6 "2020-07-13T14:41:38Z")

</div>

I'll try to do the first one now.

Yes, on Raspberry Pi 4 B+. I am using Gauges. After reading the data, I wait for 1 or 2 seconds before displaying that value on the gauge. There are 4 sensor nodes, they go for 4 delays, and then their respective gauges. Also, I use a switch after the sensor nodes to show notifications, if the temperature is too high. I do this for each sensor too.

I'll post the log, and the flow soon.

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 14:53 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/7 "2020-07-13T14:53:05Z")

</div>

This is when I saw an empty "Flow 1" at the start up.

```auto
> pi@raspberrypi:~ $ cd ~/.node-red
> pi@raspberrypi:~/.node-red $ ls
> flows_raspberrypi_cred.json node_modules package-lock.json
> lib package.json settings.js

```

Now, I imported my flow, deployed it (it was never this fast, it is working perfectly fine for now), and listed again.

```auto
> pi@raspberrypi:~/.node-red $ ls
> flows_raspberrypi_cred.json lib package.json settings.js
> flows_raspberrypi.json node_modules package-lock.json

```

I'll share the logs, when I face with an error.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 July 2020 14:56 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/8 "2020-07-13T14:56:00Z")

</div>

Do the power off reboot while it is still working ok to check that it is not something to do with that which causes the file to disappear. I did suggest that earlier but you have not said whether you did it.

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 15:03 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/9 "2020-07-13T15:03:51Z")

</div>

Okay. I'll do that now.

Also, here is the flow:

```auto
[{"id":"86f3c0fa.c76ac","type":"tab","label":"Test","disabled":false,"info":""},{"id":"8e081889.c375d8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":3,"disabled":false,"hidden":false},{"id":"e72205df.cc91d8","type":"ui_group","z":"","name":"Default","tab":"8e081889.c375d8","order":1,"disp":false,"width":12,"collapse":false},{"id":"a2f70c7.0082ff","type":"ui_base","theme":{"name":"theme-dark","lightTheme":{"default":"#0094CE","baseColor":"#000000","baseFont":"Century Gothic,CenturyGothic,AppleGothic,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#000000","baseFont":"Century Gothic,CenturyGothic,AppleGothic,sans-serif","edited":true,"reset":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#097479","value":"#000000","edited":true},"page-titlebar-backgroundColor":{"value":"#000000","edited":false},"page-backgroundColor":{"value":"#111111","edited":false},"page-sidebar-backgroundColor":{"value":"#000000","edited":false},"group-textColor":{"value":"#262626","edited":false},"group-borderColor":{"value":"#555555","edited":false},"group-backgroundColor":{"value":"#333333","edited":false},"widget-textColor":{"value":"#eeeeee","edited":false},"widget-backgroundColor":{"value":"#000000","edited":false},"widget-borderColor":{"value":"#333333","edited":false},"base-font":{"value":"Century Gothic,CenturyGothic,AppleGothic,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"true","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"feac0a27.436768","type":"ui_group","z":"","name":"Default","tab":"","order":1,"disp":true,"width":"6","collapse":false},{"id":"b659f685.ff9238","type":"ui_group","z":"","name":"logo","tab":"8e081889.c375d8","order":2,"disp":false,"width":"6","collapse":false},{"id":"3bc4e4e7.26b33c","type":"ui_tab","z":"","name":"Main","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"e73e6ad5.5f3e78","type":"ui_tab","z":"","name":"asd","icon":"dashboard","order":2,"disabled":false,"hidden":false},{"id":"8b8572af.73a04","type":"ui_group","z":"","name":"Default","tab":"e73e6ad5.5f3e78","order":1,"disp":false,"width":"6","collapse":false},{"id":"8a04adcd.f502e","type":"ui_media","z":"86f3c0fa.c76ac","group":"8b8572af.73a04","name":"logo","width":0,"height":0,"order":1,"category":"","file":"logo.jpg","layout":"center","showcontrols":false,"loop":false,"onstart":false,"scope":"local","tooltip":"","x":310,"y":80,"wires":[[]]},{"id":"a8123b53.7fb768","type":"inject","z":"86f3c0fa.c76ac","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"logo/logo.jpg","payloadType":"str","x":150,"y":80,"wires":[["8a04adcd.f502e"]]},{"id":"26e4480a.bebb18","type":"rpi-gpio out","z":"86f3c0fa.c76ac","name":"","pin":"11","set":true,"level":"0","freq":"50","out":"out","x":980,"y":180,"wires":[]},{"id":"a46b5c55.96659","type":"ui_switch","z":"86f3c0fa.c76ac","name":"","label":"Başlat/Durdur","tooltip":"","group":"b659f685.ff9238","order":2,"width":3,"height":1,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"mi-power_settings_new ","oncolor":"black","offvalue":"false","offvalueType":"bool","officon":"mi-power_settings_new ","offcolor":"yellow","x":780,"y":180,"wires":[["26e4480a.bebb18"]]},{"id":"76db95e9.32a61c","type":"inject","z":"86f3c0fa.c76ac","name":"","props":[{"p":"payload","v":"+1","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"+1","payloadType":"str","x":130,"y":140,"wires":[["ad7744ff.e250b8"]]},{"id":"ad7744ff.e250b8","type":"delay","z":"86f3c0fa.c76ac","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":320,"y":140,"wires":[["cb654a21.c88848"]]},{"id":"cb654a21.c88848","type":"ui_ui_control","z":"86f3c0fa.c76ac","name":"","events":"all","x":520,"y":140,"wires":[[]]},{"id":"ebb07f1b.58d57","type":"switch","z":"86f3c0fa.c76ac","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"40","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":210,"y":540,"wires":[["2b994417.6d29ac"]]},{"id":"2b994417.6d29ac","type":"ui_toast","z":"86f3c0fa.c76ac","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"KAZAN - YÜKSEK SICAKLIK! Derece:","name":"","x":390,"y":540,"wires":[]},{"id":"7fd6a9df.410be8","type":"switch","z":"86f3c0fa.c76ac","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"40","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":210,"y":660,"wires":[["dd04a634.1e6e48"]]},{"id":"dd04a634.1e6e48","type":"ui_toast","z":"86f3c0fa.c76ac","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"KASK-2 - YÜKSEK SICAKLIK! Derece:","name":"","x":390,"y":660,"wires":[]},{"id":"eb242e94.01bc1","type":"switch","z":"86f3c0fa.c76ac","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"40","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":210,"y":720,"wires":[["e4c4bda5.e3979"]]},{"id":"e4c4bda5.e3979","type":"ui_toast","z":"86f3c0fa.c76ac","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"KASK-3 - YÜKSEK SICAKLIK! Derece:","name":"","x":390,"y":720,"wires":[]},{"id":"461d6294.b5cf6c","type":"switch","z":"86f3c0fa.c76ac","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"40","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":210,"y":600,"wires":[["e1dbe886.22f1a8"]]},{"id":"e1dbe886.22f1a8","type":"ui_toast","z":"86f3c0fa.c76ac","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"KASK-1 - YÜKSEK SICAKLIK! Derece:","name":"","x":390,"y":600,"wires":[]},{"id":"449a07c7.752208","type":"ui_media","z":"86f3c0fa.c76ac","group":"b659f685.ff9238","name":"logo","width":0,"height":0,"order":1,"category":"","file":"logo.jpg","layout":"center","showcontrols":false,"loop":false,"onstart":false,"scope":"local","tooltip":"","x":650,"y":80,"wires":[[]]},{"id":"6bbc799e.8fcc58","type":"inject","z":"86f3c0fa.c76ac","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"logo/logo.jpg","payloadType":"str","x":490,"y":80,"wires":[["449a07c7.752208"]]},{"id":"3efc4824.754798","type":"rpi-gpio out","z":"86f3c0fa.c76ac","name":"","pin":"3","set":false,"level":"0","freq":"msg.payload","out":"pwm","x":1100,"y":480,"wires":[]},{"id":"aee673f7.9deb5","type":"range","z":"86f3c0fa.c76ac","minin":"0","maxin":"1","minout":"100","maxout":"0","action":"scale","round":false,"property":"payload","name":"","x":940,"y":480,"wires":[["3efc4824.754798"]]},{"id":"92820805.9e75d8","type":"PID","z":"86f3c0fa.c76ac","name":"","setpoint":"35","pb":1,"ti":"1800","td":"3","integral_default":0.5,"smooth_factor":3,"max_interval":600,"enable":1,"disabled_op":0,"x":780,"y":480,"wires":[["aee673f7.9deb5"]]},{"id":"c918d062.da081","type":"ui_gauge","z":"86f3c0fa.c76ac","name":"","group":"e72205df.cc91d8","order":4,"width":6,"height":6,"gtype":"gage","title":"Kask-3","label":"derece","format":"{{value | number:1}}","min":"-35","max":"35","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":940,"y":380,"wires":[]},{"id":"4cbefa4b.d50b74","type":"ui_gauge","z":"86f3c0fa.c76ac","name":"","group":"e72205df.cc91d8","order":3,"width":6,"height":6,"gtype":"gage","title":"Kask-2","label":"derece","format":"{{value | number:1}}","min":"-35","max":"35","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":940,"y":340,"wires":[]},{"id":"c293c347.d303f","type":"ui_gauge","z":"86f3c0fa.c76ac","name":"","group":"e72205df.cc91d8","order":2,"width":6,"height":6,"gtype":"gage","title":"Kask-1","label":"derece","format":"{{value | number:1}}","min":"-35","max":"35","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":940,"y":300,"wires":[]},{"id":"58b37b3b.1dcf54","type":"ui_gauge","z":"86f3c0fa.c76ac","name":"","group":"e72205df.cc91d8","order":1,"width":6,"height":6,"gtype":"gage","title":"Kazan","label":"derece","format":"{{value | number:1}}","min":"-35","max":"35","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":930,"y":260,"wires":[]},{"id":"68d3cc85.d843d4","type":"sensor-ds18b20","z":"86f3c0fa.c76ac","name":"","topic":"","sensorid":"28-012019d65680","timer":"1","repeat":true,"x":350,"y":260,"wires":[["ebb07f1b.58d57","58b37b3b.1dcf54"]]},{"id":"77f2d61f.336898","type":"sensor-ds18b20","z":"86f3c0fa.c76ac","name":"","topic":"","sensorid":"28-0300a2790a56","timer":"1","repeat":true,"x":350,"y":300,"wires":[["461d6294.b5cf6c","c293c347.d303f"]]},{"id":"dce60654.7540f8","type":"sensor-ds18b20","z":"86f3c0fa.c76ac","name":"","topic":"","sensorid":"28-0300a279f0d6","timer":"1","repeat":true,"x":350,"y":340,"wires":[["7fd6a9df.410be8","4cbefa4b.d50b74"]]},{"id":"9408bf94.12566","type":"sensor-ds18b20","z":"86f3c0fa.c76ac","name":"","topic":"","sensorid":"28-0300a279dceb","timer":"1","repeat":true,"x":350,"y":380,"wires":[["92820805.9e75d8","eb242e94.01bc1","c918d062.da081"]]},{"id":"1d6c599f.cf56d6","type":"ui_button","z":"86f3c0fa.c76ac","name":"","group":"8b8572af.73a04","order":2,"width":0,"height":0,"passthru":false,"label":"Geç","tooltip":"","color":"","bgcolor":"","icon":"","payload":"+1","payloadType":"num","topic":"","x":310,"y":180,"wires":[["cb654a21.c88848"]]},{"id":"cf89716b.c14b9","type":"ui_dropdown","z":"86f3c0fa.c76ac","name":"","label":"Süreyi Seçiniz:","tooltip":"","place":"Select option","group":"b659f685.ff9238","order":5,"width":0,"height":0,"passthru":false,"multiple":false,"options":[{"label":"10 dakika","value":15,"type":"num"},{"label":"30 dakika","value":"30","type":"str"},{"label":"45 dakika","value":"45","type":"str"},{"label":"60 dakika","value":"60","type":"str"}],"payload":"","topic":"","x":740,"y":580,"wires":[["cbe110fb.7591a"]]},{"id":"cbe110fb.7591a","type":"ui_switch","z":"86f3c0fa.c76ac","name":"","label":"Alarm/Sıfırla","tooltip":"","group":"b659f685.ff9238","order":3,"width":3,"height":1,"passthru":true,"decouple":"false","topic":"msg.payload","style":"","onvalue":"true","onvalueType":"bool","onicon":"mi-alarm","oncolor":"yellow","offvalue":"false","offvalueType":"bool","officon":"mi-cache","offcolor":"black","x":950,"y":580,"wires":[["b53e0700.8e4c78"]]},{"id":"b53e0700.8e4c78","type":"ui_text","z":"86f3c0fa.c76ac","group":"b659f685.ff9238","order":4,"width":0,"height":0,"name":"","label":"Sayaç:","format":"{{msg.payload}}","layout":"row-center","x":1130,"y":580,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 15:05 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/10 "2020-07-13T15:05:43Z")

</div>

And again, "Connection Lost"... There is nothing wrong in the logs. Here:

```auto

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.1.3:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
13 Jul 17:41:55 - [info]
Welcome to Node-RED
===================
13 Jul 17:41:55 - [info] Node-RED version: v1.1.2
13 Jul 17:41:55 - [info] Node.js version: v12.18.2
13 Jul 17:41:55 - [info] Linux 4.19.118-v7l+ arm LE
13 Jul 17:41:56 - [info] Loading palette nodes
13 Jul 17:42:00 - [info] Dashboard version 2.22.1 started at /ui
13 Jul 17:42:00 - [info] Settings file : /home/pi/.node-red/settings.js
13 Jul 17:42:00 - [info] Context store : 'default' [module=memory]
13 Jul 17:42:00 - [info] User directory : /home/pi/.node-red
13 Jul 17:42:00 - [warn] Projects disabled : editorTheme.projects.enabled=false
13 Jul 17:42:00 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
13 Jul 17:42:00 - [info] Creating new flow file
13 Jul 17:42:00 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
13 Jul 17:42:00 - [info] Starting flows
13 Jul 17:42:00 - [info] Started flows
13 Jul 17:42:00 - [info] Server now running at http://127.0.0.1:1880/
13 Jul 17:44:07 - [info] Stopping flows
13 Jul 17:44:07 - [info] Stopped flows
13 Jul 17:44:07 - [info] Starting flows
13 Jul 17:44:07 - [info] Started flows

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 July 2020 15:09 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/11 "2020-07-13T15:09:08Z")

</div>

OK, get it going again, then stop and disable node red (again as suggested in earlier post) so that it won't automatically restart on boot. Use `ls` to check the file is still there.  
Then do power off restart and see if the file has gone (before restating node-red). If it has gone then your SD card has failed. It can write to the RAM cache but not save it in the flash.

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 15:12 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/12 "2020-07-13T15:12:25Z")

</div>

It wasn't automatically starting. I disabled that earlier. With the listing I have sent previously, aren't we seeing that it is just as you describe? If so, should I change my SD card?

Edit: Ignore this one. Below, is the result you asked to see.

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 15:24 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/13 "2020-07-13T15:24:42Z")

</div>

Here is the latest listing after shutting it down, and cutting the power, then powering it back on:

```auto
> pi@raspberrypi:~ $ cd ~/.node-red
> pi@raspberrypi:~/.node-red $ ls
> flows_raspberrypi_cred.json lib package.json settings.js
> flows_raspberrypi.json node_modules package-lock.json

```

It doesn't look like it is deleted. This is the same as when I imported my flow back.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 July 2020 15:26 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/14 "2020-07-13T15:26:03Z")

</div>

Do `ls -l` to see the size and dates. Then start node-red and run `ls -l` again.  
**[Edit]** Make a copy of the flows file first.

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 15:28 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/15 "2020-07-13T15:28:35Z")

</div>

Before starting Node-Red:

```auto
> total 132
> -rw-r--r-- 1 pi pi 44 Jul 13 11:55 flows_raspberrypi_cred.json
> -rw-r--r-- 1 pi pi 11361 Jul 13 17:44 flows_raspberrypi.json
> drwxr-xr-x 4 pi pi 4096 Jun 13 18:21 lib
> drwxr-xr-x 197 pi pi 12288 Jul 11 17:56 node_modules
> -rw-r--r-- 1 pi pi 876 Jul 10 17:00 package.json
> -rw-r--r-- 1 pi pi 79180 Jul 10 17:00 package-lock.json
> -rw-r--r-- 1 pi pi 12610 Jun 13 17:34 settings.js

```

After starting Node-Red (waited until "Started flows"):

```auto
> total 132
> -rw-r--r-- 1 pi pi 44 Jul 13 11:55 flows_raspberrypi_cred.json
> -rw-r--r-- 1 pi pi 11361 Jul 13 17:44 flows_raspberrypi.json
> drwxr-xr-x 4 pi pi 4096 Jun 13 18:21 lib
> drwxr-xr-x 197 pi pi 12288 Jul 11 17:56 node_modules
> -rw-r--r-- 1 pi pi 876 Jul 10 17:00 package.json
> -rw-r--r-- 1 pi pi 79180 Jul 10 17:00 package-lock.json
> -rw-r--r-- 1 pi pi 12610 Jun 13 17:34 settings.js

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 July 2020 15:29 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/16 "2020-07-13T15:29:10Z")

</div>

Did it say it was making a new flows file?

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 15:30 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/17 "2020-07-13T15:30:11Z")

</div>

This is the Node-Rod log:

```auto

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.1.3:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
13 Jul 18:27:11 - [info]
Welcome to Node-RED
===================
13 Jul 18:27:11 - [info] Node-RED version: v1.1.2
13 Jul 18:27:11 - [info] Node.js version: v12.18.2
13 Jul 18:27:11 - [info] Linux 4.19.118-v7l+ arm LE
13 Jul 18:27:12 - [info] Loading palette nodes
13 Jul 18:27:15 - [info] Dashboard version 2.22.1 started at /ui
13 Jul 18:27:16 - [info] Settings file : /home/pi/.node-red/settings.js
13 Jul 18:27:16 - [info] Context store : 'default' [module=memory]
13 Jul 18:27:16 - [info] User directory : /home/pi/.node-red
13 Jul 18:27:16 - [warn] Projects disabled : editorTheme.projects.enabled=false
13 Jul 18:27:16 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
13 Jul 18:27:16 - [info] Server now running at http://127.0.0.1:1880/
13 Jul 18:27:16 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
13 Jul 18:27:16 - [info] Starting flows
13 Jul 18:27:16 - [info] Started flows

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 July 2020 15:31 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/18 "2020-07-13T15:31:56Z")

</div>

Ok, so it hasn't lost the file this time. You will need to experiment to find under what circumstances the file disappears.

**[Edit]** It could be that you are onto something important here as there have been a couple of other cases of lost files recently but no-one has been able to tie down under what circumstances it happens. If you can work out how to make it fail that would be great.

---

<div class="post-metadata">

**Author:** ![oncdastan](https://avatars.discourse-cdn.com/v4/letter/o/34f0e0/32.png) [@oncdastan](https://discourse.nodered.org/u/oncdastan)\
**Post date:** [13 July 2020 15:33 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/19 "2020-07-13T15:33:32Z")

</div>

It will probably be gone when I enter "[http://127.0.0.1:1880/](http://127.0.0.1:1880/)". I'm trying that now, and it is taking forever to load.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 July 2020 15:35 UTC](https://discourse.nodered.org/t/connection-lost-after-some-time/30000/20 "2020-07-13T15:35:46Z")

</div>

I think maybe it would be worth changing the card, if it is the card then we are both just wasting our time. If it still fails then that has been ruled out.

[Next page](https://discourse.nodered.org/t/connection-lost-after-some-time/30000.md?page=2)
