Generative Daily Planner

I have a new executive assistant. He updates me on the most important emails in my inbox, my loved ones’ upcoming birthdays, calendar events, holidays, package tracking updates and more. His name is Mr. McGillicuddy, and he lives inside my typewriter.

Mr. McGillicuddy is a deceptively simple concept that took me a comically long time to assemble. It’s a GPT-4-powered bot that ingests email, calendar and contacts from a range of sources (mainly Gmail, Gcal and iCloud) and outputs a daily agenda to my circa-1989 IBM Wheelwriter 3 typewriter using a serial bus connected to an Arduino Nano RP2040 Connect.

As a bonus, I’m using the Wheelwriter’s keyboard as an external keyboard for my Mac, using QMK and a Raspberry Pi Pico W as a USB HID controller.

This project is sort of a natural evolution of a few different things I’d been working on over the past few months. I inherited the Wheelwriter when my father wound down his law office, and I’ve spent the past year pondering what to do with it. It’s built like a tank and has a wonderful mechanical keyboard, the immediate predecessor to the infamous IBM Model M.

But it’s just a typewriter, right? I couldn’t quite figure out what to do with it, so it gathered dust while I started messing with another old electric typewriter, my 1984 Brother EP-44, since it’s a full-featured word processor with an LCD screen and an actual exposed serial bus. Wiring that up as a ChatGPT client was absolutely wild. Something about the interface between old analog hardware and modern generative AI tools is seriously mind-bending.

I started thinking more seriously about the Wheelwriter while working on the miniature model of my dad’s office. I 3d-printed a tiny model of the Wheelwriter and attached it to a tiny e-ink screen, so it could print letters from my dad’s old dictation tapes:

In the process of building the miniature, I spent some time learning more about the Wheelwriter. Initially I was just trying to find an audio track of its very distinctive typing sound, for the soundscape I put together for the model. But along the way, I discovered that it’s a ton more powerful than I’d realized!

It turns out that the Wheelwriter — really the pinnacle of electric typewriters, released right before the concept of a typewriter became completely obsolete — has tons of hidden connectivity features! It shipped with a hard-to-find add-on allowing users to print to it from a computer. And over the past decade, many retro computing folks have reverse-engineered the serial bus, allowing for both TX and RX functionality from a range of microprocessors. Thus:

One of the first projects I explored for interfacing with the Wheelwriter was Cadetwriter, a very comprehensive interface board put together by the Computer History Museum’s IBM 1620 project. Cadetwriter sits between the keyboard and the Wheelwriter’s logic board (rather than using the serial bus), and emulates a proper two-way serial connection. I got as far as ordering a custom PCB (my first!) via Oshpark, before becoming stymied by the different pinouts, timings and voltages of the Teensy 4.1 vs the now-unobtainium Teensy 3.5.

While it was cool to order my own circuit board (which I’ve now done several times for some Game Boy projects – watch this space!), the real breakthrough was finding a more recent interface put together by @jkua on Github. The README explains his approach far better than I ever could, but he’s effectively built on a decade of reverse-engineering the Wheelwriter to successfully control both RX and TX via an Arduino Nano RP2040 Connect. I wound up adapting his code for the transmitting side of my project; a MOSFET, line shifter and resistor were all I needed to get two-way serial working on the single half-bus cable provided by the Wheelwriter.

After a month or two of trying to figure out the hardware, getting the generative text component was a relative breeze. Right now, it’s just pulling in 24 hours of email via the Gmail API, upcoming calendar events via the Google Calendar API, and my contacts’ birthdays via an unofficial iCloud API. Over time I’ll surely want to iterate on this to make sure it’s actually giving me the most useful snapshot of my day/week/month.

So, back to the hardware. I could’ve used @jkua’s RX functionality to power my keyboard, but I don’t want everything I type on the keyboard to also be typed on the typewriter. Fortunately, I was lucky to find a few folks who’d spearheaded wiring up the keyboard to a modern controller. (If this project has taught me one thing, it’s that TONS of people love the Wheelwriter!) One conversion project led me to QMK, keyboard controller firmware that takes over a microprocessor and turns it into a normal wired keyboard. I only needed to make minor adjustments to an already-mapped Wheelwriter template within QMK to get it working with a Pico W (my preference, due to the sheer number of individual GPIO pins I needed to connect) and to tweak the key mapping to my needs.

It’s a little silly to use two microprocessors for this project. Now that I’ve got the fundamentals working, I’m going to try to get it all working together on one custom board. But conceptually the typewriter is doing two very distinct things now: the keyboard is driving my Mac, while the typewriter itself is printing out the daily planner. The two are not currently connected in any way.

I’m happily typing on the clickety-clackety Wheelwriter keyboard now, and in the midst of designing a 3D-printed laptop stand that will allow the paper to feed through so I can see my planner while using my MacBook. So satisfying.

The full code driving this experience can be found on github. It’s messy!

P.S.: Why Mr. McGillicuddy? My dad always used to talk about wanting a secretary named McGillicuddy, I think only because he thought it’d be a funny name to yell out. I think he was inspired by the mom on I Love Lucy. Seemed like an easy and delightful choice.