Notes »

Building a rover

This is a work in progress that I’m documenting as I build it.


I would like to build a rover with some fun capabilities:

  • Remotely controlled from a PC.
    • May be using a gamepad!
  • If possible, it should have a camera.
    • Perhaps using a stepper motor to move it left/right.
  • It should be extensible (e.g. add self-driving capabilities, add sensors, a buzzer, etc).
  • It should be reasonably high level so my sons (6 and 8 years old) can help building it.


Component Cost (inc. shipping)
Raspberry Pi Zero W £19.79
MicroSD card Free*
DC motor driver x2 ?
Rover chassis, wheels x2, DC engine x2, rotating wheel ?
Power brick / battery ?
PC Webcam Free**

* I had a 8GB SanDisk Ultra MicroSD –not sure if it was bought for Pi projects, but it works fine–.
** I had an old Trust WB-6250X lying around that is well supported by Linux –needs testing with the Pi–.

Setup of the Pi Zero W

Using Alpine Linux disk-less because:

  • It is lightweight and easy to setup.
  • Disk-less performs great, although it means we can’t waste too much memory as the Zero W has only 512M of RAM.
  • I have used Alpine for years to deploy containers and I wanted to tinker with it a bit more.


The Pi Zero will need at least two dongles / adaptors:

  • Micro USB to regular USB to plug a keyboard to do the setup; later will be needed for the PC Webcam.
  • Mini HDMI to HDMI to do the setup using a screen.

It must be possible to setup Alpine head-less, but I had these dongles when I bought my first Pi Zero some years ago.

The Pi can be powered from one of the USB ports of your PC, you don’t need a special PSU.

I used a regular 8GB MicroSD card with a MicroSD to SD adapter, and a USB card reader for my PC.

Setup notes

These steps require root (if using sudo, try sudo -i).

Check what is your SD device with:

# dmesg

Your system –like mine– may have an auto-mounting feature that could interfere. Once it has been mounted, unmount it with root:

# umount /media/USER/LABEL

Setup the partition:

# fdisk -w always DEV <<EOF

Refresh the partition information in the kernel:

# partprobe DEV

Double-check with fdisk -l that the partition is W95 FAT32 (LBA) –the Pi Zero won’t even blink a LED if the partition is wrong–.

Make the file-system:

# mkdosfs -F32 DEV1 # e.g /dev/sdb1

Download Raspberry Pi armhf –other Pi models may need a different one–.

Mount the partition and extract Alpine:

# cd
# mkdir m
# mount /dev/sdb1 m
# cd m
# tar xvfz alpine-rpi-VERSION-armhf.tar.gz
# sync
# cd ..
# umount m
# rmdir m

Then insert the MicroSD in the Pi, boot, and run setup-alpine followed by lbu commit -d at the end.

Some of the instructions in the Alpine Wiki are unnecessary, in my experience.

  • The wireless is configured and setup fine on the setup, no extra steps are needed.
  • The system clock seems to be a non issue.
  • I chose Busybox NTP client and openssh during the setup.

I also installed haveged (explained in the troubleshooting part of the wiki page), just in case we need an extra source of entropy; but this is likely to be unnecessary thanks to the wireless card and other devices the Pi will have in the final build.

lbu commit -d is needed to save changes, but it won’t preserve anything on /home. If you create a regular user, it will be able to login but there won’t be home. This can be fixed in different ways, but for I decided that using root was fine.

Logging with root using password over SSH can be all configured in the setup, just read carefully and choose the right answers –or you will have to tweak /etc/ssh/sshd_config by hand–.

Last updated Mar 13, 2023