Please help with ESP32 api problems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Labels:
- Labels:
-
Discussion
-
Question
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page