A place to talk about software and stuff.
24 November 2021
Huh, so it turns out I didn’t have as much time for blogging as I had hoped for…
Raspberry Pi is obviously one of the most popular (probably the top choice?) platforms for hobbyist projects. I have used a few Pi systems for various little toy projects, but my current setup has been one of the most rewarding and satisfying hobbyist projects I have worked on. This blog post is not really a tutorial about how to set up a Pi as I have; instead I’m hoping to explain the ideas behind the setup and in particular talk about why it brings me joy.
I originally set up a Pi to interface with my 3D printer (via OctoPrint). I did add a few things onto that, like a webcam for saving timelapses of prints (which later ended up being used to stream prints to YouTube via ffmpeg). I gradually added on different functionality, such as home automation and media streaming. At this point it basically serves any functionality that a regular home server would.
This is the set of hardware I am currently using for my home server:
I have the Pi connected to my home networking equipment so that it can access the LAN network and the internet via Cat6A Ethernet.
When I started to set up the system, I made a few decisions about the software that should be installed; primarily I wanted a 64-bit userland which at the time was not available in the official Pi OS images. I had previously used Gentoo; while there are some drawbacks, I do enjoy being able to control the characteristics and performance of the packages. There was a bootstrapping package available at the time for arm64 which I was able to use to get up and running; I also found a lot of useful information (and I pull packages from) the GenPi64 project.
One of the notable choices I made was to use an uncommon init system called runit as opposed to something like systemd; I don’t have any major issues with systemd but I enjoy how lightweight and simple runit is. My installation using runit generally boots very quickly and is fairly stable (i.e. doesn’t break too easily). I also love how easy it is to configure each service.
I did also want to have access to a container manager like Docker or Podman; I had read a bit about Podman so I embarked on the journey to install it; this ended up being an ordeal since at the time it wasn’t available for arm64 in the Gentoo repositories (although it is now). I was able to build and install all of the dependencies and eventually run arbitrary containers, although to be fair it was a painful process.
I also compile the kernel myself from the Pi official sources, to enable certain features such as USB Attached SCSI for the SSD in the case.
These are the main uses I’ve found for the Pi as a home server:
Using the Pi as a home server results in a fairly robust system; while it does occasionally break when I update something or change a configuration, it’s incredibly easy to remove the MicroSD card, chroot into the OS (QEMU can make this especially easy, since it can run arm64 executables from x86_64), and fix the issue.
Since the Pi is tiny in comparison to an x86 system, its power draw is much lower (although to be fair I haven’t measured it). The fan in the Argon case rarely spins up even though I am running the daemon, so I believe it doesn’t even get warm often.
The entire system is also incredibly inexpensive versus more powerful options like getting a rack cabinet and a server.
The Pi is an arm64 system, so there is less software available than there is for e.g. x86_64. However as far as server-side software is concerned, I haven’t had any issues installing from an official repository or building from source.
The processor is also a lot more limited than a typical x86 server, so generally intense applications may not run well; it’s important to have reasonable expectations for what kinds of workloads the Pi can handle. With my current setup, htop shows all four cores between 0.7% to 4%. I was able to run the PaperMC Minecraft server, but it did cause lag occasionally.