January 29, 2021

Micronetia Hardware

AKA What Pi should I use?

One of the concepts of the Micronetia project is that you should be able to pick and choose. To that end there's the question of hardware. In the other posts I have mentioned a pi 3 or pi 4 without really saying why you might want to spend more money for the latter and, indeed, how much memory you should get if you get a pi 4.

The TL;DR is that anything less than a Pi 3B+ is likely to run out of horsepower when placed under any sort of load, but they may (possibly with some tweakery) work. Any Pi 4 will also work, but if you are just planning on running a blog you don't need a Pi 4 so if $20 makes a difference to your finances go for the Pi 3B for now.

Hardware Drill down

The first thing to be aware of is that, despite the fact that we mention pis, absolutely nothing here requires a pi. Almost any old PC that can have Ubuntu or some other flavor of linux running on it can be used instead, but I don't (yet) have instructions for how to install and build all the bits on such a platform. But if you know linux you can take a look at the various scripts and bits in the micronetia gitlab repo and adapt the instructions to do things yourself.

Fundamentally it all boils down to performance, and compared to a "real" server any pi or low end Intel/AMD PC will appear relatively feeble. This is why a key part of the basic strategy is to have Cloudflare proxy and cache the site so you don't get so many direct hits. As a result, technically most of what is proposed could run on any pi, but the more you use the pi platform the more you will appreciate the more powerful ones. In particular the original Pis and the newer even smaller Pi Zeros have a really limited amount of RAM and a particularly puny CPU (see paragraph at the end) so their performance will be noticeably worse. But because cloudflare does much of the cacheing, if you already have an unused pi lying around then you can probably just use that one.

I should also note that because pis are cheap, there is absolutely nothing stopping you from using more than one. Indeed if you have, say, a teenager who wants to get into IT in the vicinity, then having that teen adapt the instructions so as to have one or two act as the load balancers for a number of separate back end server pis would be a valuable learning experience.

If do you need to buy a new one, the cheapest platform would appear to be a pi zero with a USB network adapter or a pi zero w (with built in wifi). In both cases once you have bought all the required additional components you are looking at about US$30-$40, which is about half the price of the cheapest pi 3B kit. (The Pi 1 and Pi 2 models, if available, are no cheaper than Pi 3s and have lower capabilities so there's no point to buying one). There's a section below discussing how to get things up on a pi zero if you really need to but the pi zero is probably too underpowered to handle any load more than a trivial one, even with the Cloudflare proxy - though I do plan to test this because there are some attractive but subversive use cases for it.

Pi Comparisons

Realistically we're looking at the Pi 3B+ or Pi 4 platforms, though in the table below I'm including the Zero just for completeness

Pi VersionCapabilitiesCanakit bundle and price
Zero WWifi, 1GHz processor with 512MB RAMPi Zero Wireless Starter Kit (PI-ZERO-W-KIT-103) $34.95
3B+USB 2 speeds, 1.4GHz 64-bit quad-core ARMv8 CPU with 1GB memoryPi 3 Model B+ Starter Kit - 16 GB (PI3P-STR16-C4-BLK) $79.95
4 - 2GBUSB 3, 1.5GHz 64-bit quad-core ARMv8 CPU with 2GB memoryPi 4 2GB Starter Kit - 32GB PI4-2GB-STR32F-C4-BLK $79.95
4 - 4GBUSB 3, 1.5GHz 64-bit quad-core ARMv8 CPU with 4GB memoryPi 4 4GB Starter Kit - 32GB PI4-4GB-STR32F-C4-BLK $99.95
4 - 8GBUSB 3, 1.5GHz 64-bit quad-core ARMv8 CPU with 8GB memory, needs 64bit OS for optimum usagePi 4 8GB Starter Kit - 32GB PI4-8GB-STR32F-C4-BLK $119.95

The big advantages of the pi 4 platform are that it has more RAM and secondly that it has USB 3. This latter means the Gigabit Ethernet adapter really is Gigabit Ethernet in speed and, probably more importantly, there are two high speed USB ports that you can use to plug in, say, a USB SSD drive and get far better performance than you can get from a SD card.

The primary disadvantage is that people have found that it can overheat under load unless you have a fan and the fan can be noisy. I have 2 pi 4s and for one of them the fan ended up being so annoyingly loud I disconnected it. It still works fine as a DNS server without the fan and I expect it would be fine for micronetia but you should be aware of this potential issue. A pi3 works just fine for micronetia and doesn't need a fan.

My experience on actually trying to buy things is that the 2GB Pi4 is almost unobtainable even though it would be absolutely fine for the task at hand and the same price as a pi 3B+. This means that if you want a pi 4 you'll be buying a 4GB one which is $20 more, so if money is tight you'll want a Pi 3.

Going up in spec, an 8Gb pi4 is almost certainly way more memory than you need unless you plan to use the pi for a ton of things in addition to the basic micronetia tasks. The 8GB Pi seems to have introduced mainly to be used as a desktop computer. Since the micronetia project uses Pis as servers there is no need for the 4K graphics and desktop apps that benefit from large amounts of memory (you won't, for example, be opening 155 different tabs in a browser in a micronetia Pi).

That also means that the Pi 400 - while a really cool product - is not needed. Although there might be an interesting use case for a Pi 400 that is used for both the Micronetia project and something else...

Buying your Pi

In the table above I linked to various pages on Canakit's website. The links are all to bundles that include everything you need to get you going, but you don't have to buy a bundle or buy a bundle from Canakit, there are plenty of options.

All you need is the basic pi, a case, a power supply and a Micro SD card. The Canakit bundles give you all of that plus an HDMI cable that you don't need and includes both a micro SD card and USB card reader that you may not need if you already have these things.

In addition to Canakit, you can buy Pis and Pi accessories on Amazon or direct from various providers like Vilcros, Adafruit, Okdo and so on that are listed at the bottom of the various Raspberry Pi hardware pages. I have found that sometimes it is cheaper to buy the basic pi computer from one place and the case/PSU kit from somewhere else, though this of course depends heavily on the price of shipping.

A High End Pi 4 Spec

If you want to create a powerful micronetia server that can be used for far more than just blogging then the key additional accessory will be an external SSD that you plug into one of the USB3 ports on your pi 4. In my testing the external SSD has read and write speeds anywhere from five to ten times the speed of an SD flash card.

My tests have shown pi4s to get about 44MB/s non-cached read speeds on SD cards and about 350MB/s on external SSDs. ( An external hard drive will typically be somewhere between the two - on the disk I tested I got a read speed of just over 100MB/s and is of course a lot cheaper than the SSD on a $ per gigabyte basis. )

A 1TB SSD probably doubles the cost of your Pi investment but it gives you a system you can use as a NAS (network attached storage) and/or streaming server locally as well as running ghost and all the other wonderful micronetia applications.

Pi Zero (W) and Pi 1 Issues

The Pi Zeros and early Pis are notable for one other problem beyond their lack of memory. They use a slightly different ARM processor architecture (ARMv6) while other Pis use ARMv7. That results in a couple of software support issues.

The first issue is that the recommended blogging platform - ghost - depends on node.js and newer node.js versions are not built for the ARMv6 instruction set of a pi zero (or pi 1), however ghost can theoretically run with node v10.x which is the last version that has an armv6 build so if money really is tight you ought to be able to adapt the instructions/script to try to install that version instead.

The second issue is that the official cloudflared, although it is supposed to support ARMv6 is compiled in a way that doesn't. There's a long-standing bug filed about this and some enterprising person has compiled versions that work.

The cloudflared replacement works great but I have had issues actually getting ghost to install on a Pi 1. It worked once out of three tries and that try took several hours to complete (the times when it failed seemed to be due to network errors but there may have been something else triggering them like a running out of RAM). However you can use the builtin nginx webserver on the micronetia to serve static web pages just fine. In that case you can install ghost or some other blogging platform on your PC and run something like hugo to build static versions of your blog that you then transfer to the Pi.