I am working on a project where i have multiple Raspberry PI. Each PI controls a room where node red install in it. The node red will control devices like smart lights within each room.
I have a created a flow which to be deployed on each of the PI. The flow is same for all of them.
if i make a change in the flow, i need to copy and paste and test in all the PIs. This is time consuming.
Is there a way for me to centrally manage this and push changes to all PIs where node red is installed?
What are other option available in terms of a central node red that communicates to all PIs?
I don't think that lets you push to multiple Pis from the controlling one. Certainly using git to store the flow (whether via projects or otherwise) could help as then you just need to run a script on each one that pulls the new flow file and restarts node-red. Then you could run a script on the controller that runs the pull/restart script on all the other ones by using ssh to run a command remotely.
Another possibility is to use the "Admin APIs" to push a new flow from the master node-red server to multiple slave instances.
Normally, the deploy button does an Http POST to the internal admin endpoint called /flows -- here is the documentation for this and all the other internal admin apis . What I have done in the past is to use http response nodes to POST the new flow.json to remote node-red instances (running, of course). This causes the remote servers to immediately replace their current runtime flows with the newly posted version and restart their runtimes.
This came up 3 weeks ago i believe (at most 4 weeks ago) someone wanting to have a central script that was deployed to multiple Pis - have a look at the ideas in here
Looks really cool, but does anybody know what the relationship is to the standard Node-RED flow editor? I assume that both editors have nothing in common? I.e. when something is added in a new release to the standard editor, that won't be available in the DNR editor?
It looks to me that it offers some of the functionality from this Trello item on the Node-RED roadmap. But (again) I assume there is no connection whatsoever between the both?
Advantech have done a lot of work on creating and reading nodes from sources and I wondered if this could be of use. Here are a few links to the relevant youtube channel pages and the NPM source page:
This is Nam, from DNR Editor, I try to keep DNR Editor up to date with upstream (Node-RED) editor as much as I can while being a PhD student.
I also work with FRED if you ever heard of (fred.sensetecnic.com), DNR was initially an idea of Mike, the co-founder of FRED and a very cool guy. I've been pushing it forward ever since.
Glad to hear it might be of use somewhere.
For the question about multi device deployment, here is a sample flow that can be done through DNR Editor, this will help to deploy the same flow to different device. It's a bit hacky but currently work that way.
The constraints 1, 2, 3 is based on device Id, which you assign when register each device to DNR Editor. The participating Node-RED needs to have node-red-contrib-dnr installed to be able to register to DNR Editor.
The main goal of the project is to assign portions of the flow on different devices. But since nothing prevents you from having multiple clones of the same flow on the same tab, it will work.