Re-imaging the Raspberry Pi

Foreword

These instructions are complete and correct, but we have easier and better instructions here for folks who would rather use a graphical interface. Check them out!

Introduction

When the AmpliPi units are shipped, they are all loaded with the same system image. You can factory-reset your AmpliPi by reloading this image. You will need a computer connected via a USB cable to the AmpliPi’s service port to perform the imaging.

The latest image which contains AmpliPi 0.3.1 is available at this Google Drive link: amplipi_0.3.1.img.xz - Google Drive. The image is about 2 GB and will need to be uncompressed (to about 6.5 GB) before writing.

The Raspberry Pi documentation covers flashing the eMMC here but we’ve also written up the steps we follow for imaging in-house that include powering/unpowering the AmpliPi.

For Linux (tested with Debian/Ubuntu):

Install rpiboot with:

sudo apt install libusb-1.0-0-dev make gcc
git clone --depth=1 https://github.com/raspberrypi/usbboot
cd usbboot
make
sudo make install

Then either run scripts/image_pi amplipi_0.3.1.img from the AmpliPi repo and follow its steps, OR perform the below manual steps:

  1. Unplug AmpliPi’s power for 10 seconds (all lights off)
  2. Plug in a USB cable from your computer to the service port of AmpliPi
  3. Plug in the AmpliPi’s power
  4. Run sudo rpiboot to boot and load the Pi’s eMMC
  5. To perform the image copy run sudo dd if=/PATH/TO/amplipi_0.3.1.img of=/dev/PIDEV bs=4M oflag=dsync status=progress
    Where PIDEV is the device path of the connected Pi. It can be found with lsblk.
  6. Disconnect the USB cable from AmpliPi
  7. Unplug AmpliPi’s power for 10 seconds (all lights off)
  8. Plug AmpliPi’s power back in

For Windows:

Download and install rpiboot for Win32. Note we use a compute module 3+.

You can use Win32DiskImager to write the image to the eMMC once you connect to the Pi over the service port with the rpiboot tool.

Post Imaging

At this point the Raspberry Pi will have the default pi user with password raspberry. It is advised to change the password for improved security. Either connect to amplipi.local via SSH or on the desktop open a terminal window and use the ~/amplipi-dev/scripts/set_pass utility to generate the pi user’s password and update AmpliPi’s display to show it.

This is my first time working with eMMC… ( I’ve always done a ‘dd’ backup with an SSD … using my linux workstation) … could you suggest some steps that I could backup my AmpliPi ?

I want to assist as a developer - but I need a way to ‘roll back’.

Thanks for the great product !! Best wishes to your whole team !

Van

You can ‘roll back’ to the image we shipped with version 0.1.7 following the above steps. If you want to create your own custom complete images as backups, the steps we used to create that 0.1.7 image are in this doc: AmpliPi/pi_imaging.md at main · micro-nova/AmpliPi · GitHub

The basic idea of it is to use dd to copy from the Pi instead of to it. They just are large images (32 GB) so we utilize the same resize-once functionality that the Raspberry Pi OS uses on first boot. So if you don’t care about that then your "backup an SSD with dd" method should be the same here. The only difference dealing with the eMMC is using rpiboot to get the disk to show up under /dev.

Thank you for the quick reply! I’ll give it a try!