Software installation on multiple raspberry pis

Hello,

We are looking into setting up another 72 pioreactor workers. We would like to make the process quicker than flashing the microSD cards one by one and are looking into buying a drive duplicator (something like this with some of these). We have found scripts online that we could adapt (e.g. pico-autoflash-mac.py · GitHub) so it looks possible but we understand we’d need to give each pioreactor worker a unique host name. Before investing in the duplicator and time writing scripts, we were wondering whether anyone had done anything similar before or point us towards useful resources?

Many thanks in advance,

Vicky

Hi @vickylouise,

I can’t comment on what hardware tools might be useful, but one thing to note: you can change hostnames after you’ve written an image. SSHing into a Raspberry Pi (in general, but also the Pioreactor), you can run

sudo hostnamectl set-hostname <new-worker-name> && sudo reboot

Thanks @CamDavidsonPilon - that’s a good point! I was worried about being able to ssh in if they are the same host name but I can use the IP addresses. So I think my steps to try are:

  • Install using the software installer, giving them all the same host name
  • Identify all the devices on my network using that host name and get their IP addresses
  • ssh in using the IP addresses and change the name and add them to the cluster

I have a plan, thank you!

Another tool you can use is the following:

When you write the SD card using RPI imager, there exists the bash file firstboot.sh in the boot dir. You can append the hostname change code to the end of this file:

sudo hostnamectl set-hostname <new-worker-name>

Then, on first boot, this firstboot.sh will run (and it will only ever run once). This approach might be easier than finding them on your network and changing after the effect. Heads up: I’ve never tested this, so try it first!

Good point, thank you! Good to have a plan B too :smile: