Announcements

Help Wizard

Step 1

NEXT STEP

Please help with ESP32 api problems

Please help with ESP32 api problems

Plan

Premium

Country

America

Device

(ESP32)

Operating System

windows(to code it in)

My Question or Issue

I have an ESP32 that i wanted to use to control my spotify. However, due to the spotify API changes that dont let me use HTTP anymore, I cannot sign in to the arduino and i have so many problems and everything is falling apart. Here is my code

#include <WiFi.h>
#include <SpotifyEsp32.h>
char* ssid = "<snip - Moderator Edit>";
const char* password = "<snip - Moderator Edit>";
char* client_id = "<snip - Moderator Edit>";
char* client_secret = "<snip - Moderator Edit>";
char* refresh_token = "<snip - Moderator Edit>";

Spotify sp(client_id, client_secret, refresh_token);
void setup() {
  Serial.begin(115200);
  connect_to_wifi();
  sp.begin();
  while(!sp.is_auth()){
    sp.handle_client();
  }
  Serial.println("Authenticated");
  Serial.println(sp.current_artist_names());

}

void loop() {
  // put your main code here, to run repeatedly:

}
void connect_to_wifi(){
  WiFi.begin(ssid, password);
  Serial.print("Connecting to Wifi...");
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.print(".");
  }
  Serial.print("\nConnected to Wifi!!!\n");
}

I used a tutorial to get it but this is the output when i run the code

...
Connected to Wifi!!!
Authenticated
Something went wrong

I really want to fix it but i dont know how and i would love if someone could help me otherwise i may give up on the project

Reply
0 Replies

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random