Sound, and an ugly UI
Without an audio output on the board itself, it was time to go back to the internet for a new component to enable audio output from my Pi Zero W.
Thankfully, it didn't take long to find the MAX98357 chip and learn how to output sound using I2S. This blog post got me where I needed to go, and after ordering a chip online I was soon hearing Neil Armstrong announce his achievement from the speaker I ripped out of the Kello. It is, indeed, a pretty nice speaker.
There remains the question of how I'm going to set up this Pi as a Spotify Connect target so I can stream music to it in the morning, but I've at least got a lead on some open source solutions for that.
So now pretty much all the hardware I need is set up: I have my display, my control, and my speaker. I can start thinking about the final housing design and how to arrange components pretty soon here.
But for the immediate future, I've decided to flesh out the web interface. As part of my objective of keeping the physical interface of the device extremely minimal, I wanted to have the clock host a simple web dashboard only local network which I could access from a phone or laptop to tweak my alarm schedule or change the Spotify playlist.
I know a full-blown React app is probably overkill for this, and maybe I should branch out a bit. But the truth is, I'm so comfortable with React as a tool that I figure I'll have a better chance of success if I stick with it this time. I've already learned quite a bit on this project, and I'm likely to learn quite a bit more as I wrap it up - so it's nice to chill out with some stuff that's not so challenging in the middle. If I push things too hard, I may end up burning out on the project, and I really do want to end up with a working alarm clock.
Now one of the big problems with React is that it requires transpilation. I actually abandoned TypeScript in the previous code because transpiling it directly on the Pi is just too much. Basic Babel for React is no different. After sitting and waiting for Webpack to finish recompiling for upwards of 10 minutes, I decided to move my development back onto my main computer. I can still have the development frontend talk to the Pi's server over the local network for now, but I'll probably want to flesh this out into a more coherent developer environment. That means either figuring out a way to compile code on my main computer and copy it via SSH to the Pi in realtime, or creating a simulator for my clock hardware that I can plug in so I can run the whole thing locally. Both are interesting options.
For now, I have a really ugly UI that can modify alarm schedules. That's all I feel like doing today.