Git Product home page Git Product logo

micropython-spotify-status-display's Introduction

micropython-spotify-status-display

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.

2.42" OLED in 3D printed case

Features

  • "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

Requirements

  • ESP32 with MicroPython 1.14 or later
    • version 1.18 or later recommended
  • SSD1306 or SSD1309 compatible 128x64 pixel OLED display in i2c mode
  • 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.

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 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 with EHOSTUNREACH which gets displayed
  • async api requests / server communication (if possible)

Building it

Controls

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.

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

micropython-spotify-status-display's People

Contributors

vergoh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.