Today’s tale of being in the right place at the right time comes from [fabe1999], who was doing an intern gig at the airport when the controller on their split-flap display bought a one-way ticket going south. They were just going to throw away thousands of these letters and replace them with monitors, but the intern intervened.
[fabe1999] grabbed an armload, took them home, and set about making them flap again, one letter at a time. An ATtiny worked okay, but it wasn’t really fast enough to flip them at their full clacking potential, so [fabe1999] switched to an ESP8266. So now there is one ESP for each of the 20 characters, and another that runs a web server where text can be directly entered for immediate display.
Each letter uses two sensors to flap to the right letter. The first one acts as a start sensor, detecting the blackness of a blank character. Another sensor counts the letters and makes the ESP stop the motor on the right one. So far, [fabe1999] hasn’t figured out how to recognize when a blank character can stay blank, so they flap all the way around back to blank for now. It certainly adds to the rich, flappy sound, but that can’t be good for the long-term life of the letters. Your flight is now departing for Post Break Island, where the letters are spending part of their retirement showing song titles from Spotify.
Holding on to a cache of old floppies because nostalgia? Us too, and this might be the coolest possible use for ’em. While it’s fun to imagine that he wrote a compression algorithm to fit a lossless copy of Coltrane’s Blue Train on a 1.44Mb coaster, or somehow rolled his own mini-disc, [Dino Fizzotti]’s Diskplayer uses floppies to serve up Spotify albums.
What’s actually on the floppy, then? The corresponding Spotify album URL. He just pops a disk in the drive, and the Pi does the rest — it detects the floppy event and executes a script that starts an open-source Spotify client. There’s no track skipping and no shuffle, just the entire album as intended, take it or eject it. If you think about it, he’s actually managed to improve on the vinyl experience, since all the songs are on one side. Demo is queued up after the break, and it includes [Dino]’s simple web interface for writing the Spoti-floppies.
When this project started seven months ago, [Dino] intended to bring his vinyl collection into the 21st century with RFID tags, but we’re glad that he decided to involve a fairly obsolete medium. Don’t have a drive or a heap of floppies gathering dust in a closet? Neither did [Dino]. But he found plenty of people selling pretty-colored floppies on ebay, and Amazon has tons of cheap external drives. We think the album art stickers are a nice touch, as is matching album cover color to floppy. He’s right to lock those bad boys up.
Direct from the “Just Because I Can” department, this blog post by [Eddie Zhang] shows us how easy it is to get the Xiaomi robotic vacuum cleaner working as what might be the world’s most unnecessary Spotify Connect speaker. Will your home be the next to play host to an impromptu performance by DJ Xiaomi? Judging by the audio quality demonstrated in the video after the break, we doubt it. But this trick does give us a fascinating look at the current state of vacuum hacking.
For the first phase of this hack, [Eddie] makes use of Dustcloud, an ongoing project to document and reverse engineer various Xiaomi smart home gadgets. Using the information provided there you can get root-level SSH access to your vacuum cleaner and install your own software. There’s a sentence you never thought you’d read, right?
With the vacuum rooted, [Eddie] then installs a Spotify Connect client intended for the Raspberry Pi. As they’re both ARM devices, the software will run on the Xiaomi bot well enough, but the Linux environment needs a little tweaking. Namely, you need to manually create an Upstart .conf file for the service, as the vacuum doesn’t have systemd installed. There goes another one of those unexpected sentences.
Back in the early days of social media and Web 2.0, Last.fm was one of the premier music sites on the internet. With a huge library containing what felt like every song ever, along with an excellent algorithm for recommending new tracks, it quickly gained a large following. Unfortunately, its business model and following changed over the years, but there’s still a diehard userbase. [Hexalyse] was unhappy with Spotify’s algorithms, so built a tool to allow her to shadow what Last.fm users were listening to in real time.
Last.fm’s major feature is that it allows you to tell others what you’re listening to, by “scrobbling” your tracks as you play them. It’s possible to scrape this live data from any user via the Last.fm API, making the project possible. [Hexalyse] whipped up a Python script to query a selected user’s current playing track via Last.fm, before then handing the song data to the Spotify API to play the music locally.
The Macintosh SE/30 is the greatest computer ever made, and I’m not saying that just because I’m sitting on a cache of them, slowly selling them to computer collectors around the world. No, the SE/30 is so great because of how powerful it is, and how much it can be expanded. A case in point: here’s an SE/30 that’s a Spotify player. Oh, it does it over WiFi, too.
You might be asking yourself how a computer from 1989 (it’s late enough in the year that we can safely say this computer is thirty years old) can possibly play music over the Internet. While the SE/30 supported an astonishing 128 Megabytes of RAM, it’s still just a bit too slow to play MP3s or any modern audio codec. The 68030 CPU just wasn’t fast enough to play audio, to say nothing of streaming it over a network connection. The trick is that this SE/30 is simply a remote for Spotify Connect. You could theoretically get the Mac to speak, “Alexa, play Despacito” and get the same functionality, but that’s not fun, is it? You need to do it wirelessly.
This is a continuation of one of [ants] earlier hacks that basically put a WiFi to Ethernet bridge inside an SE/30. Tie that together with a Finder extension and you have System 7, with WiFi. That’s a connection to the Internet, but [ants] actual wrote an app to connect to a Spotify playlist, browse tracks, and display album art in beautiful 1-bit color. Writing the app involved dealing with OAuth, which means the MacPlayer isn’t entirely standalone; some of it must be done on a ‘modern’ device. This, along with porting a conversion utility that translates UTF-8 text encoding into something the Mac can understand ties everything together.
With all those pieces, the SE/30 becomes a handsome, functional piece of art. Apple is never going to release a computer like this again, and you’re not going to find a touchbar MacBook being used like this in thirty years time.
In 2017 Spotify finally deprecated their public vanilla C SDK library, libspotify, and officially replaced it with dedicated SDKs for iOS and Android and this new-fangled web thing we’ve all heard so much about. This is probably great for their maintainability but makes writing a native application for a Linux or a hardware device significantly harder, at least without an application process and NDA. Or is it? Instead of using that boring slab of glass and metal in their pocket [Dani] wanted to build a handy “now playing” display and remote control interface but was constrained by the aforementioned SDK limitations. So they came up with a series of clever optimizations resulting in the clearly-named ESP8266 Spotify Remote Control.
The Spotify Remote Control has a color LCD with a touchscreen. Once attached to a Spotify account it will show the album art of the currently playing track (with a loading indicator!) and let you play/pause/skip tracks from its touch screen, all with impressively low latency. To get here [Dani] faced two major challenges: authorizing the ESP to interact with a user’s Spotify account, and low latency LCD drawing.
If you’re not on iOS or Android, the Spotify web API is the remaining non-NDA’d interface available. But it’s really designed to be used on relatively rich platforms such as fully featured web browsers, not an embedded device. To that end, gone are the days of asking a user to enter their username and password in a static login box, the newer (better) way is to negotiate for a per-user token (which is individually authorized per application), then to use that to authenticate your interaction. With this regime 3rd party applications (in this case an ESP8266) never see a user’s password. One codified and very common version of this process is called OAuth and the token dance is called a “workflow”. [Dani] has a pretty good writeup of the process in their post if you want more detail about the theory. After banging out the web requests and exception handling (user declines to authorize the device, etc) the final magic ended up being using mDNS to get the user’s browser to redirect itself to the ESP’s local web server without looking up an IP first. So the setup process is this: the ESP boots and displays a URL to go to, the user navigates there on a WiFi connected device and operates the authorization workflow, then tokens are exchanged and the Remote Control is authorized.
The second problem was smooth drawing. By the ESP’s standards the album art for a given track at full color depth is pretty storage-large, meaning slow transfers to the display and large memory requirements. [Dani] used a few tricks here. The first was to try 2 bit color depth which turned out atrociously (see image above). Eventually the solution became to decompress and draw the album art directly to the screen (instead of a frame buffer) only when the track changed, then redraw the transport controls quickly with 2 bit color. The final problem was that network transfers were also slow, requiring manual timesharing between the download code and the display drawing routing to ensure everything was redrawn frequently.
Check out [Dani]’s video after the break, and take a peek at the sources to try building a Spotify Remote Control yourself.
Perhaps you’ve noticed, but we here at Hackaday have a slight obsession with the over-engineered. One could fairly say there’s a linear relationship between how likely we are to feature a project and how needlessly complex it is. That said, it isn’t as if we are unable to appreciate a minimalist approach. Taking the scenic route can be a lot of fun, but sometimes it’s nice to just get where you’re going before you run out of gas.
This very slick Spotify “Now Playing” display created by [Jon Ashcroft] is a perfect example of that principle. The hardware is so straightforward that it’s barely worth mentioning: a Raspberry Pi with a small HDMI display, tucked neatly into a photo frame. Nothing to get too excited about there. The real hook with this particular project is the software.
Using Spotify’s excellent API, his software pulls down the current track information and stores it locally. It does this every ~4 seconds, checking to see if the track has changed. [Jon] isn’t thrilled with this brute force method, but it works for now. It displays the current playing song and artist, and uses a library called node-vibrant to extract a dominant color from the album art and use that to create a complementary background color. Very slick.
[Jon] provides all of his source code and made it easy to connect to your own Spotify account, so don’t be surprised if you see this running on a “Magic Mirror” near you soon.