witnessmenow / Spotify-NFC-Matrix-Display

10 stars 1 forks source link

Error on SpotifyArduino commonGetImage function #7

Open robegamesios opened 5 months ago

robegamesios commented 5 months ago

hi,

i've been trying to create this using the P3 matrix panel Hub75. when i run in i keep getting an error in the SpotifyArduino commonGetImage function. here is the console log:

Fetching album Art

Removing existing image
Parsing image URL: https://i.scdn.co/image/ab67616d00004851cb7af2d6f58aac0b119ab6bd
host: i.scdn.co
len:host:9
path: /image/ab67616d00004851cb7af2d6f58aac0b119ab6bd
len:path: 47
[ 31759][E][ssl_client.cpp:37] _handle_error(): [start_ssl_client():278]: (-9984) X509 - Certificate verification failed, e.g. CRL, CA or signature check failed
[ 31762][E][WiFiClientSecure.cpp:135] connect(): start_ssl_client: -9984
Connection failed
statusCode: -1
file length: -1
Time taken to get Image (ms): 149
failed to display image: -2
Free Heap: 172760

It says signature check failed. Am i suppose to provide another SSL cert? I thought the SpotifyArduinoCert should take care of it?

Appreciate your help. thanks

witnessmenow commented 5 months ago

Spotify changed where the images were hosted a few months ago, so it requires two different SSL certs now.

I've fixed this issue in this project here: https://github.com/witnessmenow/Spotify-Diy-Thing

That project is essentially the same as this one if you configure it for the matrix (there are instructions on the readme)

So you can either move to using that project, or take the fix from that project back into this one

Fix is here: https://github.com/witnessmenow/Spotify-Diy-Thing/blob/2bfc0c6f7faba02ee33283cbc7f3f71ffb291189/SpotifyDiyThing/matrixDisplay.h#L232

witnessmenow commented 5 months ago

Just to note I haven't tested this since before Christmas, so maybe there is a new problem, but it did fix the issue you described anyways

robegamesios commented 5 months ago

Hi Brian,

Thanks for the info! I'll try it out tomorrow. I appreciate your quick response. Btw have you tried or know if it's possible to fetch the cover art using Plex API and Amazon Music? Once I get this working I'd like to explore those options. All the best

witnessmenow commented 5 months ago

If there are APIs, it's likely the esp32 can connect to them, but it's a significant chunk of work

robegamesios commented 5 months ago

Hi Brian,

I tried web flashing and it worked! Thank you. I imported the platform.io project but when I tried it the matrix panel is just blank. I uncommmented the #define matrix. Do I have to edit something else? I was using the main branch. I wanna add an OTA update to it so I don't have to plug my esp32 since I have other matrix apps that I configure using OTA. Thanks again🙏

witnessmenow commented 5 months ago

When selecting the environment on platform.io, you need to select "Trinity" as the environment. I don't think you need to do anything else

robegamesios commented 5 months ago

Hi, thanks for the tip, it's working now 🙏

robegamesios commented 5 months ago

hi Brian, I'm encountering SSL issues again today. Last night it was working.

[ 77983][E][ssl_client.cpp:37] _handle_error(): [start_ssl_client():273]: (-9984) X509 - Certificate verification failed, e.g. CRL, CA or signature check failed
[ 77986][E][WiFiClientSecure.cpp:144] connect(): start_ssl_client: -9984
Connection failed
status Code-1
Could not parse error[ 80090][E][ssl_client.cpp:37] _handle_error(): [start_ssl_client():273]: (-9984) X509 - Certificate verification failed, e.g. CRL, CA or signature check failed
[ 80093][E][WiFiClientSecure.cpp:144] connect(): start_ssl_client: -9984
Connection failed
Status Code: -1

How do you renew the SSL certs? do you have a guide. Or if you have time can you create new ones? thank you