Skip to content

"Currently playing" display for Spotify with play/pause/next/save controls

License

Notifications You must be signed in to change notification settings

renatojobal/spotify-keypad-controller

 
 

Repository files navigation

spotify-keypad-controller

Forked from https://github.com/vergoh/micropython-spotify-status-display

The Spomacropad is a MicroPython implementation for ESP32, featuring a small OLED display to show the "currently playing" information of a Spotify playback device. You can customize it by adding a display, buttons, or a potentiometer according to your preference. For optimal usability, it is highly recommended to include the buttons.

Product finished

Features

  • "currently playing" information with progress bar
    • artist + track
    • show/podcast + episode
  • playback control (optional)
    • previous track
    • play / pause
    • next track
    • pause after current track
    • add current track to library
    • switch device playing
  • configurable poll interval and behavior
  • access token stored in the device after initial login
  • buzzer (optional) for confirming button presses
  • screensaver for standby mode
  • self-contained implementation
  • custom 3D printable case or custimze the model in Thinkercad

Requirements

See also the beginning of Case.md for a full list of needed components for building the cased solution shown above.

Limitations

  • buttons don't react during API requests / server communication
  • buttons require Spotify Premium due to API restrictions
  • default font supports mainly US-ASCII characters
    • unsupported Western characters are, however, automatically mapped to the closest US-ASCII equivalents
  • playback device isn't aware of the status display, resulting in delayed status changes when the playback device is directly controlled

TODO

  • better handling of rare cases of ECONNABORTED followed by EHOSTUNREACH which gets displayed
  • async API requests / server communication (if possible)

Building it

Controls

active, short press active, long press standby
previous button previous track
stop button play / pause / resume save track wake up and resume playback
next button next track pause after current track wake up
switch button switch playing to another available device
potentiometer volume control (when available)

Long press is >= 500 ms by default.

Included 3rd party implementations

file description
ssd1306.py based on https://github.com/adafruit/micropython-adafruit-ssd1306
uurequests.py based on https://github.com/pfalcon/pycopy-lib/blob/master/uurequests/uurequests.py
helpers.py reduced from https://github.com/blainegarrett/urequests2

About

"Currently playing" display for Spotify with play/pause/next/save controls

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 99.1%
  • Makefile 0.9%