I was thinking, with the truly shocking price of ram etc, of gathering all my various pi’s and linking them in some sort of bramble or cluster computer, pi zeros, pi 1-4 and a pi 5.
Is this possible? Especially with pi 5 having so many changes compared to previous versions.
In some respects I hope this triggers a bit of a renaissance of the idea for makers, a robot run by a bramble for example, as the traditional Arduinos with a pi brain is looking north of £300.
Any thoughts
?
While I will leave any cluster setup/advice to others that know, there is nothing stopping you designing your own multi mcu/cpu application.
E.g.
- connect all devices via a common communications protocol (for command and control) e.g. i2c, spi
- select one to be the master
- push needed code/firmware to each device so it can do its assigned task
- Send command/Get results.
I kinda see two types of multi “cpu” devices…
- Most of the work is 100% the same, just lots off it, the sort of workload that GPUs are good at.
- Different lower number of tasks that need high compute, this is where multi cpu/mcu may help.
e.g. In a very old project I needed very very strict timing of a custom pwm signal. using the 8bit controllers at the time, the master controlled most things, but every time it need to take an action, the PWM would glitch.
So to fix this, I places a 2nd mcu on the board and the master would tell it what PWM settings to use, then leave it alone until it needed to change it. This resulted in a very clean PWM while the controller dealt with the main comms etc.
So my key point, you can do what ever you want. The software to make it happen may or may not exist, but there is nothing stopping you from setting up your own.
One key thing to keep in mind is some thinges need fast CPU, adding lots of slow mcus may not work if that task is not suited to parallel processing.
Hey there, @JOSEPH321058, and welcome to the forum.
Yep, it’s possible. The “cluster” layer is usually just networked Linux nodes talking over a network
@Michael99645’s point is the key one though: it won’t behave like one giant Pi with pooled RAM/CPU. Each Pi remains its own computer, so the job has to be split into chunks. Its really less like a SBC and more like one centralised system handing out processes to the smaller orbitals. Which means that you’re going to only be as fast as you’re slowest CPU can think. If you manage your tasks properly that should be fine.
There are actually some Pi HATs that simplify this sort of process, such as the Cluster HAT | Buy in Australia | DEV-18155 | Sparkfun | Core Electronics, though they’re hard to find these days.
Thank you @Michael99645 and @Jane , some really good points, essentially good task management would be the key here, thank you for your input. 
I’ll take a look at the cluster hat… being older the code might need some updating to get it to play nicely with the 5, but it’s a good place to start.
1 Like