More Raspberry Pi adventures: the Pi Zero W and PaPiRus ePaper display

I decided I wanted to have some sort of physical display in the house for the temperature sensors so we wouldn’t need to be taking out our phones to check the temperature on my website if we were already inside at home. After a bunch of searching around, I discovered the PaPiRus ePaper display. ePaper means it’s not going to have any bright glaring light at night, and it also uses very little power.

The Raspberry Pi is hidden away under a side table, and already has six wires attached to the header for the temperature sensors, so I decided to just get a separate Raspberry Pi Zero W — which is absurdly small — and the PaPiRus display.

Setting it up

I flashed the SD card with the Raspbian Stretch Lite image, then enabled SSH and automatic connection to our (2.4GHz; the Zero W doesn’t support 5GHz) wifi network by doing the following:

1) Plug the flashed SD card back into the computer.

2) Go into the newly-mounted “boot” volume and create an empty file called “ssh” to turn on SSH at boot

3) Also in the “boot” volume, create a file called “wpa_supplicant.conf” and paste the following into it:

country=AU
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WIFI_SSID"
psk="WIFI_PASSWORD"
key_mgmt=WPA-PSK
}

4) Unmount the card, pop it into the Pi, add power, and wait 60-90 seconds and it’ll connect to your network and be ready for SSH access! The default username on the Pi is “pi” and the password is “raspberry”.

(These instructions are all thanks to this blog post but I figured I’d put them here as well for posterity).

The PaPiRus display connection was dead easy, I just followed Pi Supply’s guide after soldering a header into the Pi Zero W. If you want to avoid soldering, they also offer the Zero W with a header pre-attached.

Getting the Python library for updating the display was mostly straightforward, I just followed the instructions in the GitHub repository to manually install the Python 3 version.

I wrote a simple Python script to grab the current temperature and humidity from my website’s REST endpoints, and everything works! This script uses the “arrow” and “requests” libraries, which can be installed with “sudo apt-get install python3-arrow python3-requests”.

Next step is to have the Pi 3 that has the sensors run a simple HTTP server that the Zero W can connect to it, so even if we have no internet connection for whatever reason, the temperatures will still be available at home. I’ve updated my Pi Sensor Reader to add HTTP endpoints.

Another year of Node.js (now also featuring React)

I posted last year about my progress with Node.js, and the last sentence included “I’m very interested to revisit this in another year and see what’s changed”.

So here we are!

There’s been a fair bit less work on it this year compared to last:

$ git diff --stat 6b7c737 47c364b
[...]
77 files changed, 2862 insertions(+), 3315 deletions(-)

The biggest change was migrating to Node 8’s shiny new async/await, which means that the code reads exactly as if it was synchronous (see the difference in my sendUpdate() code compared to the version above it). It’s really very nice. I also significantly simplified my code for receiving temperature updates thanks to finally moving over to the Raspberry Pi over the Christmas break. Otherwise it’s just been minor bits and pieces, and moving from Bamboo to Bitbucket Pipelines for the testing and deployment pipeline.

I also did a brief bit of dabbling with React, which is a frontend framework for building single-page applications. I’d tried to fiddle with it a couple of years ago but there was something fundamental I wasn’t grasping, and ended up giving up. This time it took, though, and the result is virtualwolf.cloud! All it’s doing is pulling in data from my regular website, but it was still a good start.

There was a good chunk of time from about the middle of the year through to Christmas where I didn’t do any personal coding at all, because I was doing it at work instead! For my new job, the primary point of contact for users seeking help is via a room on Stride, and we needed a way to be able to categorise those contacts to see what users were contacting us about and why. A co-worker wrote an application in Ruby a few years ago to scrape the history of a HipChat room and apply tags to it in order to accomplish this, but it didn’t scale very well (it was essentially single-tenented and required a separate deployment of the application to be able to have it installed in another room; understandable when you realise he wrote it entirely for himself and was the only one doing this for a good couple of years). I decided to rewrite it entirely from scratch to support Stride and multiple rooms, with the backend written in Node.js and the frontend in React. It really is a fully-fledged application, and it’s been installed into nearly 30 different rooms at work now, so different teams can keep track of their contact rate!

The backend periodically hits Stride’s API for each room it’s installed in, and saves the messages in that room into the database. There’s some logic around whether a message is marked as a contact or not (as in, it was someone asking for help), and there’s also a whitelist that the team who owns the room can add their team members to in order to never have their own messages marked as contacts. Once a message is marked as a contact, they can then add one or more user-defined tags to it, and there’s also a monthly report so you can see the number of contacts for each tag and the change from the previous month.

The backend is really just a bunch of REST endpoints that are called by the frontend, but that feels like I’m short-changing myself. 😛 I wrote up a diagram of the hierarchy of the frontend components a month or so ago, so you can see from this how complex it is:

And I’m in the middle of adding the ability to have a “group” of rooms, and have tags defined at the group level instead of the room level.

I find it funny how if I’m doing a bunch of coding at work, I have basically zero interest in doing it at home, but if I haven’t had a chance to do any there I’m happy to come home and code. I don’t think I have the brain capacity to do both at once though. 😛

Tea, five years later

I’d posted back in May of 2013, just before we moved into our house, that I was really enjoying my nighttime cuppa, and nearly five years later we’re now at the point where we have an entire shelf of our pantry that has nothing but tea on it!

Our selection of tea

We’ve got a handful of loose-leaf teas, but I tend to forget about them because they’re buried at the back and it’s a bit of a pain to clean up afterwards. A cup of herbal tea after dinner is glorious, especially when the weather has cooled down. The brand “Celestial Seasonings” has quite a few very tasty ones, and we’ll frequently pick up a new interesting-looking type when we’re out at the shops too (hence the whole shelf of tea that we now have).

I still don’t tend to drink a lot of black tea, mostly because it’s not caffeinated enough compared to coffee, but we discovered McVitie’s digestive biscuits thanks to a British documentary series (called “Inside the Factory”) about how they’re made, and ohmygod they’re so good dunked in a nice hot cup of black tea! ?

Mobile painting

I mentioned in my last post that I’d brought all the paints and miniatures and everything inside because it was too hot in the back room to do any actual painting. Moving everything back and forth turned out to be a massive pain, so I decided to build myself a painting board that I could have everything sitting on, then just pick up and move back and forth as necessary.

After about $20 at Bunnings and some Liquid Nails as well as actual nails, it’s ready to go! The board ended up being somewhat larger than I was expecting, and it was a very tight squeeze with all the other stuff on the desk. Fortunately we still had the two shelves we’d originally put up in the office three and a half years ago and had since removed when we rearranged everything two years ago, so I put them up and moved basically everything that was on the desk onto them instead, and now everything is neat and tidy and organised!

Miniatures painting board

Board

Finally, some actual miniature painting

So despite having gotten the back room set up for miniature painting over three and a half years ago, I hadn’t actually done any of it since then. 😛 I also realised I hadn’t actually taken a photo of the setup.

I bought Games Workshop’s latest game Shadespire early last month, it does have miniatures to paint but only eight in the core set, and it’s a board game where the games last about half an hour or so versus the multi-hour affairs that are traditional Warhammer/Warhammer 40,000 games. I figured that with the holidays around and time to kill, and not having the prospect of endless amounts of miniatures to paint, I’d give it a go. I’m pleased to say that I clearly still have the painting skills!

I’ve finished five of them so far, so only three to go, and took some proper photos of them with the full external flash/umbrella setup.

Blooded Saek

Angharad Brightshield

Targor

Karsus the Chained

Obryn the Bold

(I’ll admit that I cheated slightly and didn’t actually paint any of these in the back room, however… during the week and a bit that I was doing them, the weather was really hot and the dinky little air conditioning unit in the back room wasn’t remotely up to keeping things cool, so I ended up bringing all the paints and bits inside and did them at the dining table).

The game Shadespire itself is really neat as well. I’ve only played a handful of games, but rather than just “Kill the other team” you also have specific objectives to accomplish as well. Have a read of Ars Technica’s review of it, they’re a lot more thorough and eloquent than I could be. 😛

Temperature sensors: now powered by Raspberry Pi

The Weather section on my website is now powered by my Raspberry Pi, instead of my Ninja Block! \o/

Almost exactly three years ago, I started having my Ninja Block send its temperature data to my website (prior to that, I was manually pulling the data from the Ninja Blocks API and didn’t have any historical record of it). Ninja Blocks the company went bust in 2015, and there was some stuff in the Ninja Blocks software that relied on their cloud platform to work and I ended up with no weather data for a couple of days because the Ninja Block couldn’t talk to the cloud platform. I ended up hacking at it and the result was this very simple Node.js application as a replacement for their software. It always felt a bit crap, though, because if the hardware itself died I’d be stuck; yes, it was all built on “open hardware” but I didn’t know enough about it all to be able to recreate it. I’d ordered a Raspberry Pi 3 in June last year, intending on replacing the Ninja Block and it’s sometimes-unreliable wireless temperature sensors with something newer and simpler and hard-wired, but I found there was a frustrating lack of solid information regarding something that on the surface seemed quite simple.

I’ve finally gotten everything up and running, the Ninja Block has been shut down, and I’ve previously said I’d write up exactly what I did. So here we are!

Components needed

  • Raspberry Pi 3 Model B+
  • AM2302 wired temperature-humidity sensor (or two of them in my case)
  • Ethernet cable of the appropriate length to go from the Pi to the sensor
  • 6x “Dupont” female to either male or female wires (eBay was the best bet for these, just search for “dupont female”, and it only needs to be female on one end as the other end is going to be chopped off)
  • 1.5mm heatshrink tubing
  • Soldering iron and solder
  • Wire stripper (this one from Jaycar worked brilliantly, it automatically adjusts itself to diameter of the insulation)

Process

  1. Cut the connectors off one end of the dupont cables, leaving the female connector still there, and strip a couple of centimetres of insulation off.
  2. Strip the outermost insulation off both ends of the ethernet cable, leaving a couple of centimetres of the internal twisted pairs showing.
  3. Untwist three of the pairs and strip the insulation off them, then twist them back together again into their pairs.
  4. Chop off enough heatshrink tubing to cover the combined length of the exposed ethernet plus dupont wire, plus another couple of centimetres, and feed each individual dupont wire through the tubing (there should be three separate bits of tubing, one for each wire).
  5. Solder each dupont wire together with one of the twisted pairs of ethernet cable, then move the heatshrink tubing up over the soldered section and use a hairdryer or kitchen blowtorch to activate the tubing and have it shrink over the soldered portion to create a nice seal.
  6. Repeat this feed-heatshrink-tubing/solder-wire/activate-heatshrink process again but with the cables that come out of the temperature sensor (ideally you should be using the same red/yellow/black-coloured dupont cables to match the ones that come out of the sensor itself, to make it easier to remember which is which).
  7. Install Raspbian onto an SD card and boot and configure the Pi.
  8. Using this diagram as a reference, plug the red (power) cable from the sensor into Pin 2 (the 5V power), the yellow one into Pin 7 (GPIO 4, the data pin), and the black one into Pin 6 (the ground pin).

AdaFruit has a Python library for reading data from the sensor, I’m using the node-dht-sensor library for Node.js myself. You can see the full code I’m using here (it’s a bit convoluted because I haven’t updated the API endpoint on my website yet and it’s still expecting the same data format as the Ninja Block was sending).

I’d found a bunch of stuff about needing a “pull-up” resistor when connecting temperature sensors, but the AM2302 page on adafruit.com says “There is a 5.1K resistor inside the sensor connecting VCC and DATA so you do not need any additional pullup resistors”, and indeed, everything is working a treat!

Christmas 2017

Christmas and Boxing Day this year were pretty great. My sister and her husband and kids were able to make it up from Nowra again, so we had the family Christmas at my parents’ place with everyone. My niece Arya, now three and a half, is GODDAMN ADORABLE. She’s totally happy to just go off and play by herself, and there wasn’t a single tantrum the whole time we were there either. Lily and Scarlett were happy to hang out with each too and got along very well.

It was interesting to see that Scarlett’s reading is definitely not at the same level as Lily’s was at the same age… Lily was eight when I posted this but she was absolutely tearing through pretty much everything, whereas Scarlett was struggling a little to read the jokes inside the Christmas crackers.

Beanie was terrific, he mostly just wandered around keeping an eye on what everyone was doing and didn’t bark once. Arya was a afraid of him to begin with, because he was so excited to see someone vaguely at his height that he kept jumping up on her and trying to lick her face! My sister’s dog at home isn’t one for jumping, so Arya wasn’t used to that. She got over it eventually, though, and was able to sit down and give him scritches.

Showing Scarlett how to Minecraft

Pennie, Mark, and Arya

AHHH A DINOSAUR BOOK!

Beanie amongst the Christmas paper

Snuggles with Aunty Kristina

Sitting on dad

I’ve been a bit stuck for what to get for Christmas and birthdays of late, so I’ve asked for mostly just books. This year’s haul:

So that should certainly keep me occupied for a while!

We went back over on Boxing Day for mum’s birthday, and went down to Collaroy Beach in the afternoon. It was completely overcast but the weather was otherwise glorious… temperature in the mid-20s and a lovely breeze. There were more photos, of course, and I gave the 135mm lens a good workout for once!

Waving from the kiddy pool

Posing

Strutting

Playing in the sand

Getting splashed #1

Even cheesier grin

Getting splashed #5

Photographical style

I never really thought of myself as having a particular “style” to my photos, but I was looking back at my old photos — originally specifically from Christmas and then just more generally all of them — and I’ve realised in the last year or two I’ve very much moved towards a lighter “high-key” style where I bring the shadows up and even bump the exposure of the whole photo by ⅓ to ⅔ of a stop or even more, to get a nice light airy feel to them.

Have a look just at my Christmas albums to see what I mean.

It’s even more obvious when going back and looking at all my photos as a whole! My photos from our trip to Boston in 2012 are a good example, they’re all super-saturated and high-contrast, with really dark shadows. I still have all the original RAW files from that trip, but I don’t want to go back and start re-editing photos lest I go down the path of George Lucas and just totally ruin everything with my meddling. 😛

A holiday in Perth

We went to Perth for a week last week, and it was damned lovely! A friend of mine, Mat, who I’ve known for over fifteen years and originally met through the now-mostly-defunct Everything2, lives over there and was able to offer some advice on places to eat at and suburbs to stay in.

We arrived on Saturday and stayed in a house in Highgate, which is about a 10-15 minute walk from the city itself. Less than a block away is Hyde Park, which is lovely, and so green (Perth has had like a month or two straight of rain, versus the next-to-none that Sydney’s had).

Path

Gazeebo

Departing

There’s a bunch of street art all around the place as well, and lots of interesting buildings to take photos of (full album is here).

Untitled

Untitled

Untitled

Five

High Grounds Coffee

On Sunday we visited Fremantle, to check out the markets there and hopefully get a view of a sunset over the ocean (something we’ve never seen given both Kristina and I grew up on the east coasts of our respective countries). It was indeed getting very nice, but sadly the clouds moved in right as the sun was getting low to the horizon.

Down the street

Ferris wheel

Untitled

Playing

Lighthouse

Untitled

Untitled

Fremantle is the main cargo port for Perth, so there were the giant cargo cranes there and also a massive submarine in dry-dock (have a look to the right of the second photo)!

Untitled

Cranes

Monday was spent first at the Western Australian Botanic Garden and then wandering Northbridge and the CBD itself.

The Garden is massive although there’s a lot of just regular bushland as well as flower beds.

Untitled

Untitled

Untitled

The Swan Brewery Co. Ltd.

Northbridge was neat, there’s a lot of laneways and little alleys, and most of them have art on the walls, often on a very large scale.

Untitled

Small steps

Dragon

Sugar glider

Goat

Untitled

Untitled

Those last two would have been probably four stories high!

We wandered through the CBD itself as well, had dinner at Durty Nelly’s Irish pub (highly recommended, the food was incredible), then continued wandering after night had fallen.

Spring

Untitled

Gothic windows

Untitled

Stairs

Untitled

On Tuesday we visited Rottnest Island! We made the mistake of taking a bus tour, which was filled with loud, obnoxious, racist boomers, and we only stopped to actually get off the bus twice. Otherwise we were driving past all this wonderful terrain and the occasional quokka, and everyone was snapping shitty photos out of the bus windows.

Thankfully that only lasted an hour and a half, and we were able to go visit a colony of quokkas that were all of about ten minutes from the main buildings on the island, and OH MY GOD they are adorable! They have no natural predators on the island so they were pretty well unafraid of people and we were able get up super-close to them.

Smiling

Round

Mine!

Gnarled

The water around the island is crystal clear.

Untitled

Untitled

Tuesday night, we had dinner in Northbridge at a Mexican restaurant called La Cholita, and holy crap if you’re in Perth you need to visit it. The food is amazing.

Chopping

Kristina and Mat

Taco and sangria

Afterwards we went for another wander around the area and snapped some photos.

Mat's ridiculous icecream

Waiting

Meat Candy

Wednesday was spent briefly at the Araluen Botanic Park (briefly, because Kristina’s legs were massively hurting from crouching down and getting up constantly on Tuesday while we were visiting the quokkas and the Botanic Park was filled with lots of hills), and then a leisurely wander through East Perth.

The weather starting turning a bit crap on Thursday, so we visited Mat’s sister and her boyfriend on their rural property and just hung out there with their horse Archie and hilariously uncoordinated Maremma sheep dog Iorek, then went back and played some Diablo III.

Untitled

Iorek the Maremma sheep dog

I can’t believe how well-timed the trip was, we booked it back in July and the week before the trip was almost non-stop rain and it’s now back to raining again for the next week! There would have been so much we wouldn’t have been able to see if the weather had been awful.

A vehicular upgrade

We bought a brand-new car today! \o/ It’s an extremely handsome-looking Kia Cerato hatchback in dark metallic grey.

Our brand-new MY18 Kia Cerato

We’d been toying with the idea for a little bit, then Kristina came across some videos of crash tests comparing somewhat older (from ~2000-ish, which is exactly what our current Corolla is) cars impacting with newer ones. They’re nothing like the utter crumpling of the cars from the 1970s, but still somewhat alarming. She did a bunch of research and found that the current Kias are extremely well-regarded and reliable, and it turns out there’s basically nothing else in the same price range that offer as much power and features; the equivalent cars like the Corolla and Civic and such were all several thousand dollars more, with less power and fewer included features. The Cerato has a 7-year warranty as well, which seemed to be more than most other cars.

Speaking of power (112kW and 192Nm to be exact), we took one for a test drive on Sunday… I put my foot down and was accidentally doing 70km/h almost immediately! There’s a hell of a lot of room as well, it’s only marginally larger on the outside compared to our Corolla, but it’s so spacious inside. I’m excited about having a hatchback again too, there’s been a few situations where we were trying to put something into the boot and it just wouldn’t fit. Now we can go to town and put the back seats down and put EVERYTHING in it! *maniacal laughter*

We’re going to keep the old Corolla for a while just to go to and from the station in, because parking there means the car is permanently covered in dust thanks to all the construction going on, and when it rains everything turns to mud and the trucks going along the road just splash mud across everything.