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!
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?
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
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.