Personal Linux server

In my previous post, I covered how I set up rudimentary home automation with Tasker and a Xiaomi Yeelight bulb. In this post, I’ll be sharing how I upgraded to a dedicated headless home automation server.


The first goal of mine to achieve with a new setup was to self-host: only use cloud-based services if absolutely necessary in order to prevent downtime in the case of an internet outage. As I covered in the previous article, the Yeelight supports LAN control, allowing a box on the local network to change the state of the bulb without going through a server in China. This could be achieved through my main PC, but since it would need to be always running in order for my lights to work, I decided instead that a low-power server would be much more suitable for my needs.


I went into researching the server with a few requirements: passive cooling, USB 3.0, Gigabit Ethernet and a price less than £80. I decided passive cooling would be necessary, as having a fan running 24/7 in my room would be very disruptive and unpleasant. I considered placing the server somewhere other than my room, however it would have rendered troubleshooting a nightmare as convenient physical access would involve me constantly going all over the house. The reason I wanted USB 3.0 and gigabit LAN was for my other planned use for the system -- a local backup server, stored on a 2TB 3.5” drive that was not in use.


I could then consider what my options were in terms of the system’s specifications. Usually I’m an advocate for doing something yourself, but this was one of the occasions where it didn’t make sense, as the CPU that fit all my requirements was the Intel Atom X5-Z8350, a processor only found on low-cost prebuilt media player-esque mini PCs from China. Furthermore, current PC RAM and GPU prices are through the roof, with the RAM shortage due to increasing production of mobile devices, and GPUs in extremely short supply due to cryptocurrency mining. As such, building a PC on a budget is a bad idea in the current climate. I ended up going with the Beelink Z83 II, which I bought from AliExpress.

The nameplate

It meets all my requirements, with a single USB 3.0 and three USB 2.0 ports, along with Gigabit Ethernet, 32GB of eMMC 5.1 storage and 2GB of DDR3 memory. Those figures might sound pathetic by modern standards (some phones now have 128GB of dual-lane UFS2.1 storage (more than three times as fast as eMMC 5.1, and even faster than SATA 3) and 8GB of DDR4 RAM), but are actually more than enough to run a lightweight CLI-based Linux distribution, even with fileserving and home automation processes running simultaneously.

As for the software, there was little debate in my mind as to what I wanted to run. I went with Ubuntu Server 17.10.1 for its simplicity and community support, with Home Assistant providing the home automation functionality of the system. Home Assistant is an open-source automation solution that runs on Python3, making it simple to install and set up on any Linux OS. I decided to install using a Python virtual environment which keeps it seperate from the rest of my Python installation. I haven’t realised the filesharing part of the system yet, as I still need to take some files off the hard drive, but I’ll probably end up using Samba rather than NFS for compatibility with my Windows PC as well as my Linux machines.

To keep up-to-date on this and future projects, join the mailing list by pressing the “Subscribe” button at the top of the page.

Comments

Popular posts from this blog

Writing a MicroPython Pi-hole for the ESP8266

The Casio F-91W

Mini server update