0 votes
in Touch Interface by (280 points)

I am trying to get the Color Kit Grande Spotify Controller working.  The sample weather station app works fine and the Spotify Controller compiles and connects to the network to get the local time; however, it just loops after the HTTP server is started and doesn't ever get a call back.  The Client ID and secret match what is defined at Spotify and so does the redirect URI.  I added logging to all the defined handlers, but none of them are being called.  I don't see any build or runtime errors.  Has anyone experienced a similar issue?  If so, how did you get past it?

23:46:32.878 > [  4265][I][util.h:25] initTime(): Synchronizing time.

23:46:36.890 > [  8276][I][util.h:31] initTime(): UTC time: 2024-08-03 04:46:36.

23:46:36.895 > [  8276][I][util.h:54] setTimezone(): Setting timezone to 'CST6CDT,M3.2.0,M11.1.0'.

23:46:36.901 > [  8278][I][main.cpp:231] syncTime(): Current local time: 2024-08-02 23:46:36

23:46:36.982 > [  8368][I][persistence.h:36] readFsString(): Loading string from '/refresh-token.txt'.

23:46:36.987 > [  8370][E][vfs_api.cpp:105] open(): /littlefs/refresh-token.txt does not exist, no permits for creation

23:46:36.998 > [  8374][E][persistence.h:43] readFsString(): Failed to load string from file system, returning empty.

23:46:37.004 > [  8383][I][main.cpp:104] setup(): No Spotify refresh token found. Requesting one through the browser via auth code.

23:46:37.181 > [  8568][I][spotify.h:93] fetchSpotifyAuthCode(): *** Entering fetchSpotifyAuthCode()

23:46:37.187 > [  8572][I][spotify.h:95] fetchSpotifyAuthCode(): MDNS responder started for node name 'tp-spotify'.

23:46:37.192 > [  8573][I][spotify.h:96] fetchSpotifyAuthCode(): Open browser at http://tp-spotify.local

23:46:37.204 > [  8582][I][spotify.h:104] fetchSpotifyAuthCode(): HTTP server started

My Spotify Redirect URI is: 

Thanks!

1 Answer

0 votes
by (280 points)
 
Best answer
After putting this down for a while, I got past this.  I probably missed this somewhere, but I didn't realize that I was supposed to open tp-spotify.local on a different device (like a computer) and drive the flow there.  I was thinking that defining tp-spotify.local was only local to my device (similar to adding an entry in a host file).  Once I made sure I had another computer on the same network and hit the URL, I finally saw activity and the root page was handled.  After that, my authentication using OAuth 2.0 worked fine, but the actual Spotify API calls failed due to a certificate validation issue.  I updated the certificate to the latest used in the SpotifyArduino library and got past that.  Now everything looks like it is running under the covers without issue, but the display just stays at Startup completed! with the progress bar at 100% complete.  I am not sure how the UI is supposed to come up, I don't yet see it in the code.

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.

https://thingpulse.com

...