Deploy and Manage Hundreds of Devices across the country

Hi,

I'm looking for some guidance regarding bulk deployment and management of devices.

I'm looking into using Balena.io or similar to allow me to deploy and manage devices in bulk. I'm developing in node-red, and have until now have imported the flows from a file (we had a pilot run of 4 devices). We are now looking at creating hundreds of devices, and therefore the process needs to be much more efficient. We will have devices spread across the country so we need to be able to manage them all remotely. All the devices will have the same flows but will need to be identifiable by device-ID of some sort as they are being monitored in a central dashboard.

Has anyone used Balena or any alternatives that allow them to deploy and manage devices remotely?
If so which service was the most effective?

Thanks,
Gregor

I wrote up one approach for doing this last year - https://knolleary.net/2018/09/27/deploying-node-red-applications-to-devices-using-resin-io/

The post talks about resin.io which was Balena's name before they completely rebranded themselves a few days after I hit publish - I really should go back up fix those references.

1 Like

Thanks for the reply, I'll have a read through it justnow!

Hi Nick,

I'm currently using your article to try and set up the Node-red projects and Balena link. I'm stuck on the step of adding the settings file - I cant work out where to put this. I edited the settings.js in the .node-red folder to include the lines from the instructions but when I restarted node-red it gave me an error. Where abouts do I create this settings file?

Also, I am unsure on how to create the docker file.

Can you point me in the right direction?

Thanks,
Gregor

What is the error?

Hi,

I think it was because I didn't add the comma at the end of this:

module.exports = {
    credentialSecret: process.env.NODE_RED_CREDENTIAL_SECRET,
    httpAdminRoot: false,

I'm slightly confused however as this stops the Admin Editor from showing up on my PC - is this intended for programming directly on the Pi rather than using a browser to access the admin editor?

How can I stop the admin editor being available on the remote Pi's but still have access to it on the Master in the office?

Thanks,
Gregor

I have set up the GitHub repo, set up the git remote to the URL. I've created the SSH Keys and put them in my Github account. But when I go to the Commit history I get the following:

Any ideas what I've missed?

I think you still need to specify your Git remote repository under Project Settings (see screenshot below).

As far as I am aware, this is by design. There might be ways to accomplish what you're trying to do, partially by using the Projects functionality that I see you're using now. An option, I think, would be to set up the master system in the office with a different settings file than the ones you are deploying. From my limited knowledge with Projects, deploying flows by way of deploying them from git won't overwrite the settings file, but I might be slightly mistaken there. Any readers, please correct me if I'm wrong and you know better :slight_smile:

Hi Janvda,

Thanks for your reply. I have set up the Git Remote in the node-red - it looks the same as yours.

One thing that I think I did wrong, I created the project first and then tried to add the remote after. All of the tutorials I've since watched seem to create the GitHub Repo, and clone it to create the project.

Could this be why it isn't tracking it? How would I fix this without completely deleting and starting from scratch?

When I delete the remote repo and add a new one, if I then go to the commit history and click the two arrows next to "Branch:Master" it says "Verification Required", I fill in the fields and hit retry and then it goes back to "Your local branch is not currently tracking a remote branch". I can't work out why it wont track the branch. Has anyone had this issue before?

Thanks

Edit: I've noticed that if I change the name from "origin" it doesn't even give me the verification step.

Edit 2: It's now working - what I did was wait till it came up with "find or create a remote branch" and typed in "origin" and hit push. This then pushed the code to the remote repository with the branch "origin".

What I've since done is put a settings.js file in the project folder, and a settings.js file in the .node-red folder. The one in the project folder I have set to turn off Admin APIs, and the one in the .Node-red folder I have left normal.

So far so good - I can still access the node red editor on my master pi from my PC. Next step is sort out my Node-red to GitHub link so I can push this out to a remote device and see if it has successfully turned off the Admin APIs for it.

Fingers crossed it works - I'll keep this thread updated with the results.

1 Like