Skip to content

kaustubhdoval/ESP-Spotify-Player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP Spotify Player

An ESP32 based Spotify Player.
Explore the docs »

· Report Bug · Request Feature ·

A Physical Spotify Controller using an ESP32, 3 Buttons, Rotary Encoder and a 128x64 OLED Screen (SH1106).

Project on a Perfboard

User Guide

  1. Plug the ESP to Power
  2. Navigate to the ESP_IP and login to Your Spotify Account
  3. Your Device should now be able to Control Music!



Setup

You need to have an application on the Spotify API Dashboard. Make sure that it has Web API enabled. You need to make the following modifications to the provided code:

  1. Rename the 'secrets_EXAMPLE.h' file to 'secrets.h'
  2. Change the placeholder values in 'secrets.h' to your values
  3. Run the program, You can see your ESPs IP on Serial Monitor (9600 Baud Rate) and on the OLED. You need to add the IP address of your ESP to REDIRECT_URI definition in 'secrets.h': https://YOUR_ESP_IP/callback
  4. Upload this new code to the ESP32

There are also some changes you need to make to the esp32_https_server library code to enable larger header size. Open the HTTPSServerConstants.hpp file Change the following values:

#define HTTPS_CONNECTION_DATA_CHUNK_SIZE 4096
#define HTTPS_REQUEST_MAX_REQUEST_LENGTH 8192
#define HTTPS_MAX_HEADER_LENGTH 4096



Quick Checks

  • Add the Redirect URI to the Spotify Web API via the Dashboard.
  • Make sure the main.cpp, spotifyClient.h, spotifyClient.cpp, index.h and secrets.h files are in the same directory when uploading the code.
  • Change constants in the esp32_https_server library

Wiring

OLED

SCK -> D22
SDA -> D21

Buttons

previous button -> D5
play/pause button -> D18
next button -> D19

Rotary Encoder

CLK -> D4
DT -> D2
SW -> D15

Dependencies

  • adafruit/Adafruit GFX Library@^1.12.0
  • adafruit/Adafruit SH110X@^2.1.12
  • madhephaestus/ESP32Encoder@^0.11.7
  • bblanchon/ArduinoJson@^7.4.1
  • arduinogetstarted/ezButton@^1.0.6
  • fhessel/esp32_https_server@^1.0.0

Credits

About

An ESP32 based Spotify Controller

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors