Skip to content

Commit 583d6b6

Browse files
committed
Initial setup incl. Spotify auth
0 parents  commit 583d6b6

31 files changed

+7587
-0
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
indent_style = space
12+
indent_size = 2
13+
max_line_length = 100
14+
curly_bracket_next_line = false
15+
16+
[*.{html,php}]
17+
max_line_length = 160

.github/workflows/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# documentation at https://docs.platformio.org/en/latest/integration/ci/github-actions.html
2+
3+
name: PlatformIO CI
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/cache@v3
15+
with:
16+
path: |
17+
~/.cache/pip
18+
~/.platformio/.cache
19+
key: ${{ runner.os }}-pio
20+
- uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.9'
23+
- name: Install PlatformIO Core
24+
run: pip install --upgrade platformio
25+
26+
- name: Build PlatformIO Project
27+
run: pio run

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.pio
2+
.vscode

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 ThingPulse
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Color Kit Grande Spotify Controller
2+
3+
[![Build Status](https://github.com/ThingPulse/esp32-spotify-remote/actions/workflows/main.yml/badge.svg)](https://github.com/ThingPulse/esp32-spotify-remote/actions)
4+
5+
Spotify controller application for the [ThingPulse Color Kit Grande](https://thingpulse.com/product/esp32-wifi-color-display-kit-grande/).
6+
7+
[![Color Kit Grande with sample application: weather station](https://thingpulse.com/wp-content/uploads/2022/10/ThingPulse-Color-Kit-Grand-with-sample-application.jpg)](https://thingpulse.com/product/esp32-wifi-color-display-kit-grande/)
8+
9+
## Purpose of this project
10+
11+
Using the ThingPulse Spotify Controller you control a Spotify player (phone, browser, etc) from an Espressif ESP32 microcontroller.
12+
Album artwork as well as title and artist name are loaded from the Spotify Web API over WiFi and displayed on a color TFT touch-screen.
13+
The currently playing song can be paused, resumed and skipped to the next or previous song in the playlist.
14+
15+
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.
16+
In order to run this project on your device, you will need to setup an application on your Spotify dashboard (instructions below).
17+
18+
## Features
19+
20+
- Artwork download
21+
- Control player on touch screen: play, Pause, next, prev
22+
- Authentication and authorization (OAuth 2.0 flow) on device.
23+
24+
## Service level promise
25+
26+
<table><tr><td><img src="https://thingpulse.com/assets/ThingPulse-open-source-community.png" width="150">
27+
</td><td>This is a ThingPulse <em>community</em> project. See our <a href="https://thingpulse.com/about/open-source-commitment/">open-source commitment declaration</a> for what this means.</td></tr></table>
28+
29+
## Setup instructions
30+
31+
### Precondition
32+
33+
The below instructions assume a properly configured Visual Studio Code installation with PlatformIO.
34+
See our [instructions](https://docs.thingpulse.com/guides/esp32-color-kit-grande/#development-environment) if you need help with this.
35+
36+
### Get access to the Spotify API
37+
38+
1. Go to [https://developer.spotify.com/dashboard/login](https://developer.spotify.com/dashboard/login) and login to or sign up for the Spotify Developer Dashboard
39+
40+
2. Select "My New App"
41+
42+
<img src="./images/SpotifyDashboard.png" width="400">
43+
44+
3. Fill out the form. Give your new app a name you can attribute to this project.
45+
It's safe to select "I don't know" for the type of application.
46+
47+
<img src="./images/SpotifyAppSignUp1.png" width="400">
48+
49+
4. At the end of the 3 steps click "Submit"
50+
51+
<img src="./images/SpotifyppSignUp3.png" width="400">
52+
53+
5. Set the unique Client ID and Client Secret as values for the respective variables in `settings.h`.
54+
55+
<img src="./images/SpotifyCredentials.png" width="400">
56+
57+
6. Click on "Edit Settings". Add "http://tp-spotify.local/callback/" to the Redirect URIs section.
58+
59+
**NOTE** If you are running more than ThingPulse Spotify Remote in the same WiFi network, you should choose a unique name rather than "tp-spotify". Regardless of what you choose it has to reflect what you set for `SPOTIFY_ESPOTIFIER_NODE_NAME` in `settings.h` in the project.
60+
61+
<img src="./images/SpotifyAppSettings.png" width="400">
62+
63+
7. Don't forget to save your settings.
64+
<img src="./images/SpotifyAppSettingsSave.png" width="400">

data/ThingPulse-logo-260.jpeg

24.9 KB
Loading

images/SpotifyAppSettings.png

149 KB
Loading

images/SpotifyAppSettingsSave.png

23.2 KB
Loading

images/SpotifyAppSignUp1.png

149 KB
Loading

images/SpotifyConnectScreen.png

191 KB
Loading

0 commit comments

Comments
 (0)