Raspberry Pi assembly / production

Hi,

We’re using Raspberry Pi’s for multiple projects. We flash the SD cards, boot the Pi, let it download the newest containers and the software automatically requests provisioning details from our server. The server creates a token set and assigns a unique serial. This serial is printed on sticker and then shipped to the customer.

But now we’re at the point that we’ve to assemble quite some Raspberry Pi’s every time. First we flashed all SD cards, then booting the Pi’s one by one and wait for it to download the newest containers and provision itself on the server. This takes approx. 5 minutes per Pi. And we can’t boot multiple Pi’s at the same time, because we then don’t know which Pi has which serial.

Because Balena has probably tackled this problem, and the community here is great, I’m asking for your help. We’ve been thinking about how we can improve this process. We probably need something unique per Raspberry Pi, out of the box, so we can identify the Raspberry Pi physically.

The first thing that came to my mind is that we need something that’s accessible by default in the OS, but also in physically, like some sort of sticker. But the Raspberry Pi doesn’t come with that. It has a serial number that can be found in /proc/cpuinfo, but there’s no sticker that we can scan or something with the same serial number. A solution could be that I’ve to create a fast process (lightweight OS with a small binary on it) that sends the serial number of the Pi to a printer, which will print a barcode that we can scan later on. But we then have to create an SD card that we’ve to insert into every Pi when they arrive (workable, but not ideal).

Does anyone have the same problem and/or tackled it? It’d be awesome if we can improve our assembly time per Pi drastically!

Thanks in advance!

1 Like

Hi Bart, take a look at the preregistering docs and masterclass. When you preregister the device you can pass in a uuid. Later on when the device boots you can get that uuid with the sdk if you also need it while the application runs.

Hi,

Thanks for your answer. However, we want to have a unique identifier before it installs it’s containers etc. Because Pi 1 can be used for application A, but Pi 2 can be used for application B for example. And we want to start multiple Pi’s at once, and later on add stickers to the Pi’s (with that unique identifier that is known physically per Pi). Instead of having to wait per Pi.

And, especially with the EtcherPro around the corner, we want to have 1 image we can flash per application instead having to add an uuid per SD card. This is time consuming to do per flash and prone to errors.

But thanks for answering!

Hey Bart,

I wonder if our Fin board might help here; I am pretty sure we have a unique ID per board and I can find out if we print it externally on the board somewhere, maybe a QR code.

I know it doesn’t help with the Pi problem but if you think it might help then I can ask :+1:

Hi Rich,

Thanks for your answer. Unfortunately, the Fin board isn’t an option for us, because it has many additional peripherals which makes the board too expensive for our projects (simply, because we only need the Pi). And we’re using the power of the Pi 4. But I keep that in mind for future projects!

So it doesn’t indeed help with the Pi problem, but thanks for bringing it up!

Hi Bart,

Have you considered the option of using the blink API to identify your RPis? E.g. a process like:

  1. A sticker for a given Pi is printed.
  2. You have the Pi blink its LED so you know which Pi to stick the sticker on.
  3. You press a button to acknowledge the sticker has been attached to the right Pi, go back to (1).

Cheers!

Hi Robert-Jan,

The blink API is definitely something I’ve considered, but this requires some extra steps and is more prone to errors (because what if one Pi keeps blinking for some reason?). And it takes some more time, because you’ve to wait for the request to be successful. Some sort of physical sticker would still be the best option for this, something that we can scan (like a barcode or 2D code).

I’m going to try something in the near-future (a basic OS with a simple Golang process which sends it’s eth0 MAC Address and serial info to a print-server), but I’m looking at the possibility to let this work (out of the box) with a USB flash drive (@balenateam, any help? :slight_smile:) and I hope this is fast enough to really make it helpful.

But all ideas are welcome! Maybe we’re going to try a combination of things. I’ll definitely post our findings here!

Hello Bart,

Regarding the way of basic OS + Golang process, Raspberry Pi does provide support from USB boot (https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md) so it might work out as an out of the box solution as you expect. You can have the Golang process you are building run at startup, after connecting to the network it can send the information to the print-server for the sticker to be printed.

Still keeping the question open for other folks to pitch in, let us know what worked for you. Cheers!

Hi,

Thanks for the link. I’ve seen it but I probably need to update the bootloader in order for the USB boot to work. Which is manual labour (again) which takes a long time. I’ll test it out if it works out of the box, but if not, I’ll just use SD cards probably. But I’ll post my finding here!

FYI, I’m not working on it currently, so don’t expect an update soon. I’ve created this topic to gather as much information from as many people as possible before I get started :slight_smile: