Fixing a Guitar Hero World Tour/Guitar Hero 5 guitar strum bar

Kristina and I had a date night last night in which we ate trashy food and then took the Xbox 360 out of storage and fired up Guitar Hero: Warriors of Rock. It was an excellent time except that my Guitar Hero World Tour guitar had stopped registering downward strums, and only upwards strums worked.

I figured I’d pull it apart today and see what was up, and thanks to this guide I figured it out, and am documenting it here for posterity (my problem wasn’t one of the ones described in that guide, but it was very handy to see how to disassemble the thing in the first place).

Tools needed for disassembly

  • Philips-head #0 and #1 screwdriver
  • Torx T9 screwdriver

Process

Firstly the neck needs to be removed, and the “Lock” button at the back towards the base of the guitar set to its unlocked position.

Next, the faceplate needs to be removed. This can be done by just getting a fingernail or a flathead screwdriver underneath either of the top bits of the body, pointed to with a arrow here, and gently prying it away from around the edges.

After that, there’s twelve Torx T9 screws to remove, circled in red, and another four Philips-head #0 ones, marked in green.

Once they’re all out, you can gently separate the front of the guitar where all the electronics live from the back of it.

Next there’s four Philips-head #1 screws to remove to get the circuit board that contains the actual clicky-switches away from the strum bar itself. Leave the middle two alone as they attach the guides for the springs of the strum bar.

After this, it’s a bit of a choose-your-own-adventure, as what you do next really depends on what’s wrong with the strum bar. On the underside of the circuit board above are the switches, it’s definitely worth making sure they both click nice and solidly when you press on them directly. If they don’t, it’s apparently possible to source exact replacements (“275-016 SPDT Submini Lever Switch 5A at 125/250VAC”) and fix it with a bit of soldering, but thankfully this wasn’t necessary in my case.

In the next image, undoing the Philips-head #1 screws circled in blue will allow you to take the strum bar assembly itself out and give it a re-lubricating (don’t use WD40, use actual proper lubricating grease) to make it rock back and forth a bit more smoothly. Another improvement you can make is adding a couple of layers of electrical tape to the areas I’ve circled in red. They’re where the strum bar physically hits the inside of the case, and the electrical tape can dampen the noise a bit.

What the strum bar problem ultimately ended being in my case is that the middle indented section where the switch rests against the strum bar to register a downstroke had actually worn away and could no longer press the switch in far enough to click. My solution, circled in green, was to chop a tiny piece of plastic from a Warhammer 40,000 miniature sprue and glue it—with the same plastic glue I use for assembling plastic miniatures—to the strum bar. Then I reassembled everything and it’s as good as new!

A bread update!

I blogged back in October last year about how I’d started making my own bread from scratch, and I haven’t stopped! I still haven’t graduated to sourdough yet (my one attempt was poorly timed in retrospect, it was right in the middle of everyone panic-buying flour and things around when coronavirus was really becoming a thing, and I didn’t want to waste a whole bunch of flour), but I’ve settled into a delicious routine with the “Saturday Overnight White Bread” recipe. I’m using 20% whole wheat flour, have bumped the water from 780mL to 790mL, and use a full quarter teaspoon of yeast (the recipe says “a scant quarter”). It’s at the point where I don’t even need to look at the recipe, I’ve got the timings and measurements totally memorised.

As well, Kristina bought me a pair of proofing baskets for Christmas last year, and MAN do they make a difference! They help keep the shape of the loaf and also wick moisture from the surface of it, which makes the crust come out even better. Feast your eyes on these beauties.

A photo of two golden brown loaves of bread sitting on a cooling rack.
A photo of two golden brown loaves of bread sitting on a cooling rack.
A photo of two golden brown loaves of bread sitting on a cooling rack.
A photo of two brown loaves of bread sitting on a cooling rack.

My associated lunches have been excellent as well, they’re primarily either cheese and tomato toasties with a recent addition of capsicum, or mushrooms cooked in a frying pan with garlic, sage, and rosemary, sitting on top of thickly-sliced tomato (also cooked in a frying pan) with crumbled up sharp cheddar cheese on top.

A photo of two cheese and tomato toasties sitting on a plate, with diced capsicum on top.
A photo of two slices of homemade bread sitting on a plate, topped with thick slices of tomato with mushrooms on them, and small pieces of crumbled up cheddar cheese atop it all.

Beanie has gotten to know the exact sound of a knife cutting through bread, because whenever I start he’s over into the kitchen like a shot waiting for crumb fallout and also the tiny useless end-piece we always give him.

Apple Watch, one year on: fitter and healthier than ever

I blogged last year about getting an Apple Watch and the 23rd of this month marked a full year of owning it! I’m extremely pleased to say that I’m now fitter, healthier, and stronger than I’ve ever been in my entire life. 💪🏻 I’ve also closed all three activity rings on every single day since I bought the Watch!

I mentioned in that post that I was down to 70kg, after that (but prior to COVID) I hit 69kg, which I haven’t been since I was in my very early 20s. After we started working from home full-time in mid-March, I settled into a really good exercise routine: during the week I finish work around 5:30pm, then on every day but Monday and Friday I’ll go for a burn on the elliptical while watching an episode of something on Netflix (Saturdays and Sundays are also elliptical time, but at whatever point I feel like doing it during the day). It’s amazing how quickly time passes when you’re not concentrating on the fact that you’re exercising. I’d started watching Star Trek: The Next Generation prior to COVID, but went through the episodes much more quickly after it, and finally finished it last month.

Fun side note, I thought I’d watched way more episodes than it turns out I have… as I was making my way through the episodes, I’d remembered seeing the pilot episode before, then a random smattering of maaaaybe five to ten episodes in the middle, and then the series finale, but that was it. It was pretty fun to watch the progression of the series, and I think at this point I enjoy Star Trek more than I do Star Wars. After I finished TNG, I took a brief Trek break to watch Warrior Nun (IMDB’s blurb says “After waking up in a morgue, an orphaned teen discovers she now possesses superpowers as the chosen Halo Bearer for a secret sect of demon-hunting nuns.” HIGHLY recommended, I loved it), and have now started watching Star Trek: Deep Space Nine. I’m only a few episodes in, but again, I’ve definitely seen the first episode before but none of the other four I’ve watched thus far.

The elliptical has its own calorie counter in it, I have no idea how accurate it is because it doesn’t take into account your weight, and the Apple Watch doesn’t take into account the fact that I’ve got the incline on the elliptical at 14 degrees and the resistance set to 14 out of 22, but regardless it’s a hell of a workaround. After a typical 45-minute episode of a TV show, the elliptical says I’ve burnt around 650-700 calories, and the Apple Watch says 425-450 calories.

On Mondays and Fridays, instead of using the elliptical I do some weight training. I bought a pair of neoprene-coated 4kg dumbbells and have been doing twelve of each of the exercises from this article, three times each. I really like that Women’s Health Magazine article because it’s not pretentious and just says “Hey if you want some toned arms, do these things.” Pretty much all the ones aimed at men that I found were all of the “RARRRR GET RIPPPPPED BROOOO” which I just… just, no. 😑

As a result of all of this, I’ve actually gained weight and am now 71kg, but it’s all muscle mass, aw yiss. I’ve never actually had properly visible muscles, so this is a new look for me. 😛

On the odd occasion that I’m feeling a bit pooped-out for whatever reason, rather than using the elliptical or doing weight training, I’ll just go for a brisk walk on the treadmill and listen to part of a podcast. (Speaking of podcasts, I’ve basically entirely stopped listening to them except for when I’m occasionally using the treadmill… my commute into the city was my podcast listening time, and with that gone, I just don’t really do it anymore).

My primary use for the Apple Watch is still definitely fitness, but I’ve also really enjoyed the little notification buzz you get on your wrist when you get an iMessage or SMS. It’s totally unobtrusive and as someone who leaves all of their devices muted at all times, it means I don’t actually miss messages that need a timely reply, but if it’s not important I can just ignore it. The other handy thing I’ve found is using Siri to set custom timers. I don’t have any of the “always listening” Siri stuff on on any of my devices, but I have the Watch set to activate Siri when you hold the digital crown in for a couple of seconds. It’s super-handy when I’m timing my bread-making or barbecuing to just say “Set a timer for four minutes”, or whatever non-standard time it is, rather than having to futz around pressing things.

A year on, the Apple Watch is still one of my favourite gadgets and I’m keen to see what sort of additions Apple makes to it in the coming years!

Improvements in photographical skill

Back in June I blogged about the Flickr Memories functionality I’d added to my website, and finished the post off with this sentence:

I’m excited to see what forgotten gems from the past show up, and also being reminded of how terrible I was when I was first starting out taking photos. 

And oh boy, has it delivered on that second part in particular! I make a point of checking both my formerly-Tumblr-posts Memories page where I post all my random iPhone photos as well as the Flickr one each day, and in August of both 2008 and 2012 we were in Boston (in 2008 it was the first time I was visiting Kristina overseas back when she was still living there, and in 2012 we went back for her birthday) and I’d posted all the trip photos to Flickr.

Looking back at the 2008 photos (and all the photos I’d taken prior to that), they’re very much just happy-snaps… there was zero processing done on them, they were awkwardly-framed and weren’t straightened — crooked horizons ahoy! — and there was no culling, I’d just post them allll. I have a collection created for that trip where you can see the full horror (check out the sheer number of photos in the Mt. Auburn Cemetery album for example… why did I need to post that many?!).

In 2009 I borrowed an old Canon EOS 400D from a co-worker at Apple for a while, which was my first exposure to a proper DSLR and properly-shallow depth of field, as well as shooting in RAW, and doing actual post-processing. I had way too much fun adding heavy vignetting to everything, but I was starting to cull my photos rather than just dumping everything online!

In 2010 we bought a Canon EOS 7D with a 35mm f/2 lens, and my photography and processing skills definitely improved (that link is every single photo I took with the 7D, in order of date posted from oldest to newest).

Going back to Boston, some sample photos from Rockport and Boston Public Library on 2012’s trip shows the improvement from 2008. For some reason I was pretty far into too-heavy-handed territory with the post processing specifically for the Boston trip photos, but you can see the greatly-improved framing and composition.

From there on my skill has been on a upwards path, and thankfully I’ve stopped doing the EVERYTHING MUST BE REALLY HIGH CONTRAST thing I was doing for a while there. 😛 For travel photos specifically, the easiest way to see the progression is the “Travel” category of posts I have set up here! Some choice examples:

A while back I’d toyed with the idea of reprocessing my older photos, in particular the 2012 Boston ones, but I realised that way lies madness and never-ending editing, and I wouldn’t have a nice historical record of my photographical endeavours like I do now.

Memories redux: Flickr

I posted back in December that I’d created my own version of Facebook’s “Memories” feature for my formerly-Tumblr-and-now-Mastodon media posts, and even at the time I’d had the thought of doing it for Flickr as well, since that’s where all my Serious Photography goes.

Well, now I have!

It wasn’t quite as straightforward as my Media memories functionality, because there I could just do a single database call, but for Flickr I’m having to make multiple API calls each time. Fortunately two of the search parameters that flickr.photos.search offers are min_taken_date and max_taken_date, so my approach is to run a query for whatever the current day of the year it happens to be for each year going back to 2007—this being when my account was created and when I first started posting photos to Flickr—with the min_taken_date set to 00:00 on that particular day, and max_taken_date set to 23:59 on that same day. It does mean that currently there’s 13 API calls each time the Memories page is loaded and this will increase by one with each year that goes past, but Flickr’s API docs say “If your application stays under 3600 queries per hour across the whole key (which means the aggregate of all the users of your integration), you’ll be fine”. That’s one query every single second for an entire hour, which absolutely isn’t going to be happening, so I ought to remain well under the limit.

I’m excited to see what forgotten gems from the past show up, and also being reminded of how terrible I was when I was first starting out taking photos. 😛

And now for something completely different: Anzac biscuits!

And now for something completely different: Anzac biscuits!

A disclaimer up front: I can’t claim any credit whatsoever for this recipe, my co-worker Rachel posted about it at work and I asked if she minded if I re-posted the recipe here!

With Anzac Day just past, another thing from this time of year is Anzac biscuits:

The Anzac biscuit is a sweet biscuit, popular in Australia and New Zealand, made using rolled oats, flour, sugar, butter (or margarine), golden syrupbaking soda, boiling water, and (optionally) desiccated coconut. Anzac biscuits have long been associated with the Australian and New Zealand Army Corps (ANZAC) established in World War I.

As mentioned above, my co-worker Rachel posted her own recipe that’s based as closely as possible on the really early Anzac biscuit recipes, and I made them last night and they’re amazing.

There’s two recipes, one is the pre-1920s version without coconut, and the other is with coconut and more sugar. I made the pre-1920s one as Kristina can’t eat coconut. The method is identical, just the ingredients differ.

I should also point out that they should go a lot flatter than in the picture above, but I cheated and microwaved the butter and golden syrup in the microwave rather than heating it on the stove, so the mixture didn’t stay warm and it didn’t end up spreading.

Ingredients

  • 1 cup plain flour (all purpose flour)
  • 1 cup rolled oats (not steel cut or quick oats)
  • 1 cup sugar (part white sugar, part soft brown sugar)
  • 3/4 cup desiccated coconut
  • 115g salted butter
  • 1 tablespoon golden syrup
  • 1.5 teaspoons bicarbonate of soda
  • 2 tablespoons of boiling water

Pre-1920s recipe without coconut

  • 1 cup plain flour
  • 2 cups rolled oats
  • 1/2 cup sugar
  • 115g salted butter
  • 2 tablespoons golden syrup
  • 1 teaspoon bicarbonate of soda
  • 2 tablespoons of boiling water

Method

  1. Preheat your oven to 170˚ degrees (no fan).
  2. Combine dry ingredients in a bowl.
  3. Melt butter and golden syrup slowly in a small saucepan.
  4. In a jug, dissolve bicarb soda in boiling water.
  5. Pour boiling water and bicarb into the butter and syrup. It will foam up. Add it immediatley to the dry ingredients.
  6. Mix everything together just enough to combine. The mixture should be sticky. Don’t let it get cold.
  7. Roll into teaspoon sized balls, and place on a baking sheet, spaced at least 10cm apart – they will spread a lot.
  8. Bake for 8-10 minutes. Your oven time may vary.
  9. Remove from oven, and cool on the baking sheet for a few minutes.
  10. Transfer to wire rack to cool.
  11. Store in an airtight container. They’ll keep for months.

Digital archeology: recovering ClarisWorks drawing files

Three years ago I posted about how I’d gone back and recovered all my old websites I’d published over the years and packed them up into a Docker image, and last year I’d idly mused that I should go back and recover the multitude of websites that I’d designed but never actually uploaded anywhere. I finally got around to doing that over the weekend, and they’re all up on archive.virtualwolf.org! Some are the original HTML source, some are just the Photoshop mockups, but that now contains the almost sum total of every single website I’d created (and there’s a lot of them). The only one missing is the very very first one… The Dire Marsh news updates are from early 1998, but I’d copied most of the layout from the previous site as evidenced by the (broken) visitor at the left that says “<number> half-crazed Myth fanatics have visited this site since 21/12/97”.

Prior to building way too many websites, I’d been introduced to the Warhammer 40,000 and Dune universes when I was 13 and had immediately proceed to totally rip them off get inspired and write my own little fictional universe along the same lines. This was all in 1996 and very early 1997, I even still have all the old files sitting in my home folder with the original creation dates and everything, but didn’t have anything that could open them as they were a combination of ancient Microsoft Word writings — old enough that Pages didn’t recognise them — and ClarisWorks drawing documents — ClarisWorks had a vector-based drawing component to it as well as word processing. I ended up going down quite the rabbit hole in getting set up to bring them forwards into a modern readable format, and figured I’d document it here in case it helps anyone in future.

Running Mac OS 9 with SheepShaver

The very first hurdle was getting access to Mac OS 9 to begin with. I originally started out with my Power Mac G4 that I’ve posted about previously but unfortunately it seems like the power supply is on the way out, and it kept shutting down (people have apparently had success resurrecting these machines using ATX power supplies but I haven’t had a chance to look into it yet). Fortunately, there’s a Mac OS 9 emulator called SheepShaver that came to the rescue.

  1. Download the latest SheepShaver and the “SheepShaver folder” zip file from the emaculation forums.
  2. You need an official “Mac OS ROM” file that’s come from a real Mac or been extracted from the installer. Download the full New World ROMs archive from Macintosh Repository, extract it, rename the 1998-07-21 - Mac OS ROM 1.1.rom file to Mac OS ROM and drop it into the SheepShaver folder.
  3. Download the Mac OS 9.0.4 installer image from Macintosh Repository (SheepShaver doesn’t work with anything newer).
  4. Follow the SheepShaver setup guide to install Mac OS 9 and set up a shared directory with your Mac. Notes:
    • It defaults to assigning 16MB of RAM to the created virtual machine, be sure to increase it to something more than 32MB.
    • Disable the “Update hard disk drivers” box in the Options sections of the Mac OS 9 installer or the installer will hang (this is mentioned in the setup guide but I managed to miss it the first time around).
    • When copying files from the shared directory, copy them onto the Macintosh HD inside Mac OS 9 directly, not just the Desktop, or StuffIt Expander will have problems decompressing files.

Recovering ClarisWorks files

This was the bulk of the rabbit hole, and if you’re running macOS 10.15, you’ve got some additional rabbit hole to crawl through because the software needed to pull the ClarisWorks drawing documents into the modern era, EazyDraw Retro (scroll down to the bottom of the page to find the download link), is 32-bit only which means it doesn’t run under 10.15, only 10.14 and earlier.

Step 1: Convert ClarisWorks files to AppleWorks 6

  1. Download the archive of QuickTime installers and install QuickTime 4.1.2, which is required to install AppleWorks 6.
  2. Download the AppleWorks 6 installer CD image (it has to be added in SheepShaver’s preferences as a CD-ROM device) and install it.
  3. Open each of the ClarisWorks documents in AppleWorks, you’ll get a prompt saying “This document was created by a previous version of AppleWorks. A copy will be created and ‘[v6.0]’ will be added to the filename”. Click OK and save the copy back onto the shared SheepShaver drive with a .cwk file extension.

Step 2: Install macOS 10.14 inside a virtual machine

This entire step can be skipped if you haven’t upgraded to macOS 10.15 yet as EazyDraw Retro can be run directly.

Installing 10.14 inside a virtual machine requires a bootable disk image of the installer, so that needs to be created first.

  1. Download DosDude1’s Mojave patcher and run it (you’ll likely need to right-click on the application and choose Open because Gatekeeper will complain that the file isn’t signed).
  2. Go into the Tools menu and choose “Download macOS Mojave” to download the installer package, save it into your Downloads folder.
  3. Open Terminal.app and create a bootable Mojave image with the following commands:
    1. hdiutil create -o ~/Downloads/Mojave -size 8g -layout SPUD -fs HFS+J -type SPARSE
    2. hdiutil attach ~/Downloads/Mojave.sparseimage -noverify -mountpoint /Volumes/install_build
    1. sudo ~/Downloads/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build
    2. hdiutil detach /Volumes/Install\ macOS\ Mojave
    3. hdiutil convert ~/Downloads/Mojave.sparseimage -format UDTO -o ~/Downloads/Mojave\ Bootable\ Image
    4. mv ~/Downloads/Mojave\ Bootable\ Image.cdr ~/Downloads/Mojave\ Bootable\ Image.iso

Once you’ve got the disk image, fire up your favoured virtual machine software and install Mojave in it.

Step 3: Convert AppleWorks 6 files to a modern format

The final part to this whole saga is the software EazyDraw Retro which can be downloaded from their Support page. It has to be the Retro version because the current one doesn’t support opening AppleWorks documents (I’m guessing whatever library they’re using internally for this is 32-bit-only and can’t be updated to run on Catalina or newer OSes going forwards, so they dropped it in new versions of the software). It can export to a variety of formats, and has its own .eazydraw format that the non-Retro version can open.

Unfortunately EazyDraw isn’t free, but you can get a temporary nine-month license for US$20 (or pay full price for a non-expiring license if you’re going to be using it for anything else except this). It did work an absolute treat though, it was able to import every one of my converted AppleWorks 6 documents and I saved them all out as PDFs. There were a few minor tweaks required to some of the text boxes because the fonts were different between the original ClarisWorks document and the AppleWorks one and there were some overlaps between text and lines, but that was noticeable as soon as I’d opened them in AppleWorks and wasn’t the fault of EazyDraw’s conversions.

Converting Aldus SuperPaint files

There were only two of my illustration files that were done in anything but ClarisWorks, and they were from Aldus SuperPaint. Version 3.5 is available from Macintosh Repository and pleasingly it’s able to export straight to TIFF so I could convert them under current macOS from that straight to PNG. There were some minor tweaks required there as well, but it was otherwise quite straightforward.

Converting Microsoft Word files

All my non-illustration text documents were written with Microsoft Word 5.1 or 6, but the format they use is old enough that Pages under current macOS doesn’t recognise it. I wouldn’t be surprised if the current Word from Office 365 could open them, but I don’t have it so I went the route of downloading Word 6 from Macintosh Repository which can export directly out to RTF. TextEdit under macOS opens them fine and from there I saved them out as PDF.

History preserved!

Following the convoluted process above, I was able to convert all my old files to PDF and have chucked them into the Docker image at archive.virtualwolf.org as well (start at the What, even more rubbish? section), so you can marvel at my terrible fan fiction world-building skills!

I’m not deluding myself into thinking that this is any sort of valuable historical record, but it’s my record and as with the websites, it’s fun to look back on the things I’ve done from the past.

Ten years of Atlassian

Today marks ten years to the day that I started at Atlassian! I blogged LiveJournaled at the end of the first week back in 2010 but looking back on it, it didn’t quite capture the brain-dribbling-out-my-ears aspect of when I started. Jira was — and still is, really — a complicated beast, and attempting to wrap my head around how all the different schemes interrelate was something else, especially when everything was called a <something> scheme!

I started doing support for Jira Studio at the beginning of 2011 — where we would host the products ourselves versus what I was doing when I first started, supporting Jira Server which is running on the customer’s own hardware—, was promoted to senior support engineer in 2014, and then left the customer support wing of the company entirely nearly three years ago and started doing support for our internal PaaS (platform as as service)!

I’m still in that same “Shield” role, still doing a good amount of coding on the side, and have been rewriting vast swathes of our internal documentation which has been received extremely positively. (We have very clever developers at work, but writing clear and end-user-focused documentation is not their strong suit. 😛) The coding has been primarily on the internal tool I mentioned in this post — except we’re now using Slack instead of Stride — and there’s been an increasing number of teams adopting it internally, and I’m actually getting feature requests!

Granted I’ve worked at exactly three companies in my entire career, but I honestly can’t imagine being anywhere else. Here’s to another ten years!

HomePod, Docker on Raspberry Pi, and writing Homebridge plugins

Apple announced the HomePod “smart speaker” in 2017, and started shipping them in early 2018. I had zero interest the smart speaker side of things — I’d never have Google or Amazon’s voice assistants listening to everything I say, and despite trusting Apple a lot more with privacy compared to those two companies, the same goes for Siri — but the praise for the sound quality definitely piqued my interest, especially having set up shairplay-sync on the Raspberry Pi as an AirPlay target and enjoying the ease of streaming music to a good set of speakers. For AU$499 though, I wasn’t going to bother as the setup for the stereo system in our home office did a reasonable enough job. It consisted of an amplifier that was sitting next to my desk, going into an audio switchbox that sat next to my computer and could be switched between the headphone cable attached to my computer, and one that snaked across the floor to the other side to Kristina’s desk so she could plug into it, with the speakers were sitting on the bookshelves on opposite sides of the room (you can see how it looked in this post, the speakers are the black boxes visible on the bottom shelves closest to our desks).

Fast-forward to last week, and someone mentioned that JB Hi-Fi were having a big sale on the HomePod and it was only AU$299! The space behind my desk was already a rat’s nest of cables, and with the standing desk I’ve ordered from IKEA I was wanting to reduce the number of cables in use, and being able to get rid of a bunch of them and replace it with a HomePod, I decided to get in on it (it’s possible to turn the “Listen for ‘Hey Siri'” functionality off entirely).

It arrived on Tuesday, and to say I’m impressed with the sound quality is a bit of an understatement, especially given how diminutive it is. It has no trouble filling the whole room with sound, the highs are crystal clear, and if the song is bassy enough you can feel it through the floor! It shows up just as another AirPlay target so it’s super-easy to play music to it from my phone or computer. I took a photo of our new setup and you can see the HomePod sitting on the half-height bookshelf right at the bottom-left of the frame (the severe distortion is because I took the photo on our 5D4 with the 8-15mm Fisheye I borrowed from a friend, which requires turning lens corrections on to avoid having bizarrely-curved vertical lines, which in turn distorts the edges of the image quite a bit).

The setup and configuration of the HomePod is done via Apple’s Home app, which uses a framework called HomeKit to do all sorts of home automation stuff, and the HomePod is one of the devices that can work as the primary “hub” for HomeKit. I have no interest in home automation as such, but a selling point of the HomeKit is that’s a lot more secure than random other automation platforms, and one of the things it supports is temperature sensors. Someone wrote a Node.js application called Homebridge that lets you run third-party plugins and even write your own ones to appear and interact with in HomeKit, so I decided I’d see if I could hook up the temperature sensors that are attached to the Raspberry Pi(s)!

I’d ordered a 4GB Raspberry Pi 4B last month because I wanted to have a bit more grunt than the existing Pi 3B — which only has 1GB RAM — and to start using Docker with it, and it arrived on the 1st of this month. With that up and running inside in place of my original Raspberry Pi 3B, I moved the Pi 3B and the outside temperature sensor much further outside and attached it to our back room that’s in the backyard, because the previous position of the sensor underneath the pergola and next to the bricks of the house meant that in summer the outdoor temperatures would register hotter than the actual air temperature, and because the bricks absorb heat throughout the day, the temperatures remain higher for longer too.

Installing and configuring Homebridge

Next step was to set up Homebridge, which I did by way of the oznu/docker-homebridge image, which in turn meant getting Docker — and learning about Docker Compose and how handy it is, and thus installing it too! — installed first:

  1. Install Docker — curl -sSL https://get.docker.com | sh
  2. Install Docker Compose — sudo apt-get install docker-compose
  3. Grab the latest docker-homebridge image for Raspberry Pi — sudo docker pull oznu/homebridge:raspberry-pi
  4. Create a location for your Homebridge configuration to be stored — mkdir -p ~/homebridge/config

Lastly, write yourself a docker-compose.yml file inside ~/homebridge

version: '2'
services:
  homebridge:
    image: oznu/homebridge:raspberry-pi
    restart: always
    network_mode: host
    volumes:
      - ./config:/homebridge
    environment:
      - PGID=1000
      - PUID=1000
      - HOMEBRIDGE_CONFIG_UI=1
      - HOMEBRIDGE_CONFIG_UI_PORT=8080

Then bring the Homebridge container up by running sudo docker-compose up --detach from ~/homebridge. The UI is accessible at http://<address-of-your-pi>:8080 and logs can be viewed with sudo docker-compose logs -f.

The last step in getting Homebridge recognised from within the Home app is iOS is to open the Home app, tap the plus icon in the top-right and choose “Add accessory”, then scan the QR code that the Homebridge UI displays.

Writing your own Homebridge plugins

Having Homebridge recognised within the Home app isn’t very useful without plugins, and there was a lot of trial and error involved here because I was writing my own custom plugin rather than just installing one that’s been published to NPM, and I didn’t find any single “This is a tutorial on how to write your own plugin” pages.

Everything is configured inside ~/homebridge/config, which I’ll refer to as $CONFIG from now on.

Firstly, register your custom plugin so Homebridge knows about it by editing $CONFIG/package.json and editing the dependencies section to add your plugin. It has to be named homebridge-<something> to be picked up at all, I called mine homebridge-wolfhaus-temperature and so my $CONFIG/package.json looks like this:

{
  "private": true,
  "description": "This file keeps track of which plugins should be installed.",
  "dependencies": {
    "homebridge-dummy": "^0.4.0",
    "homebridge-wolfhaus-temperature": "*"
  }
}

The actual code for the plugin needs to go into $CONFIG/node_modules/homebridge-<your-plugin-name>/, which itself is a Node.js package, which also needs its own package.json file located at $CONFIG/node_modules/homebridge-<your-plugin-name>/package.json. You can generate a skeleton one with npm init — assuming you have Node.js installed, if not, grab nvm and install it — but the key parts needed for a plugin to be recognised by Homebridge is adding the keywords and engine sections into your package.json:

{
  "name": "homebridge-wolfhaus-temperature",
  "version": "0.0.1",
  "main": "index.js",
  "keywords": [
    "homebridge-plugin"
  ],
  "engines": {
    "homebridge": ">=0.4.53"
  }
}

index.js is your actual plugin code that will be run when Homebridge calls it.

Once I got this out of the way, the last bit was a LOT of trial and error to actually get the plugin working with Homebridge and the Home app on my iPhone. The main sources of reference were these:

After several hours work, I had not the nicest code but working code (Update 2020-04-12 — moved to ES6 classes and it’s much cleaner), and I’ve uploaded it to GitHub.

The final bit of the puzzle is telling Homebridge about the accessories, which are the things that actually show inside the Home app on iOS. For this, you need to edit $CONFIG/config.json and edit the accessories section to include your new accessories, which will use the plugin that was just written:

{
    "bridge": {
        "name": "Traverse",
        [...]
    },
    "accessories": [
        {
            "accessory": "WolfhausTemperature",
            "name": "Outdoor Temperature",
            "url": "http://pi:3000/rest/outdoor"
        },
        {
            "accessory": "WolfhausTemperature",
            "name": "Indoor Temperature",
            "url": "http://fourbee:3000/rest/indoor"
        }
    ],
    "platforms": []
}

The url is the REST endpoint that my pi-sensor-reader runs for the indoor and outdoor sensors, and the name needs to be unique per accessory.

Homebridge needs restarting after all these changes, but once you’re done, you’ll have two new accessories showing in Home!

They initially appear in the “Default Room”, you can add an “Indoor” and “Outdoor” room to put them into by tapping on the Rooms icon in the bottom bar, then tapping the hamburger menu at the top-left, choosing Room Settings > Add Room, then long-pressing on the temperature accessory itself and tapping the settings cog at the bottom-right and selecting a different room for it to go into.

What’s next?

As part of doing all this, I moved all of my public Git repositories over to GitHub where they’re more likely to be actually seen by anybody and will hopefully help someone! I also updated my pi-sensor-reader to use docker-compose, and fully-updated the README to document all the various options.

Next on the Homebridge front is going to be tidying up the plugin code — including moving to async/await — and adding the humidity data to it!

A very DIY weekend

All this coronavirus business has meant that we’ve been doing a lot of not going anywhere for the past couple of weeks. Both Kristina and I are lucky enough to be able to work our regular jobs entirely from home which is fantastic, and the lack of commuting means that we’ve got lots more time in our days. I finally got around to putting together the Tau and Space Marines that come in the Kill Team box set I got back in September, and have started painting them. I’d noticed when I was painting the ungors from the Beastgrave box that the new arch lighting on my painting table still wasn’t quite sufficient, and with the additional painting I’m doing, decided I should get around to doing something about it.

All of my miniature stuff lives in the back room and I’ll bring it inside as necessary, and yesterday started with me being annoyed that the door handle on the outside of the room was nearly falling off because the holes that the screws go into were worn out and the screws didn’t actually hold anything in (and also that to lock the deadbolt you had to lift the door slightly because it’s out of alignment with the hole). I drilled out the holes in the actual metal door handle itself to fit newer and larger screws in, and also filed down the plate that the deadbolt goes into so the door doesn’t need lifting anymore when you lock it, so now the door is like a normal door and you don’t have to fight with it when locking and unlocking it.

Also yesterday, Kristina decided to trim the horrible trees that we have growing in the narrow garden bed next to the pergola, and I decided to follow suit by pulling out all the weeds and grasses that’d grown there and generally trying to make it tidier. We were going to get mulch from Bunnings to prevent the weeds from getting a foothold and generally to improve how the garden bed looks, but I got carried away and also ended up removing all the dead leaves that were sitting against the bottom of the back room walls, and so was totally exhausted. Today we did hit up Bunnings, and while we were there I figured I’d do something about the lighting for my painting table so I also picked up some more wood for the arch, plus another set of strip lights and a power board, as well as a circular saw because I’m sick of manually hacking at pieces of wood when I’m chopping them!

I’ve not used a circular saw before, it’s delightfully fast to chop the wood of course but it was a little tricky because the pieces of wood I use for the arch on my table are quite narrow and it’s difficult to work out specifically where the blade is going to be cutting; I’m sure some more practice will help. I also attached another piece of wood to the side of it so I could mount the power board there and have both the strip lights plugged into that, and just turn it on and off at the wall.

Behold!

A photo of a DIY wooden "table" sitting on a dining table, with a square arch over the top of it with LED strip lights all along the inner surface of it. There's lots of Games Workshop paint pots and miniatures on it.

I also generally tightened everything up and attached the two arches together so they’d stop being knocked forwards if I bumped into them. It’s very much even brighter than before, so much so that the ceiling light above the dining table doesn’t really bring anything to the party anymore — previously I’d found that I was still needing to use it if I didn’t have the miniature I was painting totally centred under the arch.