Arduino library for integrating with a subset of the Spotify Web-API (Does not play music)
Work in progress library - expect changes!
Working well
Working well
Should in theory work, but I have no tested it on them and will not be able to provide support for them.
I have put a lot of effort into creating Arduino libraries that I hope people can make use of. If you enjoy my work, please consider becoming a Github sponsor!
The Library supports the following features:
Spotify's Authentication flow requires a webserver to complete, but it's only needed once to get your refresh token. Your refresh token can then be used in all future sketches to authenticate.
Because the webserver is only needed once, I decided to seperate the logic for getting the Refresh token to it's own example.
Follow the instructions in the getRefreshToken example to get your token.
Note: Once you have a refresh token, you can use it on either platform in your sketches, it is not tied to any particular device.
Take one of the included examples and update it with your WiFi creds, Client ID, Client Secret and the refresh token you just generated.
By default the getRefreshToken examples will include the required scopes, but if you want change them the following info might be useful.
put a %20
between the ones you need.
Feature | Required Scope |
---|---|
Current Playing Song Info | user-read-playback-state |
Player Controls | user-modify-playback-state |
Download zip from Github and install to the Arduino IDE using that.
There are some flags that you can set in the SpotifyArduino.h
that can help with debugging
#define SPOTIFY_DEBUG 1
// Enables extra debug messages on the serial.
// Will be disabled by default when library is released.
// NOTE: Do not use this option on live-streams, it will reveal your private tokens!
#define SPOTIFY_SERIAL_OUTPUT 1
// Comment out if you want to disable any serial output from this library
// (also comment out DEBUG and PRINT_JSON_PARSE)
//#define SPOTIFY_PRINT_JSON_PARSE 1
// Prints the JSON received to serial (only use for debugging as it will be slow)
// Requires the installation of ArduinoStreamUtils (https://github.com/bblanchon/ArduinoStreamUtils)