chester's blog

technology, travel, comics, books, math, web, software and random thoughts

Using Ansible to configure a Raspberry Pi (Home Assistant, LIRC, 433Utils, Z-Wave, etc.)

13 Apr 2019 | Comments

A while ago I built a couple inexpensive hacks that added voice-command to my tv and then to my lights using a Raspberry Pi, Google Home Mini, infrared and RF radio. Since then, I added other things, which prompted me to move the hacks into the popular Home Assistant home hub software.

With so much of my routine depending on that setup, backup became a concern. I’d make an occasional copy of the SD card with dd, but that isn’t a good long-term solution. Ideally, I wanted to rebuild my setup easily, should the card get corrupt, slow or just wrecked by my ongoing hacking.

Enter Ansible. Sysadmins use it to write “playbooks” that represent the changes they would manually apply to a server. If done right, such playbooks can be applied to an existing server (fixing any broken configs), or a brand new one (to recreate its services).

The Raspberry Pi is just a (tiny) server - meaning hobbyists can use Ansible as well!

I’m not an Ansible expert (there are better places to learn about it), but my Ansible configs and these notes may be useful for anyone interested in automating Raspberry Pi setups (for home automation or anything else).

Renovating an Atari 2600 (AV mod + capacitor/power adaptor replacement)

18 Feb 2019 | Comments

A while ago I got this beautiful Atari 2600 all-black, 4-switch model - often nicknamed “Darth Vader”, for obvious reasons:

The console generates a TV signal, which the TV has to tune in just like a normal over-the-air channel. It was quite convenient at the time (and quality was good enough for the TV sets we had), but modern TVs show degradation - not to mention some can’t even pick up the faint signal - I had to hook mine to a VCR that would decode the signal into A/V.

That quirky setup led me to make the popular A/V conversion (“mod”) - and, while at it, replace the power adaptor (with one that I can actually keep on the wall without fear of burning down the house) and capacitors (something that should be done to any vintage electronics that you want to keep humming).

More tips on reusable coffee pods in Keurig coffee makers

01 Feb 2019 | Comments

Prepara 3042 Evak Fresh Saver Airless Canister

My Keurig B40 coffee maker was super convenient, but throwing those pods in the garbage wasn’t great for the environment (yes, you can compost the contents, but despite manufacturer claims/efforts, you can’t recycle the pods in Toronto. They also limit your coffee choice, so a couple years ago I switched to reusable pods and wrote a blog post about it.

Since then, I learned a couple things about grinding and avoiding leaks that are worth sharing.

Hacking a BMW

04 Jan 2019 | Comments

My friend drives a BMW 3 Series. Those cars come with a built-in entertainment system that allows you to connect your smartphone and make calls, which worked as expected. But some capabilities (which they call Enhanced Bluetooth) are only enabled by means of a “service fee” - even though you’ve already paid for the system.

And when “the man” abuses its power, hacking ensues…

Controlling RF outlets from a Raspberry Pi

26 Dec 2017 | Comments

IKEA floor lamps aren’t bad - as long as your house has sufficient outlets with properly wired and positioned wall switches. Mine doesn’t 😐 and, being a renter, I can’t simply rewire them, so I decided to try the Etekcity RF-controlled outlet kit.

For less than CAD$ 60 you get five outlets, which can be turned on and off individually by the two included remotes. Not a bad deal, and sure an improvement from the odd switches (and the built-in ones on the lamps). But given I already control my TV and sound bar from Google Home with a Raspberry Pi, it wouldn’t be much of a stretch to also have voice control over the lights.


Motion-sensing, Arduino-based Washing Machine Alarm

22 Dec 2017 | Comments

I don’t iron clothes. Heck, I don’t even own an iron - quickly folding clothes right when I remove them from the dryer works for most of them (and a steamer does the job when that fails).

Problem: my current machine has a very low and short audio warning, so I often miss when it is done, ending up with wrinkled clothes. 😔

I thought it wouldn’t be too hard to build a device that detected when the machine stopped moving and alerted me in a more extravagant way. Having never played with raw accelerometers before, I would at least have some fun trying!

Voice control for a non-smart TV (with Google Home, a Raspberry Pi, LIRC, nginx, Lua and IFTTT)

10 Dec 2017 | Comments

Despite my privacy concerns, I could not resist the low price of the Google Home Mini. It is really convenient to control the ChromeCast with it, but turning my (non-smart) TV on/off, or switching the input between different devices still required reaching the remote…

…until I hacked a bit!

In a nutshell: IFTTT turns Google Home commands into HTTPS requests towards a Raspberry Pi. There, nginx triggers some Lua code that runs LIRC, which generates IR signals into a transistor that amplifies them to two IR LEDs. Complicated, but works!

Atari 2600 CPU running on a breadboard

06 Sep 2017 | Comments

A year ago, Ben Heck hand-soldered an Atari 2600 on a protoboard (and, as usual, turned that into a portable console). The idea of manually re-assembling the console for which I had already hacked together a game and an emulator sounded very exciting (and educational) for me.

The show crew always publishes schematics for his projects, so while I waited for that, I started de-soldering the chips and cartrige conector (and a few extra components, why not?) from an old Atari Jr. board I had lying around. De-soldering is hard, but eventually it was done:

An Atari VCS (Jr.) board, without several components

The schematics, however, never came. That episode’s GitHub repository only includes the original Atari’s block diagram, so I shelved the plan. But more recently I stumbled upon a series of blog posts in which David Barton describes how he built a 6502-based computer (a 65c02, to be precise) on a solder-less breadboard.

Those boards aren’t as sturdy or portable as traditional printed circuit boards, but the freedom to tinker (and make mistakes) sparked my flame once again, so I decided to give the project another shot. I started by reproducing his first two posts, but adapted to the Atari’s 6507 and adding a couple tweaks.

Replacing K-Cup®s with reusable coffee pods

07 Aug 2017 | Comments

This post isn’t about electronics or software hacks, but it touches a very important element in those: coffee! ☕️

Infatuated with the convenience of pod-based coffee machines, I’ve owned a Keurig B40 since 2012. Its K-Cups afford easy comparisons to standards like VHS or Android - in the sense that competing systems may have marginal advantages, but the variety of suppliers is hard to beat.

These days, I only hit a coffee shop when I need socialization or internet. But I still have two issues with pods: cost (a pod is cheaper than, say, Starbucks, but still adds up way faster than ground coffee in packs) and pollution.

The later grew a bit on me - to the point that I even considered returning to the Moka pots that used to fulfill my coffee needs back in Brazil - until I discovered reusable coffee pods.