I love my Pi Zero. It’s such a tidy micro-server to have in our house for random things. When we first got it, it was a pi-hole. We deployed it for the same purpose in the office we shared with our friend and neighbor. There, with a little display, it also helped our officemate debug network problems by displaying information without color. It’s so small and low, I powered it off the usb port on the back of the wireless router.
Someone should time-travel back to 2003 and tell my younger self that not only is it possible to have a home server that’s on all the time, it’s also small enough to lose in a junk drawer.
At some point, though, it stopped working reliably. I’d plug it in, and after a while it would crash mysteriously. I checked the logs and noticed it was kernel panicking, not hanging on any particular application or task. The panics would happen reliably when I ran apt upgrade but I couldn’t work out much more befond that.
Last weekend, inspired by a friend’s Zero 2, I thought I’d try to figure it out again. I’ve learned a lot about Debian, SD cards, and how to optimize long running pis in the last year or so. Maybe I just didn’t know what to do in the past.
It turns out the most important thing I had to do was overclock the CPU by a small amount. In /boot/firmware/config.txt I set over_voltage: 2, to give the CPU the ability to use 1.355V instead of the standard 1.35V. (vcgencmd suggests it’s actually 1.400 so ymmv, I guess.)
I’m not sure why this worked, but it hasn’t panicked since.
A few other things I did before I started programming the GPIO e-ink display:
- Uninstalled the NVIDIA and Intel GPU firmware packages.
- Turned off
manpageupdating. - Turned on
watchdog - Set the pi to reboot automatically after a kernel panic (helpful when debugging the original problem!)
I linked to Chris Dzombak’s blog a few times above. There’s a lot more I could do to help this lil pi keep itself stable in the long term and I’ll probably keep tweaking based on his excellent Raspberry Pi series. Worth checking out before you burn through an SDXC card.