witnessmenow / spotify-api-arduino

Arduino library for integrating with the Spotify Web-API (Does not play music)
MIT License
178 stars 33 forks source link

Connection failed in examples #43

Closed aeklo closed 2 years ago

aeklo commented 2 years ago

Hi, I have some troubles running the examples. I know I got the examples running last year, but unsure if the "connection failed" is due to a Spotify API change or not. The response from all examples are:

stack size -1073423839 accounts.spotify.com Status: HTTP/1.0 200 OK HTTP Version: HTTP/1.0 Status Code: 200 status Code200 No JSON error, dealing with response Free Heap: 266652 Getting devices: /v1/me/player/devices stack size -1073424191 Connection failed Status Code: -1

richielive commented 2 years ago

I also have the same problem... :(

witnessmenow commented 2 years ago

I'll have to take a look over the next few days, but since the original date of the issue I can confirm a project I have that is using the Spotify api is still working.

What board are you using and what version of software?

richielive commented 2 years ago

esp-01 Arduino 1.8.19 spotify-api-arduino latest

witnessmenow commented 2 years ago

Maybe the fingerprint is expired? It doesn't match up to logs from @aeklo I dont think as it looks like there is one successful connection in there, but its the most common reason ESP8266 requests start to fail.

You can verify thats the issue by enabling client.setInsecure, if that works, a new fingerprint is needed. https://github.com/witnessmenow/spotify-api-arduino/blob/main/examples/getDevices/getDevices.ino#L122

Details around fingerprints and setInsecure can be found here: https://youtu.be/HUjFMVOpXBM?t=259

richielive commented 2 years ago

Maybe the fingerprint is expired? It doesn't match up to logs from @aeklo I dont think as it looks like there is one successful connection in there, but its the most common reason ESP8266 requests start to fail.

You can verify thats the issue by enabling client.setInsecure, if that works, a new fingerprint is needed. https://github.com/witnessmenow/spotify-api-arduino/blob/main/examples/getDevices/getDevices.ino#L122

Details around fingerprints and setInsecure can be found here: https://youtu.be/HUjFMVOpXBM?t=259

Thanks my program works fine I will "client.setFingerprint(SPOTIFY_FINGERPRINT);" Change it to client.setInsecure();

witnessmenow commented 2 years ago

Updated Fingerprints for ESP8266 in fd84a2fe37756a810f54ee79c9a8958473e6d2c1

Don't know of any other connection issues