MicroPython implementation for ESP32 using a small OLED display to show the "currently playing" information of a Spotify playback device. Two buttons can optionally be added for controlling the playback device. For intended usability, having the buttons is highly recommended.
- "currently playing" information with progress bar
- artist + track
- show/podcast + episode
- playback control (optional)
- play / pause
- next track
- pause after current track
- add current track to library
- configurable poll interval and behaviour
- access token stored in device after initial login
- buzzer (optional) for confirming button presses
- screensaver for standby mode
- self contained implementation
- custom 3D printable case with lid
- ESP32 with MicroPython 1.14 or later
- version 1.18 or later recommended
- SSD1306 or SSD1309 compatible 128x64 pixel OLED display in i2c mode
- optional if buttons are only needed / used
- verified
- 0.96" SSD1306
- 2.42" SSD1309 (recommended)
- most likely ok
- not verified
- wlan connectivity
- Spotify account
- Premium needed for playback control
- control buttons (optional)
- buzzer (optional)
See also beginning of Case.md for a full list of needed components for building the cased solution shown above.
- 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 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
- better handling of rare cases of
ECONNABORTED
followed withEHOSTUNREACH
which gets displayed - async api requests / server communication (if possible)
- 3D printed case build or DIY wiring explains the hardware setup
- Configuration contains the install instructions
Left button | Right button | |
---|---|---|
active, short press | play / pause / resume | next track |
active, long press | save track | pause after current track |
standby | wake up and resume playback | wake up |
Long press is >= 500 ms by default.
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 |