Gabe-H / ESP8266-Spotify-OLED

View the currently playing song on Spotify using an ESP8266 and SSD1306 128x64 OLED, using SoftAP for flexible Wi-Fi networks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ESP8266 Spotify OLED

For use with an SSD1306 128x64, designed in mind for blue-yellow displays.
Demo pic

Requirements

  • VS Code with PlatformIO installed
  • ESP8266 (D1 mini configured)
  • 128x64 SSD1306
  • (OPTIONAL) 3D printed case

Uploading

Precompiled

Download the latest Release binary for D1 Mini, and use esptool.py to upload.
Then go to Device Setup

Compile yourself

You will need to supply your own Spotify client credentials, created from the Spotify Application Dashboard .
Click create an app, and give it a name, description, and check the boxes. Once created click "Edit Settings" and add a redirect uri of

http://ardspot.local/

You can put the Client ID and Client Secret in the code in 2 ways:

  1. Add them to main.cpp in the #define's and uncomment
  2. If you want to keep your credentials git-ignored, you may create file src/cred.h like this:
#define CLIENT_ID "your_client_id"
#define CLIENT_SECRET "your_client_secret"

Then upload to the ESP8266 using PlatformIO, or compile and use esptool.py

Device Setup

When you boot the first time, connect to "Ard Connect" wifi. If the captive page doesn't load automatically, go to http://ardspot.local/ and sign into your wifi network.

The device will reboot, and you can continue to sign into Spotify by first connecting to the same network as the device, then again going to http://ardspot.local/ and clicking sign in.

The Device

As of this version, the device only has the ESP8266 board, and the OLED. Future versions may have support for playback control buttons and more features. Only point to bring up here is that besides displaying the current playback of your Spotify account, the screen will show a small dot in the top right if it has lost connection. It is nothing to restart the device over, but just a reminder that the device will not have quick updates if the dot is visible.

Home page

The Home page (http://ardspot.local/) has a some buttons:

  • A Spotify sign in button with a checkbox next to it. In most cases you can simply press the button and sign in, but if you press the check mark it allows "show dialog" with the api authorization, so you can switch accounts if needed, and see the requested scopes
  • A Wi-Fi reset button. This will reset only the WiFi SSID and password, and upon reboot will start access point (AP) mode
  • A Sign Out button. This will remove the saved Spotify refresh token, and reboot giving the message to sign in by going back to the home page.
  • A Factory Reset button. This will wipe the EEPROM and comepletely restart the device.

AP Mode

Will start a WiFi network called "Ard Connect". Connect to that network and use screen to set up.

Connections

wiring diagram

Wiring diagram by Bits and Bobs

About

View the currently playing song on Spotify using an ESP8266 and SSD1306 128x64 OLED, using SoftAP for flexible Wi-Fi networks.

License:MIT License


Languages

Language:C++ 55.9%Language:C 38.0%Language:HTML 6.0%Language:Shell 0.1%Language:CMake 0.0%Language:Makefile 0.0%