-- Leo's gemini proxy

-- Connecting to republic.circumlunar.space:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Raspberry Pi home server


DATE: 2023-12-24

AUTHOR: John L. Godlee



When we lived in London we had an old HP Compaq Elite 8300 desktop tower that we used as a home server. The server ran Ubuntu minimal server 18.04. I used the server to back up important documents, and used Samba to connect our laptops to access music, movies etc.


The server was very convenient for me, but it was a bit awkward for others to connect to if they weren't familiar with network shares or SSH. Additionally, the server was quite power hungry. I set it up to wake on LAN, but this meant I was the only one in the house who could turn it on.


In our new flat I aimed to upgrade the home server setup to reduce power consumption, increase storage capacity, and improve accessibility for less techy people.


Hardware


Raspberry Pi 4 Model B 8 GB[1]

Integral SlimXpress 1TB USB External SSD[2] - 1050 MB/s Read, 1000 MB/s Write

GL.iNet GL-A1300[3] (Slate Plus) Wireless Travel Router


The RPi is connected to the router via a short ethernet cable, and to the SSD via USB. The RPi boots from a 64 GB Micro SD.


1: https://www.raspberrypi.com/products/raspberry-pi-4-model-b/

2: https://www.integralmemory.com/product/slimxpress-portable-ssd/

3: https://www.gl-inet.com/products/gl-a1300/


I used zipties to mount the three bits of hardware onto a section from a plastic crate, the kind used to hold fruits and vegetables. I then hung the "rack" under a gateleg table using screw-in hooks.


To play music in the living room the RPi is connected to a Yamaha CRX-M170 micro Hi-Fi system via a 3.5 mm to phono cable. Unfortunately, the 3.5 mm jack in the RPi 4 is terrible. The sound comes through very tinny with lots of interference. To get decent audio quality I had to buy an IQaudIO DAC Pro hat[4] for the RPi. The DAC Pro connects via the GPIO pins to the RPi.


4: https://thepihut.com/products/iqaudio-dac-pro


Server setup mounted to plastic tray 'rack'.


Software


We don't have internet in our new flat, instead we just use our mobile phones. The GL-A1300 router has a USB port that can connect an Android phone to use it for USB tethering. On the rare occasion that we need to connect the home LAN network to the internet we can tether a phone, but mostly we can remain offline.


The RPi runs Raspberry Pi OS Lite[5] version 2023-12-05. This version of the OS doesn't include a desktop environment and works well as a server.


5: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-32-bit


I installed Jellyfin[6] to serve video and audio from the RPi to all our devices. Jellyfin has an app for Android that works quite well, and a web app that is accessible over the local network that works well on laptops. Jellyfin can cast directly to a TV using DLNA.


6: https://jellyfin.org/


I installed Mopidy[7] to play audio on the Hi-Fi from the RPi. I installed the Mopidy MPD extension[8], which allows MPD clients like M.A.L.P.[9] to connect to the Mopidy instance. I installed the Mopidy MusicBox extension[10] to provide a web client music player. I ran into a problem where Raspberry Pi OS wouldn't let me install any python packages via pip, including the Mopidy Jellyfin extension. All I had to do to fix the issue was to delete this file:


7: https://mopidy.com/

8: https://mopidy.com/ext/mpd/

9: https://f-droid.org/en/packages/org.gateshipone.malp/

10: https://mopidy.com/ext/musicbox-webclient/


sudo rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED

It took me some time to figure out how to get Mopidy and Jellyfin to both access .m3u8 playlists. Playlists are stored in Music/Playlists/, where Music/ is the directory where all other music is stored. I don't use the Mopidy Jellyfin extension[11], because I can't get it to play well with playlists. Playlists show up in both Jellyfin and Mopidy, but I have to create the playlists manually in the terminal. Mopidy doesn't have the ability to create playlists, and Jellyfin stores playlists as .xml files which Mopidy can't read. Yet, Jellyfin will happily add songs to an existing .m3u8 playlist; weird. It seems others have had similar problems judging by various[12] Github[13] issues[14].


11: https://mopidy.com/ext/jellyfin/

12: https://github.com/jellyfin/mopidy-jellyfin/issues/104

13: https://github.com/jellyfin/mopidy-jellyfin/issues/133

14: https://github.com/jellyfin/mopidy-jellyfin/issues/111


I installed Samba[15] to make it easier for others to add media from their devices, and I installed qBittorrent[16] (-nox variant with no X-server) to download media directly onto the server when it's connected to the internet.


15: https://www.samba.org/

16: https://www.qbittorrent.org/


To create backups I have an additional 1TB SSD which is synced using rsync[17] once a week. I have a third SSD that is synced every month, which I keep at work.


17: https://github.com/WayneD/rsync

-- Response ended

-- Page fetched on Sun May 5 06:17:24 2024