25 years of Rollercoaster Tycoon

A photo of The Big One, a rollercoaster at Blackpool Pleasure Beach

Last week, the game Rollercoaster Tycoon turned 25 years old. There’s a good retrospective from The Guardian, including interviews with two people who played the game in their youth and who now design rollercoasters, and the game’s designer, Chris Sawyer. Whilst its graphics felt dated even in 1999, it was well-received at the time and was a game that allowed plenty of flexibility with each scenario.

I have fond memories of playing Rollercoaster Tycoon – indeed, I spent much of the summer of 1999 playing through the various scenarios. And of course, I ended up buying both expansions, which added additional scenarios and new rides.

Rollercoaster Tycoon was the second of Chris Sawyer’s games that I played extensively. I also spent many hours playing Transport Tycoon, which was released in 1994 and came on floppy disks. It’s notable that Sawyer wrote most of the code for his games in Assembly, which meant that the games were light on system resources but also hard to port to other platforms.

More recently, I’ve played the open source clone, OpenTTD, which works on modern computers. And there’s OpenRCT2, which is an open source re-implementation of Rollercoaster Tycoon 2, although it uses the original data files.

Of course, realising that Rollercoaster Tycoon is now 25 years old is another sign that I’m getting old.

Is there a Zigbee network in your house?

A photo of our Smart Meter which states it is Zigbee certified

If you’re in the UK, and have a smart meter, then your home probably has a Zigbee network that you may not know about.

What is Zigbee?

Zigbee is a wireless mesh networking protocol, that is commonly used for smart devices. If you have smart lightbulbs, such as the Ikea Trådfri or Philips HUE range (sponsored link), then Zigbee is what these devices use to communicate with their hub.

Zigbee isn’t the same as Wifi. Wifi devices belong to the 802.11 family of IEEE standards, whereas Zigbee is in the 802.15 family . There’s a difference at the hardware level, so a device that supports Wifi can’t use Zigbee unless it has a specialised chipset. However, there is commonality between the two; like Wifi, Zigbee uses IP addresses, and operates on the 2.4 GHz band.

Our In Home Display, which shows our usage from our smart meters and connects using Zigbee

If you have smart meters for your electricity and gas, then these will use Zigbee to communicate with your IHD (In Home Display). This is the small device that shows your current and daily usage.

Can you access this Zigbee network?

No. Even if you have a device with Home Assistant and a Zigbee dongle, it won’t be able to see the Zigbee network that your meters and IHD use. I suspect this is because your electricity meter has its own SIM card, to access the internet to send your readings. If you could access this Zigbee network, then it may use your electricity meter’s internet connection and not your own.

There are, however, some devices that will bridge between this Zigbee network and your own Wifi network at home. Some newer IHD devices offer this, and if you’re an Octopus Energy customer, you can join the waiting list for the Octopus Home Mini. I joined the waiting list a few months ago, but I haven’t heard anything yet. Meanwhile, you can also buy a Glow CAD (Consumer Access Device) for £65, which can connect to Home Assistant. Alas, it’s out of stock at the time of writing.

Another option for Octopus Energy customers is this Home Assistant addon, which brings in your usage data. However, it updates half hourly unless you already have an Octopus Home Mini.

Other ‘secret’ networks in your home

In our home, we also have a couple of Thread networks. Thread is related to Zigbee in that it’s also in the 802.15 family, and is arguably a successor. Nest developed it to enable their smart thermostats to talk wirelessly to the heat link that connects to your boiler, so this makes one network. Newer Nest thermostats can act as a Thread Border Router and so other devices using Matter can connect to it, but we have an older model.

We also have a pair of Google Nest Wifi devices (a hub and a point) which use Thread to communicate with each other. Google has updated these to offer a Thread Border Router, and so I’ve been able to access this with Home Assistant, ready for when we have some Matter compatible devices. So at least I can access one of the three non-wifi networks in my home.

Further reading

Whilst researching this, I came across this Hacking Your Smart Meter (Part 1) article, although there doesn’t appear to be a part 2. Instead, the author, Terence Eden, uses an API from his energy company as above.

The Smart Meter Home Area Network is also a really useful article, on what is quite a well balanced web site about the various pros and cons of having a smart meter. Because we export excess energy from our solar panels, we need to have a smart meter to be paid back for what we export.

One mouse to rule them all

A photo of the Arteck multi device Bluetooth wireless mouse

Back in September 2002, I bought this multi-device Bluetooth mouse from Amazon (sponsored link). As a multi-device mouse, it can be used to control three separate devices.

I bought it so that I could use it both with my desktop, and my iPad – because yes, you can use a mouse with an iPad. It supports two Bluetooth devices, and can connect to a third using an RF USB dongle. I use the dongle with my desktop, as RF uses less power. Switching devices is as simple as pressing a button on the side.

As a mouse, it works quite well – clicking is quiet, and I’ve been using it for almost 18 months with no complaints. It’s a comfortable size too – not as big as some mice, but larger than some laptop mice. However, this model is designed for people who are right handed; I had a look for left-handed multi-device mice on Amazon but couldn’t find any.

The battery life is also really good – I recharge it about every three months. It has a built-in battery which charges using a USB-C cable, and this plugs in at the top so that you can still use it whilst charging. This makes it better than Apple’s Magic Mouse, which has its Lightning connector on the bottom and so can’t be used while charging. The USB-C port is just for charging though; it won’t turn your mouse into a wired mouse. There is also a small slide-out compartment to store the USB RF dongle if you’re not using it.

As well as the device switch button on the left side, there are two additional buttons which, by default, act as back and forward buttons in a web browser.

Whilst I’m sure there are other multi-device mice out there, this suits my needs and has worked well for me. It’s reasonably priced at around £19, at time of writing.

Mounting a USB hard drive on startup on Ubuntu Core

A photo of a Raspberry Pi 4 connected to a USB external hard drive

As you’ll be aware from my regular posts about it, I have a Raspberry Pi 4 running Ubuntu Core, which acts as a server for Home Assistant, Plex and Calibre-Web. Here’s how I’ve set it up to mount an external USB hard drive on boot up.

As it’s a Raspberry Pi, the operating system and binaries set on a microSD card, which in this case is a mere 16 GB. Whilst the me of 20 years ago would have been astounded at the concept of something so tiny holding so much data, 16 GB isn’t much nowadays. So, I have a 1 TB external USB hard drive for storing the media files for Plex and Calibre-Web.

Ubuntu Core doesn’t automatically mount USB storage devices on startup unless you tell it to, and the instructions for doing so are different when compared with a regular Linux distro.

There’s no fstab

Most Linux distros, including regular Ubuntu, include fstab for managing file systems and mounting devices. But Ubuntu Core is designed to be a lightweight distro to act as firmware for Internet of Things devices, and so it doesn’t include many tools that are common in other Linux distros. fstab is one such tool which is missing.

You can, of course, just mount a USB drive manually with the following:

sudo mkdir /media/data
sudo mount /dev/sda1 /media/data

But this won’t persist when the computer restarts. After a bit of searching, I found a solution on StackExchange; it’s for Ubuntu Core 16, but works on 22 as well.

How to tell systemd to mount your USB hard drive

It should go without saying that you should back up your system before doing any of this. If you make a mistake and systemd stops working, your device could become unbootable.

Firstly, you’ll need to run sudo blkid to list all of the file systems that Ubuntu Core can see. Find the one that starts with ‘/dev/sda1’ and make a note of the long hexadecimal string that comes after UUID – it’ll probably look something like ‘2435ba65-f000-234244ac’. Copy and save this, as this identifies your USB hard drive.

Next, you’ll need to create a text file. Ubuntu Core only seems to offer the Vi text editor, which I haven’t bothered to learn to use properly. My favoured text editor is nano, but it’s not available on Ubuntu Core. Therefore, my recommendation is to create a file on another device and FTP it across. The file should be called media-data.mount; it’s really important the file name matches the intended mount point. For example, if you’re instead planning to mount the USB hard drive to /mnt/files, this text file would need to be called mnt-files.mount.

Here’s the template for the file:

[Unit]
Description=Mount unit for data

[Mount]
What=/dev/disk/by-uuid/[Your UUID]
Where=/media/data
Type=ext4

[Install]
WantedBy=multi-user.target

You’ll need to paste in the UUID for your USB hard drive where it says ‘[Your UUID]’. You’ll also need to match the file system type; I have my external USB hard drive formatted as ext4 for maximum compatibility with Linux, but yours may use ExFAT or NTFS.

This file needs to be saved to /etc/systemd/system/media-data.mount . You can either use vi to create and save this file directly or FTP it across and copy it over.

There are three further commands to run in turn:

sudo systemctl daemon-reload
sudo systemctl start media-data.mount
sudo systemctl enable media-data.mount

If you’ve done this correctly, then the next time you restart your device, your USB hard drive should mount automatically. If not, then you should receive some surprisingly helpful error messages explaining what you’ve done wrong.

There’s another guide at Wimpy’s World which has some additional detail and helped me get this working.

Using Portainer to manage Docker

Screenshot of the Portainer web interface

So you may have noticed that I have a thing going on with Docker at present. I’ve set up Home Assistant in Docker, and more recently also set up calibre-web with Docker. Between these, and other Docker images, it’s quite a lot to manage – especially on a headless remote device. Thankfully, Portainer is a web-based solution to managing multiple Docker containers.

There’s a free community edition which offers sufficient features to manage one Docker system, which I’m using. If you need to manage multiple systems, there’s a Business Edition available that you need to pay for, but home users should get by with the Community Edition. Although you will see lots of greyed out options which are only available in the Business Edition – something anyone who uses a freemium WordPress plugin will recognise.

The installation instructions are detailed, and there are a number of steps that you’ll need to follow using the command line. Once everything’s set up, you’ll be able to open a web browser and see all of your Docker containers, and their status.

Portainer lets you start, stop and restart containers from the web interface, and delete any containers no longer needed. The feature that I’ve found most useful is the ‘Duplicate/Edit’ function, which allows you to easily duplicate a container, and optionally replace the original container with a new one with updated variables. This is great for people like me who invariably make a mistake when setting up a Docker Compose file. Logs are also made easily accessible, which helped me when troubleshooting a container that was starting but then wasn’t accessible through a web browser.

You can also run new containers in Portainer; whilst this is easier than typing out commands, Docker Compose works better for me as you can just copy and paste them.

If you’ve got a few Docker images up and running, I would recommend Portainer as an easier way of managing them. It’s much nicer than having to type out commands in a ssh session, and is a friendlier way of working with Docker for less experienced users, like myself.

Managing e-books with Calibre-web

Screenshot of the calibre-web interface

If, like me, you’ve picked up a number of e-books over the years, you may use Calibre as your e-book manager. It’s a desktop application with an optional web interface, but it has its drawbacks. The user interface is clunky, and it tries to cram lots of advanced features in – even the latest version 7 is overwhelming for new users. So, if you can forego the desktop application, there’s an alternative called calibre-web that does the same thing in a web browser, and with a much nicer interface.

Once installed, you can migrate your existing metadata.db from Calibre and the e-book folders, and calibre-web will pick up where you left off. I particularly like the ability to download metadata from sources such as Google Books, to get more complete data about each book besides its author and title. There’s a built-in e-reader, or you can use an app that supports OPDS – I used Aldiko.

By far the easiest way to install it is using Docker. There’s a good image on DockerHub; it’s maintained by a third-party but recommended by calibre-web’s developers. Once installed, it doesn’t require much additional configuration.

By default, calibre-web doesn’t allow uploads, but you can amend this in the Admin settings. The settings toggle s rather buried away, and it took me some time to find. But once uploads are enabled, it allows you to completely replace the desktop Calibre app if you want to. You can also set up multiple user accounts, if you want to share your calibre-web server with others.

I have calibre-web installed on the same Raspberry Pi as my Plex and Home Assistant servers. Indeed, calibre-web essentially offers a kind-of Plex for e-books, seeing as Plex doesn’t offer this itself. Unfortunately, most of my e-books were purchased through Amazon, and so only accessible through their Kindle apps and devices. But for the handful of books that I’ve picked up through the likes of Unbound and Humble Bundle, it’s helpful to have them in one place.

Adventures in setting up Homebridge for HomeKit

A screenshot of the Homebridge dashboard

A recent project of mine has been to get Homebridge up and running. It’s a server-based program that acts as a bridge between smart devices in the home, and Apple’s Home app on iOS.

One thing, I don’t know why

HomeKit, the technology underpinning Home, is famously limited; whilst most smart devices support Amazon’s Alexa and Google Assistant, very few support HomeKit. Indeed, out of the various smart speakers, plug sockets, dishwasher, thermostat, smoke alarm and TV that we have in our house, it’s only the TV that natively supports HomeKit.

Whilst just about everything else (except the smoke alarm) supports Google Assistant, and the Google Home app, it would be helpful to be able to use these devices with Siri. For example, when I’m driving, I want to be able to use the Hey Siri command to turn the heating on, so that we don’t come home to a cold house.

I tried so hard, and got so far

There’s a few ways to run Homebridge. If you have money to spare, then by far the easiest way is to buy a HOOBS box. HOOBS stands for ‘Homebridge Out of Box System‘, and you’ll get a plug-in device with a customised version of Homebridge that is simple to set up. You can also buy HOOBS on an SD card, that can be slotted into your own Raspberry Pi. Or, you can just download the HOOBS SD card image for a donation of £10.

I have two Raspberry Pis – a RPi 400 which is our seven-year-old’s computer, and a RPi 4 which is my Plex server. The latter runs Plex under Ubuntu Core, a minimal version of Ubuntu Linux which doesn’t include a graphical user interface, or even the Aptitude package manager. Instead, apps can be installed using Snap packages, which enforces greater sandboxing and security. There is a Snap package for Homebridge, but I couldn’t actually get it to work; once installed, I couldn’t open the browser page as instructed.

So, I’ve installed it using Apt on our child’s Raspberry Pi 400, and followed the proper instructions.

There’s only one thing you should know

When you first start Homebridge, it won’t do much initially. To get it talking to your devices, you’ll need to install the appropriate plugins, which you can do through the web UI. I suggest going with the plugins that have been ‘verified’ first, as you’ll probably find that there’s more than one plugin for some of the more popular services like Nest. Whilst installing plugins is relatively easy, configuring them can be difficult:

  • The Nest plugin, for example, has you logging into your Google Nest account in Chrome’s Incognito mode, whilst having Developer Tools open. You then have to copy and paste various data from the HTTP headers.
  • I have a series of smart plug sockets which use the Tuya Smart Life platform, but I had them registered under a different app which Homebridge can’t connect to. I had to de-register them and then set them up again on the official Tuya app.
  • Despite following the instructions, I couldn’t get my Bosch smart dishwasher to connect

Setting up Homebridge is therefore something best reserved for people who are comfortable using the Linux command line and with at least an intermediate understanding of how devices work. However, it does mean that I now have these devices in HomeKit as planned.

Homebridge even supports my Solar Inverter, although in a rather odd way. It appears as 12(!) separate accessories in the Home app, seeing as HomeKit doesn’t ‘know’ what a solar panel is. You can also make the Google Home app talk to Homebridge – again, this is the only way that I can make my Solax system work with Google.

But in the end, it doesn’t even Matter

Those of you who follow news in the smart devices/Internet of Things space will be aware of Matter, a new unified smart device standard with the support of Amazon, Apple, Google and Samsung. Matter will hopefully do away with the separate ecosystems that each company offers, and any Matter approved device should work with any other. However, the final Matter specification was only agreed last year, and I’m not expecting many of my existing devices to be updated to support it. At best, my Google Nest Mini devices will be updated soon, and my thermostat may be updated. For others, I would probably have to replace them with Matter-enabled devices in due course. Therefore, Homebridge offers me the flexibility that Matter will hopefully bring as an interim solution.

Shiny new iPad

iPad Mini with Retina Display

As I mentioned on Sunday, my birthday present from my parents was a shiny new iPad Mini with Retina Display. We bought it from the Apple Store in Trinity Leeds, since we were going to Leeds for a birthday meal anyway.

This is to replace my old iPad, a first generation model. Although I’ve only had it for a year, it’s now over three years old and no longer supported by Apple. It won’t even run iOS 6, never mind iOS 7. Many apps either won’t install at all, or can only run as an older version. Plus, it’s rather slow and some apps, including Apple’s own like Safari, crash a lot. Whilst the larger screen means it’s better to use than my iPhone for some things, for others it was slow and frustrating – I’d avoid browsing sites like Buzzfeed or Lifehacker because of the risk of crashing it.

Choosing an iPad

I’d narrowed the choice down to the iPad Air or the iPad Mini with Retina Display. I ruled out the older models – the iPad with Retina Display and the iPad Mini (without Retina Display) – because they came with older processors which are much more likely to be deprecated by Apple within a few years. I didn’t want to be in the same situation again with my iPad in a couple of years’ time.

The two models are basically identical inside – same processor, battery life and features. The only difference is the size of the screen (the resolution is the same), the weight and the price. At £80 cheaper, we decided to go for the iPad Mini.

Personal setup

When you buy a product at the Apple Store, a ‘Personal Setup’ service is offered to get you up and running with the device. As we had some time to spare, I decided to take them up on the offer. This turned out to be a good thing. Because myself, and the member of staff who sold me the iPad, learned the hard way what happens when you try to restore an iCloud backup from an iPad 1 running iOS 5, to an iPad Mini running iOS 7. Suffice to say, it got stuck in a soft reboot loop and was completely unusable.

To their credit, the staff at the store were really good about it, and took responsibility for the problem. I should have been advised that this wouldn’t work. Instead, I should set the new iPad up as a new device, rather than using a backup from an iOS 5 device as a starting point. So the iPad Mini, now essentially bricked, will be sent back to Apple, and I was given another iPad Mini to take away. I decided not to go through the Personal Setup this time, instead waiting to get home so that I could do it at my own pace. It’s working fine, as shown in the above photo.

I’m glad that the reboot problem happened in the Apple Store and not at home, as I’m not even sure that I’d have been able to force a factory reset on the device. But perhaps Apple should have coded this into the iPad setup program, and displayed a warning that restoring a backup from such an old device to a new one is a bad idea.

Anyway, my new iPad Mini is great. It’s so much lighter than my old one, and the screen is only a bit smaller. It’s not quite so good for reading magazines, as the text is a bit small, but at least when I zoom in the text doesn’t become so pixelated as it did on my old iPad. And apps like Facebook, YouTube and 1Password are actually usable now, and others, like Pocket, are much, much faster.

My favourite add-ons for Thunderbird

A screenshot of the Thunderbird add-ons web page

It’s been some time since I used Mozilla Thunderbird at home – I switched to Sparrow, then Apple’s own Mail app, before settling on Airmail last year. But at work, where I deal with a high volume of email, I prefer to use Thunderbird, instead of the provided Outlook 2010. There are a few add-ons which help me get stuff done, and so here is my list:

Lightning

Unlike Outlook, Lotus Notes or Evolution, Thunderbird doesn’t ship with a calendar. Lightning is an official Mozilla extension which adds a reasonably good calendar pane. Calendars can be local, subscribed .ics files on the internet, or there’s basic CalDAV support as well, and it works well with multiple calendars. A ‘Today’ panel shows up in your email pane so you can quickly glance at upcoming appointments.

Once you have Lightning installed, there are some other calendar extensions you can add. Some people use the Provider for Google Calendar extension – I don’t, as nowadays Google Calendar supports CalDAV so there’s no need for it. If you need access to Exchange calendars, then there’s also a Provider for Exchange extension too, although as we’re not (yet) on an Exchange system at work I haven’t yet tried this.

There’s also ThunderBirthDay, which shows the birthdays of your contacts as a calendar.

Google Contacts

If you use Gmail and its online address book to synchronise your contacts between devices, then Google Contacts will put these contacts in Thunderbird’s address book. It doesn’t require much setup – if you’ve already set up a Gmail account in Thunderbird then it’ll use those settings.

This is probably of most interest to Windows and Linux users. On Mac OS X, Thunderbird can read (and write, I think) to the global OS X Address Book, which can be synchronised with Google Contacts and therefore this extension isn’t needed. In the past, I used the Zindus extension for this purpose but it’s no longer under development.

Mail Redirect

This is a feature that older email clients like Eudora had, which allowed you to redirect a message to someone else, leaving the message intact. Mail Redirect adds this is a function in Thunderbird.

It’s different to forwarding, where you quote the original message or send it as an attachment – with Redirect, the email appears in the new recipient’s inbox in almost exactly the same way as it did in yours. That way, if the new recipient replies, the reply goes to the sender and not to you.

Thunderbird Conversations

If you like the way that Gmail groups email conversations together in the reading pane, then Thunderbird Conversations is for you. It replaces the standard reading pane, showing any replies, and messages that you have sent – even if they’re in a different folder. You can also use it to compose quick replies from the reading pane rather than opening a new window.

LookOut

Although this extension apparently no longer works, LookOut should improve compatibility with emails sent from Microsoft Outlook – especially older versions. Sometimes, attachments get encapsulated in a ‘winmail.dat’ file, which Thunderbird doesn’t understand. LookOut will make these attachments available to download as regular files. Hopefully someone will come along and fix it, but there hasn’t been an update since 2011 so I’m guessing this extension has been abandoned.

Smiley Fixer

Another add-on that will make working alongside Outlook-using colleagues a bit easier. If you’ve ever received emails with a capital letter ‘J’ at the end of a sentence, then this is Microsoft Outlook converting a smiley :) into a character from the Wingdings font. Thunderbird doesn’t really understand this and just displays ‘J’, which is where Smiley Fixer comes in. It will also correct a few other symbols, such as arrows, but you may still see the occasional odd letter in people’s signatures.

Enigmail

If you use GnuPG to encrypt messages, then you’ll probably have the Enigmail extension installed. Though it originally was a pain to set up, nowadays it seems to work quite well without a lot of technical knowledge. It includes a listing of all of the keys in your keychain, and you can ask it to obtain public keys for everyone in your address book should you wish.

Dropbox for Filelink

Some time ago a feature called ‘Filelink’ was added to Thunderbird, which allowed you to send links to large files, rather than including them as attachments. Whilst most people nowadays have very generous storage limits for their email, sometimes it’s best not to send large files as email attachments. Thunderbird supports Box and the soon-to-be-discontinued Ubuntu One services by default, but you can use the Dropbox for Filelink extension to add the more popular Dropbox service. Another extension will add any service which supports WebDAV which may be helpful if you’re in a corporate environment and don’t want to host files externally.

These are the extensions that I use to get the most out of Thunderbird. Although I’ve tried using Outlook 2010, I still prefer Thunderbird as it’s more flexible and can be set up how I want it.

Fixing high memory usage caused by mds

Screenshot of activity monitor on Mac OS X showing mds with high memory usafe

Recently my Mac Mini has been running very slowly, with some programs freezing for as much as several minutes. I pruned the list of items that were running on startup but this didn’t seem to make much difference.

So I opened Activity Monitor (the OS X equivalent of Task Manager) and found a process called ‘mds’ was consuming huge amounts of RAM and virtual memory. MDS is the process which builds an index of your disks for use by Spotlight, the tool that lets you search your drives, and also by Time Machine for backups. Sometimes MDS requires a fair amount of RAM, but it was using almost 2 gigabytes of virtual memory and almost a gigabyte of RAM in my case. I only have 4 gigabytes of RAM in total, and so this was causing major problems as OS X had to regularly swap data between RAM and the paging file.

I’d tried looking into this before and got nowhere. Most of the results in Google were discussions on Apple’s support forums, which were devoid of any real solutions. But eventually I found this post on iCan’t Internet which actually had a solution.

Firstly you should run Disk Utility. Repair your hard disk, and also repair the disk permissions. This may fix your problem, but it didn’t in my case so I moved on to the next step.

Open up Terminal, and type in the following command: sudo mdutil -avE . This runs a tool called ‘mdutil’, and tells it to completely rebuild Spotlight’s index. It turns out that the index on my hard disk had got corrupted somehow, and this was causing problems with the ‘mds’ process. It took a while for the command to run, but afterwards a huge amount of RAM and virtual memory became free. Unsurprisingly, my Mac ran much more happily after this.

Hopefully if you’ve have the same problem this will help. It has certainly breathed new life into my increasingly sluggish computer.