Updating Flows Remotely

Good day everyone!

I almost finished an app that will run on multiple machines (powered by Raspberry Pi's). None of these machines have a fixed IP and all of them will send some data to a server at regular intervals of time.

Is there a way to update the flows in this case? I was thinking something like when the machine sends it data to server the server notifies the machine back that a new version of SW is available the machine then will download the new flows and "somehow" deploys it.

Any help will be appreciated. Thank you in advance!

Welcome to the forum @Cristian

You could do a regular git pull on the server and then restart node red if it pulls anything

Will that update the flows or just node red? The way I read it if he changes flows on one machine then update all machines to the new flow.

I meant to pull the flows from git. I am assuming they are in a git repo on GitHub or wherever.

Thank you for your answer.
NR machine will send a request to server to check if there are any updates available. If a new version of SW is available then the server will send the updated json flows.
Now how can I fully deploy the new version of SW automatically without any human intervetion?

Thank you for your answer.
After pulling just overwriting the old flow will do it?

you can try using the Admin API Methods
and more specifically read how to use a POST request to POST /flows
this can automatically do a Deploy of the posted Flow

Thank you. I will try this evening and see how it works.

Have you considered using a dynamic dns service (like duckdns) and to use machine names instead of ip addresses? This could save you the trouble of updating the flows when the IP Addresses of the machines change.

Alternatively you can search the forum on how to restart node red from a flow, it has been discussed many times. If the flows update is done in a script then you can do the restart from there.

You should also replace package.json and package-lock.json. in fact I overwrite the full .node-red folder except the node_modules folder. If any new node types are needed, or if any nodes need upgrading, then you also need to run npm install in the .node-red folder before restarting. You can determine whether you need to do that by checking whether either of the package files has changed.

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