Open roogue opened 5 months ago
~Update: I met the same issue even if I ran the exact same code from your getRefreshToken.ino
example. I am doubting maybe it is the behavior of the WifiClientSecure library.~
Connected to xxx wifi
IP address: 192.168.x.xxx
MDNS responder started
HTTP server started
grant_type=authorization_code&code=xxxx
accounts.spotify.com
Status: HTTP/1.0 200 OK
HTTP Version: HTTP/1.0
Status Code: 200
status Code200
[ 5379][E][ssl_client.cpp:37] _handle_error(): [data_to_read():361]: (-80) UNKNOWN ERROR CODE (0050)
~Edit: It happens randomly too, sometimes it behaves as intended.~
I think I found the problem, the issue occurred in SpotifyArduino.cpp
lines 86, under makeRequestWithBody()
function.
Somehow it happened when an empty body was printed with client->print(body);
I made a tad bit changes to the code and everything seems working again,
From
client->print(body);
To
if (strlen(body) == 0)
{
client->println();
}
else
{
client->print(body);
}
Where I use client->println();
instead when printing an empty body.
Hi I am new to C++ language and this library. So far this library works for my project, however, the
spotify.play()
function will always fail with the following message.The strange thing is, the request was actually sent successfully, and my music was played as intended.
Additional Info: