Giter VIP home page Giter VIP logo

arduino-spotify-api's Introduction

arduino-spotify-api

Arduino library for integrating with a subset of the Spotify Web-API (Does not play music)

This fork only runs on ESP32 and probably ESP8266. Instead of implementing the HTTP protocoll again, it uses the provided HTTPClients. It also fixed the memory handling and adds improved support for multiple playback devices.

Work in progress library - expect changes!

Help support what I do!

Brian has created a lot of different Arduino libraries. If you enjoy his work, please consider becoming a Github sponsor!

Library Features:

The Library supports the following features:

  • Get Authentication Tokens
  • Getting your currently playing track
  • Player Controls:
    • Next
    • Previous
    • Seek
    • Play (basic version, basically resumes a paused track)
    • Play Advanced (play given song, album, artist)
    • Pause
    • Set Volume (doesn't seem to work on my phone, works on desktop though)
    • Set Repeat Modes
    • Toggle Shuffle
    • Transfer Playback to other device

What needs to be added:

  • Current play time and song length to currently playing.
  • Save more info on player devices and state.

Setup Instructions

Spotify Account

  • Sign into the Spotify Developer page
  • Create a new application. (name it whatever you want)
  • You will need to use the "client ID" and "client secret" from this page in your sketches
  • You will also need to add a callback URI for authentication process by clicking "Edit Settings", what URI to add will be mentioned in further instructions

Getting Your Refresh Token

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 examples.

Follow the instructions in one of the following 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.

Running

Take one of the included examples and update it with your WiFi creds, Client ID, Client Secret and the refresh token you just generated.

Scopes

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

Installation

Download zip from Github and install to the Arduino IDE using that.

Dependancies

  • V6 of Arduino JSON - can be installed through the Arduino Library manager.

arduino-spotify-api's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.