~/notes/my-homelab-has-a-face-now

My homelab has a face now

  • Monitoring
  • Homelab
  • Raspberry Pi

Monitoring dashboards are great, as long as you remember to open them.

Mine live in a browser tab I check when I already suspect something is wrong. A Cloudflare Tunnel doesn't wait for you to suspect anything. It just stops, quietly, and every app behind it goes down with it.

So I gave the homelab a face. It sits on my desk, and it looks worried when the server is.

⬅ IMAGE:

homelab-buddy-animations

What it does

A Raspberry Pi Pico W with a 0.96" OLED screen. Every 30 seconds it asks three questions:

  • Netdata: are there any active alarms?
  • The internet: does my site still load through the tunnel?
  • Docker: which containers are running?

Then it answers with its eyes:

  • Normal eyes: everything is fine. It blinks, glances around, winks, and now and then dozes off.
  • Worried: a Netdata warning, or a container that stopped.
  • Sad, with a tear: the server is up, but nothing gets through the tunnel.
  • X X: the server isn't answering at all.
  • Happy bounce: something just came back. It says BACK ONLINE, and it looks very pleased with itself.

The line under the eyes switches between overall CPU and RAM. When something breaks, the alert takes over.

It also lists my containers

Press the Pico's BOOTSEL button and the face turns into a tiny container browser: one page per container, with its state, CPU and RAM bars, and uptime. Long names scroll sideways, because nextcloud-aio-mastercontainer was never going to fit in 16 characters.

⬅ IMAGE:

homelab-buddy-container

No extra button needed. BOOTSEL was already there, doing nothing after boot.

The part that didn't fit

The Pico W has 264 KB of RAM. Netdata's full list of charts is a lot bigger than that, and it doesn't show stopped containers at all, which are exactly the ones I care about.

So the server runs a small helper: a short Python script that calls docker ps and docker stats every 15 seconds and serves a compact list on my home network.

$ curl http://localhost:8765/containers
[{"n":"cloudflared","s":"running","u":"Up 5 hours","c":"0.12%", ...}, ...]

It only reads. It never starts, stops or touches anything. It stays on the LAN and never goes through the tunnel, because a list of everything running on my server is not something the internet needs.

What went wrong along the way

  • The buddy was sad from the very first second. The tunnel check was still pointing at app.example.com, so it was technically correct: that app was unreachable.
  • The helper crashed on startup, over and over. Something was already answering on its port. ss -ltnp said docker-proxy: one of my own containers had claimed it months ago. New port, problem solved.
  • TypeError: function takes 5 positional arguments but 6 were given. I updated main.py and forgot to copy the new faces.py. The Pico was trying to draw new expressions with the old eyes.

All three are in the troubleshooting table in the guide, so you can skip them.

Build your own

Everything is free:

You need a Pico W, a four-pin I2C OLED, four jumper wires, and a server running Docker and Netdata. The whole build takes an evening, and most of that is deciding how much the eyes should blink.

$ sudo systemctl stop cloudflared
$ # the buddy is now very sad
$ sudo systemctl start cloudflared
$ # BACK ONLINE

Watch it react on my YouTube channel.

All notes

Get the next write-up by email

New posts and project write-ups, a few times a year. Unsubscribing takes one click.