Fun with a Raspberry Pi Zero 2

A few years ago I setup Pi-Hole on a Raspberry Pi 3B+. Recently we went away on holiday for a month, and I powered it down before we left. When we came back and I switched everything back on, it worked for a couple of hours but then something popped and it stopped working (along with my Asus RT-AC86U router). It’s now dead, and doesn’t boot (the router is dead too).

For a replacement I picked up a (headless) Raspberry Pi Zero 2. The existing power supply and SD card from the dead 3B+ still worked.

Raspberry Pi Zero case
A Raspberry Pi Zero in a case

Over the last couple of weeks I’ve been finding more and more uses for it. One thing that’s awesome about the Pi is the amount of help and guides available to do anything with it. Here’s some things I’m now doing with mine, to give you some ideas.

Pi-Hole

If I’m honest, I don’t know if I need Pi-Hole (a network-wide ad blocker) these days. My browser and phone have ad blockers. And it gets in the way fairly often – e.g. if I search for a product on my phone, the first results in google get blocked, and to get those links to work I have to whitelist a handful of domains, which feels like it’s negating the point of it, so I don’t whitelist. It also gets in the way on some of my LG TV’s apps.

Phone screenshot of google search results   phone screenshot of a blank page

I do enjoy Pi Hole’s dashboard though, especially the “Percentage blocked” graph:

UPnP / DLNA server

As I mentioned above, my ASUS RT-AC86U router also crapped out at the same time. This was annoying because when I bought it about 4 years ago it was a top of the line $450 router. I had a 4Tb USB HDD plugged into it’s USB 3.0 port, and the router came with Time Machine software to backup my Mac, and a DLNA server, which was handy for viewing photos and videos on our LG TV in the lounge, via the TV’s built in “Photos and Videos” app.

About a year ago I added a cheaper ASUS RT-AX53U router to our network and set that up as a node in a mesh network using ASUS’s AI Mesh, so that we would have stronger WiFi in our bedroom at the other end of the house.

I didn’t feel like spending $400 again to replace the broken router, given the first one didn’t last long enough, so as a temporary measure I made the cheaper AX53U router the primary router, and then I later bought another AX53U router and set that up as an AI Mesh node for our bedroom.

However, I didn’t realise the cheaper AX53U is missing some of these USB features – i.e. no Time Machine. And although it supports DLNA (UPnP server in the screenshot below), I found it to be buggy, and I couldn’t get it to work.

Screenshot of ASUS router config page, showing USB applications

It was pretty easy to set up my Pi Zero to be a DLNA server, following the instructions over here. One gotcha is that the Pi Zero doesn’t have standard USB ports, so I had to first buy a $4 Micro USB to USB A OTG adapter so that I could plug in my USB HDD to the Pi.

Once setup and running, you get this basic UI:

Screenshot of MiniDLNA status page

Pro tip: you can browse a DLNA server using VLC (e.g. on your phone) if you want to check it’s running.

(I still need to figure out why the DLNA database is empty after the Pi is rebooted)

AirPrint

This was a nice-to-have. I have a basic Brother DCP-1610 Laser printer, which does have WiFi printing on it – so I thought it would be easy to print stuff from my iPhone. I should be so lucky – instead, you have to install Brother’s own printing app on your phone, and use that to print, which isn’t very easy.

However, (as per this guide) by installing CUPS on the Pi, and adding the Brother printer to that, I can now AirPrint to the Pi and it prints on the Brother. Easy!

Screenshot of printing from an iPhone

Backing up my family photos

I don’t use Apple’s iCloud or Google photos, my photos workflow is very manual and old school. I don’t want to be tied to any Photo manager software or database, e.g. Apple Photos, so I still organize photos into folders.

  1. Move photos from iPhone via USB to Mac, using Image Capture
  2. On Mac, use Preview app to delete the bad / duplicate photos
  3. Rename and move to a folder based on the year and location, i.e. 2023/04 Warsaw/

I also do the same for home videos. For those I’ll occasionally edit them into something more presentable using iMovie, or Quicktime Player to trim the start and end.

I use rsync over ssh to copy these folders to from my Mac to the Pi’s DLNA folder, following the instructions here.

Time Machine

As already mentioned, since my replacement router doesn’t support Time Machine (which is Apple’s backup software), it’s easy enough to add Time Machine to the Pi Zero by following these instructions.

I’ve gotten it to work just now, but I’m not sure it’s a good idea, because the Pi Zero doesn’t have ethernet, only has 2.4Ghz WiFi, and only has a USB 2.0 connection to the HDD – so there’s a lot of bottlenecks there. I might be better off with a Raspberry Pi 5 with Ethernet and USB 3.0.

Screenshot of Apple Time machine, showing 3Gb out of 330Gb backed up.SSH

Since this is headless, to connect to it I use ssh, i.e. ssh pizero. To save me entering the password every time, I did

ssh-keygen  (this generates an rsa key, only need to do this once on my Mac)

ssh-copy-id pizero

Spin down external HDD

apt-get install hd-idle and then follow the instructions here to configure it to start at startup. Note: I never actually got this to work.

Update: February 2024

Well, after only 3 months the Pi Zero has stopped working. When I put the SD card into my Macbook, it thinks the SD card is write-protected for some reason. Looks like I need a new SD card. I’m not sure I’m going to bother. Of the above apps:

  • Pi-Hole. Not really needed, Safari on my iPhone has decent enough content blockers now, and it’s handy being able to quickly disable them when a site asks you to.
  • UPnP / DLNA. Streaming 4K home videos to our LG TV in the lounge would stutter, which was frustrating. Not sure where the bottleneck here is – could be network (Pi Zero only has 2.4Ghz WiFi, no ethernet) or CPU. Reverted to plugging in a USB HDD to the TV.
  • AirPrint – I’ll miss this
  • Time Machine – was too slow to backup over WiFi, and I don’t trust that a restore would have worked. Reverted to using an external USB HDD to do Time Machine backups.

Leave a comment