Setbacks with Spotify
It was starting to look like Spotify is going to be less of a robust option.
The main problem I was experiencing was that, while the Raspberry Pi is listed as available when I query devices from the Spotify app directly, the Spotify service seems to kind of... forget about it. After a few hours, the device is no longer listed when I query via the API. That didn't bode well for the alarm clock being controlled in the morning.
While integrating with Spotify was fun, I was starting to come to terms with dropping the functionality. I already have a good bit of Gregorian chants on MP3 which I could play directly from the device, which would save a lot of hassle.
However, I noticed there was a configuration option for Raspotify which allows passing in Spotify credentials directly. Perhaps using this it would create a more persistent connection.
Having done that, I'll have to wait and see if the device gets forgotten again. Obviously none of this is official Spotify stuff, so what I'm trying to do may just not be possible unless I become a Spotify hardware partner (unlikely).
The Kello solved this, apparently, using a specific hardware chip which I located on their motherboard. It's from a company called Libre. It appears this chip acts as a separate microcontroller and handles everything related to Spotify streaming, including registering a Connect device and presumably keeping that connection alive.
However, the device has, if I count correctly, 60 pins. I'm just not ready to try to figure out how to interface with it. It's not worthwhile.
So if this new authenticated Respotify option works, cool, but if not... playing MP3s isn't so bad. I went ahead and coded the functionality to play MP3s directly and made it the fallback in case the Spotify connection doesn't work in the morning, so I feel pretty good about it.
On the hardware side, I ordered some parts I'll need to assemble a final prototype board, and I've mocked up an enclosure by slicing up an old Amazon box. I'm pretty happy with the form factor, and the components all fit inside. I'm a little worried about the speaker now though, since it's been kind of buzzy...