Preparing devices in Bulk

Overview

This guide is for preparing and activating multiple supported Raspberry Pi or Orange Pi devices at once. You load a single image onto as many SD cards as you need.

  • No manual activation. Plug power into a unit and check that the lights flash green. The unit allocates a license to itself when it boots, so you do not register or activate each device on the website.
  • Units belong to your organization. Each unit is allocated to your organization, so when your customer starts using it, it already carries your branding and Wi-Fi hotspot.

Step 1 - Familiarize yourself with the standard flashing procedure

First, we could recommend familiarizing yourself with the Balena Etcher process. As mentioned, you will need to flash a device and set it up before you can get a custom image.

Step 2 - Activation Profile

First: You will need to create an activation profile before moving forward. This can be done by opening your user page here. Then, click on the organization on your profile and open the "Activation" tab as shown below. If you do not have an organization set up, you can create one for free here.

Activation profile

Step 3 - Creating a custom image

For this, you will need a PC or laptop running Linux since this process does not work on macOS or Windows. You can start by mounting the SD card on your local machine using the command lines below:

LOOP=$(sudo losetup -Pf --show "[image-name].img")
sudo mkdir /mnt/rpi
sudo mkdir /mnt/rpi_boot
sudo mount "${LOOP}p2" /mnt/rpi
sudo mount "${LOOP}p1" /mnt/rpi_boot

Step 4 - Activation ID allocation

Once the SD card is mounted, you can allocate an activation ID by placing the "activation_id" from step 2 in "/boot/activation_id" on the SD card.

nano /mnt/rpi_boot/activation_id

Step 5 - Load Wifi Credentials optional

Once the SD card is mounted, you can insert your office wifi credentials in "/boot/wpa_supplicant.conf" on the SD card. This will let the unit boot and automatically connect to your office Wifi as soon as it starts.

Step 6 - Load custom scripts optional

While the SD card is mounted, you can insert your own scripts in "/boot/activation.sh". This will then be executed during the boot process.

Step 7 - Unmount the SD card

Once you have finished, unmount the SD card using the following commands:

sudo umount /mnt/rpi
sudo umount /mnt/rpi_boot

Step 8 - Flashing the custom image

Now, you can flash the custom image onto the SD card using the Balena Etcher as described in the Balena Etcher guide. This is because this tool has the ability to select multiple storage devices at once. It sometimes gives errors when selecting the image, but closing and reopening the tool can often resolve these issues.

If you want to flash a single SD card, you can look into using RPi Imager as an alternative to Balena Etcher. You can find more information on how to use RPi Imager in the RPi Imager guide.