Another departure from the ESP8266, but for something that ESP8266-hackers might find interesting.
Over the past couple of years I’ve been ditching most of the big, ugly, power-hungry desk-top and server machines which used to run my mighty empire (aka “the house”) and replacing them with machines that are a lot smaller and a great deal less power-hungry. I’ve got a few SBCs of various sorts; all ARM based, mostly multi-core and almost all still shamefully naked and gathering dust, even though they’re alive and kicking and running various essential services on our home network. In addition to the lack of a case, almost all of them have other drawbacks of some sort (not well supported by the operating systems which I prefer to run, missing critical hardware, etc), so I keep looking for the perfect mini system.
I thought I’d found it a while back when I splashed out on a SolidRun CuBox-i4. It’s small (very small, in fact), has a quad-core processor, 2GB of memory, GbE, USB ports, HDMI and (a major plus) comes in a diddy little black-plastic case. Unfortunately, it turned out to be a major pain in the proverbial trying to install and run a reasonable operating system and lots of hoops needed to be jumped through (in the correct order) to even start the OS installation. It has been running FreeBSD for quite some time now, but it suffers greatly from the lack of a real-time-clock (and unlike a Raspberry-Pi, for instance, it’s not easy to add one), has limited USB functionality and tends to fall over in a messy heap at reboots if the moon happens to be full or the wind is coming from the east.
So the quest goes on for a truly great (cheap) mini system and, right in the middle of the purple Thursday (or was it cerise Saturday?) sales, I found a new system on GearBest that seemed too good to miss. Because it was on sale, it was a few dollars more expensive than normal (???) , but it was still a pretty good price, given the specs.
It’s an Intel quad-core Atom X5-Z8350 based system, with 2GB of main memory and 32GB of eMMC. It has GbE, two USB-2.0 ports and one USB-3.0 port. There’s also an SD-card slot and an HDMI video connector. For those who care (and I don’t), it also comes pre-loaded with Windows-10 (don’t ask me for more details on what specific version, because I don’t know). It’s a 64-bit system (but read on for the limitation on that) and it also comes with built in Bluetooth and a/b/g/n/ac WiFi (neither of which I’ve used). More importantly for me, it’s also a fanless system. It is advertised as coming with an “English User Manual”, but you can save yourself a few seconds of “I don’t believe this crap!” frustration by throwing said “manual” straight into the bin; there is nothing in it which is even remotely useful. It does come with a fairly substantial looking mounting bracket (to attach it to a monitor, or wall) and two HDMI cables — one short and one long(er). A power adapter is also included (but you need to make sure that you order the correct version for your particular country). The shipping box is also very sturdy and should hold up well if a passing elephant accidentally treads on it.
I would have been quite happy to boot into some sensible operating system and immediately wipe Windows from the disk (eMMC), but it was not to be. The one, big gotcha with this system is the BIOS. At first glance, the BIOS menus are very sparse indeed and you’re not going to get very far at all with this system unless you know the magic incantations (it may also help to have a spare chicken to sacrifice …I haven’t actually tried this yet, though). I did get through quite a few blank CDs and DVDs while trying to get various distributions to boot from a USB-connected DVD. No matter what I did though, the dang machine just kept on booting into Windows (which was quite disconcerting at first, as I couldn’t see how to shut it down). Some ‘net searches turned up suggestions for adding BIOS passwords (there are two in the version of BIOS which my machine has) to trigger extra BIOS menu items — Nope, doesn’t work. You can forget that. There was also one quite long diversion where some folks (seemingly correctly) noted that some functions which affect BIOS start-up are only available from within Windows, despite how stupidly chicken-and-egg-ish this seems to be (for those who want to try it, you need to select the shutdown function from the start menu and then hold down the shift key while selecting “shutdown”. This will bring up a whole scad of extra menus which will change the UEFI boot settings …and then it will just merrily boot straight back up into Windows again).
It turns out that the UEFI boot (which stands for “Unified ‘Effing Firmware Interface, by the way) is the key to all of this. It’s a versatile system which is replacing the outmoded BIOS of years gone by with an updated and secure method of booting you into Windows …and booting you into Windows …and booting you into Windows (you get the picture), no matter what you actually want to do. On some systems (and yes, the Z83-II is one of them) it has the added twist of limiting a 64-bit system to booting from 32-bit code (you’d better go back and read that sentence again …I wrote it and I still can’t quite grok it!). For some reason (lost in the mists of Redmont), Windows was/is limited to booting from 32-bit bootloaders, so because everyone-and-his-dog only ever runs Windows, some machines (like the 64-bit, Z83-II) have a UEFI which will –only– handle 32-bit bootloaders. Now before you start jumping up and down with your hand in the air shouting “Teacher! Teacher! I know! Just run a 32-bit OS!” you should also note that, because UEFI is new-ish and 32-bit systems are just so last decade, very, very few 32-bit distributions of any sort actually have any UEFI boot capability bundled into them at all.
I know the mantra is “never give up!”, but by this stage my fingers were twitching and the old grey-matter was sending signals to my hand to grab hold of that handy, 3kg lump-hammer and send the Z83-II and its UEFI back to meet its maker in very, very small pieces. It was only the nagging annoyance of those extra couple of dollars for the maroon Monday “sale” price that held my arm in check.
By this point I’d read so many posts and articles on the UEFI and booting systems that I’d actually stumbled across one piece of related (and essential) information which actually worked with the Z83-II. I’d discovered already that hitting <ESC> during initial, power-on boot would bring up the BIOS menu, but in a couple of posts related to other mini-pc systems people mentioned that <F7> would bring up the boot-device selection menu. It worked, too. Not only did I get a device menu (what the system had detected at boot up, rather than the BIOS preferred-device list), but it also gave a tiny bit of extra information about what the system thought it had detected on each particular device. For the most part, to begin with anyway, that information was limited to “Windows boot manager” on the eMMC device. This turned out to useful, though. It quickly became apparent that having a DVD in the drive with something that the BIOS (and, presumably the UEFI) could read would result in that entry in the <F7> menu changing to give the maker’s name and model, instead of just a vanilla “USB CD/DVD” entry. Unfortunately, very few of those DVDs would boot successfully, but at least it meant I didn’t have to go through the tedious process of having the system boot into Windows, yet again, if there was obviously no readable disk in the drive.
I’d read in a couple of places that the latest Debian versions (greater than 8.0) had solved this 32/64-bit problem, so I burned a couple more DVDs and tried them. I could get the extra info in the <F7> menu, but they wouldn’t boot. A couple of other mainstream Linux distributions were also flagged (in Distrowatch) as being fixed, but none of the ones I tried actually booted. Then I came across a reference to Ian Morrison’s Linuxium site. Ian obviously spends a lot of time mucking about with set-top boxes, mini-PCs and PC-sticks and has done a ton of work to get Linux booting on those devices. He has also modded some mainstream distributions to boot on these infamous 32-cum-64 bit devices. Ian’s modified Ubuntu 16.10 was the first thing that successfully booted on the Z83-II and proved that it could successfully boot and run something other than the dreaded “W” (thanks Ian!). If you’re looking for a stable Linux distribution you could do a lot worse than to mosey on over to Ian’s page and check out his offerings.
Finally there was light at the end of the tunnel. The Windows reboot cycle was broken. I went off to see what I had to do to get OpenBSD or FreeBSD onto the system. I didn’t have to look very far. In another one of those “Duh!” moments, it turned out that OpenBSD had also introduced the 32/64 UEFI fix and the latest snapshot (booted from a USB thumb drive this time) not only installed, but also automatically created a dedicated UEFI “i” partition and populated it with the required boot files. Not only that, but the BIOS now “knew” about the new, bootable drive and I could easily make it the default power-on boot device. Yay!
So, in summary …at power on, use <ESC> to get into the BIOS and <F7> to get into the boot device selection menu and use Ian Morrison’s modified versions of Linux, or OpenBSD 6.0 or greater, to prove that you can boot and install something other than “W” on the Z83-II.
…and don’t buy anything during a turquoise Tuesday sale.
For anyone who’s interested, the output from “dmesg” (OpenBSD 6.0) for this system is available here.
Update – I wrote this original article just a few days before Christmas in 2016. It’s now mid April 2017 and this little system has been running flawlessly for four months. I have to say that I really like it. It chugs along running as primary for all of the main services on our home network (DNS, DHCP, NTP, BOOT, Mosquitto, syslog, etc) and also works as the back-up hub for all of our other machines. The smaller, single-core machines on the network send their uncompressed dump files over the network and this machine pipes the data through the “xz” compressor (running on two of the four cores) before storing it to disk (the multi-core systems compress their data before sending it). The dump disks are on the USB3 bus and the throughput with the GbE network is a big improvement over USB2 and 10/100. The killer months are yet to come, though. This is a fanless system and, over the last four winter months it has been just mildly warm. It remains to be seen how it will deal with a hot, humid Japanese summer. I’ll be sure to let you know, either way.
Update – Sept 2017 – Well, we’re “over the hump” of the blazingly hot and steamily humid summer weather and this little system has just chugged along, right through the worst of it. I also threw some fairly heavy-duty, very large (hundreds of gigs) compression jobs at it during the height of August and monitored the CPU temperatures fairly closely (this wasn’t any sort of benchmark; it was work that needed to be done and I was quite worried that this fanless system might shut itself down half-way through, so I was keeping a close eye on it). With an ambient temperature hovering around 40C, the CPU reading never got above 82C, with the “xz” compression tasks limited to two cores (“xz -T2”). That’s hot, but not hot enough to melt anything.