Today I discovered data will not survive to restart :(

It's only 2 weeks I play with RPI and node-red.
I built 2 usefull, for me, workflows; both send data to dashboard. For me, historic data (last 2-3 days) is someway important.

Today, only today, I discovered than restarting node-red service wiped out all data from dashboard

My fault, of course. For some reasons, I expected than dashboard could handle persistance of data automatically.

So ... is it true? Dashboard is not saving and restoring data automatically? Just to be sure ...

If yes, is influxdb + grafana the best practice (i must run on RPi2 model b for now) ?

Hi @realtebo

I don't use dashboard all that much, and whilst I stand to be corrected - I think that is true, DB does not persist data on it's own, so you need to develop a mechanism to do so.

example: store values in some database / file so you can then use it to restore the state of the graphs when Node RED / flows restarts using an inject to trigger after 1s to read the stored values and send them into the dashboard restoring its state

Here is one example by @dceejay
https://flows.nodered.org/flow/92920b4fd450bf92a3035e061947daa0

You could also use the global or flow context stores, as long as Node RED is set to use the file system
https://nodered.org/docs/user-guide/context

1 Like

Another solution, which I use for charts:

node-red-contrib-persist

A node-red node to persist data between Node Red deploys and restarts.
grafik

EDIT: You need to trigger the "Persist Out" node with a inject node.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.