Hello,
**on edit: for some reason posting inline links are not working for me, so I posed the links as plain text**
I'm trying to enable persistent context stores on a Cerbo GX for Node Red, per this article.
https://nodered.org/docs/user-guide/context#:~:text=Node%2DRED%20provides%20a%20way,This%20is%20called%20'context'.
Apparently, there are a couple (few?) different settings.js files in the Cerbo and I was modifying the default one at the default NR path:
/usr/lib/node_modules/node-red
Modifying that file broke NR. I had to reload the regular then large firmware to get NR working again. Restoring my changes did not seem to work.
I then saw this article
https://community.victronenergy.com/questions/139691/where-did-my-node-red-flows-go-after-firmware-upda.html
which indicates that the correct path to settings.js should be:
/data/home/nodered/.node-red/
Modifying that file by un-commenting the contextStorage section as follows:
/** Context Storage * The following property can be used to enable context storage. The confi > * provided here will enable file-based context that flushes to disk every > * Refer to the documentation for further options: https://nodered.org/doc > */ contextStorage: { default: { module:"localfilesystem" }, },
worked and my context values survive a reboot.
I then tried to modify settings.js to have memory and file storage options (also per the above article) like so:
contextStorage: { default: "memoryOnly", memoryOnly: { module: 'memory' }, file: { module: 'localfilesystem' } }
When I do that, NR won't launch, throwing the error:
Error: remote installation does not seem to have a running Node Red service.
Any Idea why this won't work?
The reason for all of this is I have setpoints to run fans, battery heat, etc. that I can adjust via a NR dashboard. I want the last settings to be saved in the event of a reboot. I thought the second method would be nice so only the contexts that I explicitly need would be written to disk, but I suppose it's no big deal to write them all.
Is this the best way to do this in a Cerbo NR deployment? Any issues writing the files to the Cerbo file system? I understand that because I'm writing to the /data partition, the files should be safe from a firmware upgrade.
Thanks.