• Stars
    star
    263
  • Rank 155,624 (Top 4 %)
  • Language
    C
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Control your Spotify player from a ESP8266 with color touch display

ThingPulse esp8266-spotify-remote

ThingPulse logo

Purpose of this project

This project lets you control a Spotify player (phone, browser, etc) from an ESP8266. Album artworks as well as title and artist name are fetched from Spotify's Web API over WiFi and displayed on a ILI9341 color TFT screen. The currently played song can be paused, played and skipped to the next or previous song in the playlist.

A full OAuth 2.0 web flow is used to acquire the necessary access and refresh tokens to permit the user to control the player. In order to run this project on your device you will have to setup an application on Spotify's developer dashboard.

Features

  • Artwork Download
  • Control Player on touch screen: Play, Pause, Next, Prev
  • Authentication and Authorization (OAuth 2.0 flow) On device.

Demo Video:

Demo Video

Recommended Hardware

We developed this project specifically for our ESP8266 Color Kit. If you appreciate the hard work and our willingness to open-source projects like this one then please support us by buying our hardware.

Contributions

Please see our Guidelines if you want to contribute to this project. Contributions are more than welcome!

Service level promise

This is a ThingPulse community project. See our open-source commitment declaration for what this means.

Setup Instructions

Precondition

The below instructions assume that your Arduino IDE is properly setup to work with the ThingPulse Color Kit. See our standalone tutorials for setting up the IDE and installing the drivers if you need help with that.

Prepare Project in Arduino IDE

  1. Download this project either as ZIP file or check it out with Git
  2. Open the project in the Arduino IDE.
  3. Install the required Arduino libraries. Go to Sketch > Include Library... > Manage Libraries.... Then, for each library, put its name into the text field to have its metadata pulled from the internet and displayed below. Select the latest version and install it.
    1. Mini Grafx library (by ThingPulse, V 1.0.0 or later)
    2. JPEGDecoder library (by Bodmer, Makoto Kurauchi, Rich Geldreich, v1.7.8 or later). After installing the library go to your Arduino sketchbook folder (the one configured in Arduino Preferences > Sketchbook location). In that folder open file libraries/JPEGDecoder/src/User_config.h and comment line 5 so that it reads //#define LOAD_SD_LIBRARY.
    3. JSON Streaming Parser library (by Daniel Eichhorn, v1.0.5 or later)
    4. ThingPulse XPT2046 Touch (our fork of the original lib by Paul Stoffregen, v1.2.0 or later)
  4. Set your WiFi credentials in the settings.h file
  5. Complete the steps below to get the values for the Spotify settings required in settings.h

Get Access to the Spotify API

  1. Go to https://developer.spotify.com/dashboard/login and login to or sign up for the Spotify Developer Dashboard

  2. Click on "My New App"

  1. Fill out the form. Give your new app a name you can attribute to this project. It's safe to select "I don't know" for the type of application.

  1. At the end of the 3 steps click "Submit"

  1. Set the unique Client ID and Client Secret as values for the respective variables in settings.h

  1. Click on "Edit Settings". Add "http://esp8266.local/callback/" to the Redirect URIs section.

    NOTE If you're running more than ThingPulse Spotify Remote in the same WiFi network you should choose a unique name rather than "esp8266". Regardless of what you choose it has to reflect what you set as espotifierNodeName in settings.h

  1. Don't forget to save your settings.

Compile and run the application

After all this configuration it's about time to run the application!

  1. First check the configuration in settings.h one more time to ensure the Spotify values match those set on the Spotify Developer Dashboard. Better safe than sorry, they say.

  2. Attach your ESP8266 Color Kit to your computer and select the correct serial port and flash settings in the Arduino IDE as per https://docs.thingpulse.com/guides/wifi-color-display-kit/#select-flash-mode-and-flash-size

  3. Upload the code to your ESP8266

  4. When you run this the first time you'll have to go through additional steps. The display will ask you to open the browser at a specific location. This will redirect you to the dialog below.

  1. The next step is to calibrate the screen. Click on the white circles

  2. Now open your Spotify player and start a song. If everything worked out you'll see the song information with artwork on the TFT screen!

More Repositories

1

esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
C++
1,991
star
2

esp8266-weather-station

ESP8266 Weather Station library supporting OpenWeatherMap, Aeris and other sources
C++
1,061
star
3

esp8266-weather-station-color

ESP8266 Weather Station in Color using ILI9341 TFT 240x320 display
C
565
star
4

minigrafx

ESP8266 graphics library
C++
218
star
5

espaper-weatherstation

WeatherStation for the 2.9" ESPaper modules
C
89
star
6

esp8266-plane-spotter-color

Color version of the ESP8266 Plane Spotter
C
74
star
7

esp32-icon64-a2dp

Stock firmware for the Icon64. Bluetooth speaker with graphical spectrum analyzer
C
68
star
8

espaper-client

ESP8266 Arduino client to fetch and display data from ThingPulse ESPaper server
C
33
star
9

esp8266-plane-spotter

C++
24
star
10

ESP8266PowerMonitor

Code to monitor the power consumption of embedded devices
C++
18
star
11

esp32-espnow-gateway

Project for the ThingPulse ESPNow Gateway
C
16
star
12

esp32-weather-station-touch

Sample application for the ThingPulse ESP32 Color Kit Grande
C
14
star
13

esp32-espgateway-demo

Simple demo code to show communication between the two ESPs and the RGB LEDs
C++
8
star
14

esp32-ble-gateway

Project for the ThingPulse ESPGateway to track BLE devices
C
6
star
15

esp32-spotify-remote

C
6
star
16

MAX17055-fuel-gauge

Arduino compatible library for the MAX17055 fuel gauge chip
C++
5
star
17

docs

5
star
18

esp32-epulse-feather-testbed

Firmware to test the ThingPulse ePulse Feather
C++
5
star
19

esp32-s3-pulse-eco-box

Sample Project for the Pulse.Eco Box
C
4
star
20

esp32-icon64-co2

Measure CO2 with either the Winsen MH-Z19C or the Sensirion SCD41 sensor and display the values on the Icon64
C
3
star
21

icon64-word-clock

Word clock code for the Icon64 device
C
3
star
22

esp-iot-flasher

TypeScript
3
star
23

thingpulse-devices

Technical Documentation for ThingPulse devices
3
star
24

espaper-7in5-esp32

Demo for the 7.5 espaper module
C
2
star
25

fritzing-parts

Fritzing parts for ThingPulse devices
2
star
26

iotworkshop2019

Repository for the Open CH Workshoptage course 2019
C++
2
star
27

esp32-cubo

Sample project for the Cubo
C
2
star
28

esp32-pendrive-s3-wifi-dongle

WiFi Dongle Application for Pendrive S3
C
2
star
29

esp32-s3-pendrive-samples

Samples for the ThingPulse Pendrive S3
C++
2
star
30

esp32-icon64-toothfairy

ThingPulse Icon64 app that renders a visual countdown for brushing your teeth while playing webradio through its internal speaker.
C++
2
star
31

esp32-icon64-speaking-dice

Repository for the Icon64 speaking dice tutorial
C++
1
star
32

esp32-icon64-test

Example code for the ThingPulse Icon64
C++
1
star
33

epulse-feather-c6

Landing Page for epulse Feather C6
CSS
1
star
34

esp32-gateway-paxcounter

PAX Counter project for the ThingPulse ESPGateway Ethernet device
C
1
star
35

esp32-s3-pulse-eco-box-client

Example project to send data to pulse.eco by http request
C
1
star
36

esp32-ckg-lvgl-demo

Demo to run LVGL on the Color Kit Grande
C
1
star
37

esp32-s3-pendrive-wireless-usb-disk

Wireless USB Disk for Pendrive S3
C
1
star
38

esp-app-market

Web App To Flash firmware for Espressif microcontrollers
TypeScript
1
star