Raspberry Pi and Spotify Powered Frame
Vložit
- čas přidán 20. 08. 2024
- GitHub Source Code: github.com/rya...
Spotify Developer Dashboard: developer.spot...
Parts for Build:
RGB Matrix: www.adafruit.c...
RGB Matrix Bonnet: www.adafruit.c...
5v 4a Power Supply: www.adafruit.c...
Raspberry Pi Zero: www.adafruit.c...
This is a full build guide for spotipi in 2021. It will show you how to build a Raspberry Pi and Spotify powered frame to display what you are listening to on Spotify. This is a passion project of mine and I hope that you all enjoy it as much as I did making it.
For those wondering, the code changed and the file “.cache-” is now just “.cache”
Hi Ryan, I am trying to set this up. I have put together all components and soldered the relevant pins on the bonnet, are you able to help as I am trying to set this up using putty via windows. I have installed the raspberry os on the SD, inserted and then SSH'd directly onto the Pi. I have then configured using the commands (im not sure if because im missing any of the copy steps it is not working) I shouldent need to copy anything providing its all been set up already on the pi?)
Any help is appreciated
@@Echo42Luke see a comment of @rwardtech below. He advises to run everything directly on the pi
I'd love to see a 3-d printed enclosure for this! truly the icing on top the cake
Checkout my tiktok and I have a design for a case now :D www.tiktok.com/@rwardtech
I'd love to build something like this. I've had a Spotify build planned for over a year but I haven't been able to get my hands on a pi without paying a 300% mark up. 600% for the zeros.
Thank you so much! This was able to work perfectly for me compared to the "thirtytwopixels" project.
Great video!
I would love to build this if it could integrate with Home assistant, API endpoints for brightness, on/off would make this great!
Been interested in doing this at some point. I don't have much experience with home assistant but I have only heard good things about it
Thanks so much for this guide - it’s working perfectly on a Pi 4B! Out of curiosity, would a similar project work with Apple Music? Do they have a similar developer API service to leverage?
Really glad you got the project working 😁 unfortunately there is no proper Apple Music api endpoint for this. Spotify > Apple Music
@@rwardtech Thought that might be the case - thanks again for all the great work here - my setup is still going strong!
Great Video! Do the led matrix drivers need to be specific to the board you are using if it's not the one you've used in the video?
Would love to see this with the new Raspberry Pi Pico W
Hi @Ryan Ward great project. After the initial setup with credentials etc, can this be run with any Spotify username when you start up the app?
Hi Ryan,
This is my first project with a raspberry pi. Is there any setup for the pi needed before installing the software on the raspberry pi? Do I need to install the pi OS first? Also any tips for a newbie at this would be much appreciated :)
Thanks for the awesome video!
Yes you need to install raspberry pi OS! I recommend using the version named Buster. There are known issues with using spotipi and the latest pi OS named Bullseye
Also join the discord discord.gg/P97DPpfV
You can post any questions in there :)
@@rwardtech can we grab a fresh link ? Running into issues with the generating token step
Hi, cool project, I got it to work and it looks awesome! The only issue is that it takes a while for the display to update, it can take anywhere from like 10 seconds after the song starts to halfway into the next song. Is this due to the nature of Spotify's API or is it something that I can fix myself?
Update: I got it to switch songs in a timely manner by making the following changes to the code:
1. Make the cache file writable
2. Change the time.sleep values in the python file from 1 second to 5 seconds (Pi zero gets overloaded if you try to query every seconds, might be fine leaving this alone on a more powerful pi)
3. Add a 10 second timeout to the get request in the python script. I think this was the main issue. If you don’t have this, then it’s just gonna hang forever until it does get a response from the server.
Great video, thanks. Do you think it would be possible to integrate the lyrics feature of Spotify to get a Karaoke machine? Thanks a lot for your work,it's really great and inspiring.
Hi Ryan, this is an awesome project! In my attempt I fail unfortunately, maybe you have an idea?
Actually, everything worked as described, but the display is distorted by the colors. You can see on the matrix that the covers are loaded, but white and bright colors are displayed in red.
Do I still have to configure the display of the colors correctly somewhere here?
Maybe you have a good tip for me, have the process now already 3 times as described, but the result is always the same.
Thanks!!
Strange is also that the spotipi logo is displayed well in the right colors.
I’m really glad you got the display to work functionally! It is a pretty complicated project and I tried to make it as easy as possible to get running.
As for troubleshooting, I highly recommend reading this: github.com/hzeller/rpi-rgb-led-matrix
There is a README.md with a “troubleshooting” section. I used this when building the project to fix any issues with the display.
If you still can’t figure it out, reach out and I will see what I can do :)
Hi @@rwardtech, thanks that really solved it. Someone there described exactly my problem. When the panel gets too little power, white light is displayed as red. Changed power supply and good. Sometimes so it can be so simple :D
I’m so glad you figured out your problem! That is an excellent resource for troubleshooting anything with a RGB matrix.
does with work on Windows? when I put in the bash generate-token.sh command it gives me "command not found" errors and skips over all the Spotify inputs (client id, secret etc.) and tells me that is has created a token "Filename: .cache- ". Not sure what I'm doing wrong.
Hey, i just solved your problem:
you have to change the end of line format of the "generate-token.sh" file.
For that open the "generate-token.sh" file with Notepad++.
Then you have to click on edit, format end of line and change to unix.
Afterwards just safe the file and try to run the bash command again.
Hope this helps.
Have a nice day :)
@@maxa.2337 Hey man thanks for your help. This partially solved the problem and it is appearing the command prompt now but it is telling me pip isn't found for line 2. I have python installed on my computer but do I need to install the UNIX version also? This is kind of a first project so I think I'm missing some groundwork stuff which the video assumed I would have.
@@Billy-jw6zz hey did you figure this out? Having the same issue
I recommend running all the commands on your raspberry pi. This eliminates issues regarding macOS or windows
heya absolutely love this and thank you so much for sharing your code going to try this very soon. I was just wondering if you have seen the modern day record player by talaexe or Uma Abu if so have you ever looked into combining these projects?
Went through this twice now but nothing is appearing on the matrix. The default spotipi logo appears when I try and run a different .py file to test the matrix is working, but no album cover. And if I run your individual .py files (displayCoverArt etc.) I get "No Module Named Spotipy" even though I've ensured it's installed, and tried re-installing it with 'pip install spotipy' and a half dozen other commands. Any ideas?
hey man, im having the same issue, have you solved it by any chance?
@rwardtech i tried your tutorial with the solderin but I don't get any output to the screen. The spotify app dashboard recognizes the requests that are coming in but the screen stays black. When i hold the screen and apply light pressure by the sides a few leds light up a little and dim again when i let go. Do I have a faulty screen? The power and data seems to be coming through when i check for a current but the screen stays black. In the raspberrypi.local dashboard everything looks fine and the screen is set to on. Can you help me?
@rwardtech do you have any idea? still struggling to get it to work
I have having the exact same issue, any ideas on resolution?
I also have the same issues, my matrix works with the bonnet when I run other code - but this doesn't work for me
Was anybody able to figure this out?
Can you do the live backgrounds?
That’s so cool what did you use to convert the image?
The rpi rgb matrix library from user hzeller on GitHub! The guy is a genius
Spotipi
can this be integrated to also play audio using a rasberry pi as a receiver?
If I were to use a raspberry pi 3b, would I need a power supply for the Pi and the bonnet? And if so, if there a split cable online I could buy that could power both at the same time?
Could I do this without soldering? I don’t have the tools necessary for that D:
Would love to know the answer to this question too! I want to make this but I’m confused with the soldering part 😫
Unfortunately soldering is required for this project. It is honestly really easy though and I recommend learning it!
Hi Ryan, this was my first Raspberry Pi project and it is such a center piece at home. I started with a 32x32 matrix. Just bought a 64x64 for extra details. I set it up, but I am noticing flickering which was not the case with the 32x32 matrix. Any Ideas?
Awsome project, and thanks.
Thanks for the kind words! With the 64x64 did you solder the “e” pin on the matrix bonnet?
Great tutorial. Thank you so much. Btw is it possible to change the Resolution to 128 x 128.I have 4 Hub75 and I want to chain them together.
I am also looking for a solution for this. I have a NovaStar MCTRL300 and 4 1.9mm 128x128 modules on a frame. I'd love to do something on this with a high definition image of the album cover but am having a hard time finding a way to do it, between using a service like Dakboard or programming something like this. Please reply if you find a way to do that?
I’m not good with soldering. During the set up, is it possible to use the convenience option and skip the soldering of GPIO 4 and 18 for the project or is it an absolute requirement?
It is possible to just use the convenience option! You likely see flickering on the display but it should work
if you go in our dash board with spotify is there information there. i've done this walk through 2 times now thinking i messed up something simple. i get no errors and no display, when is the raspberry symbol supose to apear as well?
Great guide! Can this be set up to connect to your local internet via wifi?
Hi Ryan, whenever I'm trying to make the .cache file, this message pops up. Also it just creates the .cache file, not .cache-[spotifyusername].
/home/pi/spotipi/python/generateToken.py:12: DeprecationWarning: You're using 'as_dict = True'.get_access_token will return the token string directly in future versions. Please adjust your code accordingly, or use get_cached_token instead.
token = auth.get_access_token()
It does seem to create the file though so, not sure what the problem is. When completing the setup, my display doesnt show anything though.
Hey man! Have you solved this? Im having the same issue, my screen is stuck on the base logo. I checked the Spotify console, and I've had one pull request
Yes, this was an issue with the code. It removes the username from the file. But just using the .cache file will work just fine!
Hello Ryan, I have gotten everything to work and it displays a raspberry as the default page. However, the spotify album covers will not display as I play music. How can I troubleshoot what went wrong with this part of the project?
I would first see if you can access the web client. It should be .local
@@rwardtech I appreciate the response! I got it working, I was screwing up the path to the token. I did solder it but the display is quite flickery and it is not super easy to tell what album cover you are looking at. Currently looking into that
Another update! Redid the soldering and it looks gorgeous
@@brycedesabrais2442 Awesome, glad it turned out nice!
what path did you use for your token?
Anybody has an idea if this still works in 2024? I ve tryed it out and always got messages like: This command is depricated. And it is not working by now. Please help
Did you get it to run yet? I'm having some issues as well. Might be my own fault tho.
What are the two white wires on your rgb matrix bonnet as it doesn’t come with those
Is there any way to do this with an image off of your phone? Or a video off of your phone?
Do you have to connect the Pi to a laptop, or does it work via Wifi?
Nope, it just connects to your wifi!
@@rwardtech Thanks! So it should work with a Google Home Speaker?
@@IJuziI Yep it will work as long as the speaker is connected to your spotify account :)
is there any alternative tha would work instead of a rasberypi something that can be aquaried easily ?
wanted to do that with tidal but it doesn't seems to exists any official api ...
Nice project, before I did that with esp32. But now it broke up. I wanna do with raspi zero, can I do without adafruit rgb matrix hat??
Do you ever hit the Spotify api rate limit?
Hi Ryan,
I tried building your project recently and I made it until the last step where I navigate to the web app with the browser, the pi kept refusing to connect (either with the IP or the .local).
Do you have any insights on my problem...?
i have the same problem!
Can i use the RGB Matrix HAT, which you habe used in your first video instead of the bonnet?
Yes, I'm using it right now and it works the same.
Is there a version where I can use a normal Pi 4 and a mini Screen to see the cover (and the Song name) in better quality?
There isn’t a version for this, but that might be a thing in the future!
hey there! i got all the way to the end of the video and for some reason, i am unable to edit the settings on the web app. the web app just isnt popping up for me for some reason. any help would be appreciated!!!!!! :D
Hey Ryan,
This is a great project and I would love to do it. But unfortunately when I try I get this error. ImportError: No module named spotipy. I have tried both on my MacBook and on a raspberry pi and I am getting this error on the both. Do you know why this would be. Thanks James.
I appreciate the kind words about the project! It sounds like you have not installed the spotipy library. In order to fix this simply type "pip install spotipy" in your terminal.
@@rwardtech I'm receiving the same error even though I've installed the library several times using the "pip3 install spotipy" command. All lines show "Requirement already satisfied" and then when I run the "bash generate-token.sh", it shows
"File "python/generateToken.py", line 2, in
import spotipy
ImportError: No module named spotipy"
Do you have any advice for me? Thank you in advance!
@@wesbeights hey Wes! I’ve seen bizarre behavior with that package in the past. I recommend trying to run “python3 -m pip install spotipy” instead. After you run that run “pip3 list” to ensure its installed
@@rwardtech Thank you for the response! I just gave that a try and it came back with "Requirement already satisfied" for all. I then tried "pip3 list" and it gave me this: certifi 2021.10.8
charset-normalizer 2.0.12
distlib 0.3.4
filelock 3.6.0
idna 3.3
pip 22.1.2
platformdirs 2.5.1
requests 2.27.1
setuptools 49.2.1
six 1.15.0
spotipy 2.19.0
urllib3 1.26.9
virtualenv 20.14.0
wheel 0.36.2
what's the SD card for? should i download the rasberry pi software onto it? this is my first time using raspberry pi so which software should i use?
Install Raspberry Pi Imager on your computer, using that you can install the Raspian OS (I think Raspian Buster is recommended) on your SD card
Hey, I have the following problem: When I run the file "bash generate-token.sh
" I get this message "generate-token.sh: line 2: pip: command not found
". After my user name this message: "Traceback (most recent call last):
File "python / generateToken.py", line 2, in
import spotipy
ImportError: No module named spotipy
"
Can you help me?
It works. I have forgot to installed Pyhton. But now: i dont get the Authorization by Spotify.
@@Official_LKS hey, did you solve this problem? Having the same issue
@@EliBlumkin Did you work with Gitforwindows? You will need an extra computer. On this computer, you must load and install the dates from GitHub.
@@Official_LKS I’m working on a Mac, but I have the exact same error
you ever solve the issue? @@EliBlumkin
Does this work via wifi or bluetooth? It needs wifi to know wich song to show right?
It works via wifi. Im hoping in the future I can get it to work using Bluetooth
can you chain these displays together to get a resolution of 128x128 and can you output out to it like a normal display?
That’s a really good question. You definitely could chain them together but would need to modify the source code to support the updated resolution.
@@rwardtech think I'm gonna just bite the bullet get down to some tinkering! Thanks for the video!
Good luck with the build! Let me know how it goes and if I can help with anything.
I'm thinking of doing this so any information on how it went for you would be really appreciated!
Hi,
First of all awesome project :D I already have all the parts and I'm trying to follow your tutorial. but keep getting stuck at the part where you give your username. I'm getting this error
Traceback (most recent call last):
File "python/generateToken.py", line 2, in
import spotipy
ImportError: No module named spotipy
The weird thing is that I did install spotipy. Because every time I try to pip install it says it is already "satisfied". it also shows up in the pip list.
Any idea what this could possibly be?
Thanks in advance :)
creating a virtual environment and using pip to install spotipy in that environment fixed this issue for me.
@@quelpo7695 That did the trick! thank you so much :D
hey, could you explain how you solved this? having the same issue rn
@@PrinceNavy_ just like Monish said. I created a virtual environment and installed all the library’s there. Look up “virtualenv python” to find out how to create one.
Goodluck!
@@daanhobbel4660 thank! What pip command did you use to install when in the environment?
Is it possible to do this with an 128x128 matrix for higher resolution?
Yes it is possible and has been done
Hey there, i love teh idea to see the album cover on a led Panel.
So i ordered the stuff needed and tried for myself.
I went through the whole installation without any obvious errors but when i try to open the cofiguration page in my web browser i can't find the pi.
Could anybody offer some help on that?
i can provide more information if neeeded but i just used the tutorial on a fresh raspbian buster install
Can you connect to the Raspberry Pi via ssh?
@@juliak.2712 yeah all that worked. i'll try again today maybe i just missed something
@@juliak.2712 it worked now. I don't know if i did something wrong several times or if the script got an update. Anyway thanks for yoour help.
I set up everything but the screen still doesn't display anything, the setting page works but just not the matrix, anyone know what might be wrong or a way to test if my rgb matrix is actually working
Join my discord discord.gg/P97DPpfV
Let’s see if we can figure out what’s going on :)
@@rwardtech hey man, could I get an updated link? This is expired?
did you get the issue fixed?
is soldering those pins required?
This is not a requirement, however it will improve the flickering present on the rgb matrix
1:13 what a terrible way to connect your powerleads, why not strip the cable and solder the ends baffles me a bit.
I have a question: Does it make a difference if I use a 64x64 3mm pitch, instead of a 64x64 2.5mm pitch? I wanted to buy the one you use, but it is unfortunately out of stock:(
The 2.5mm will be slightly smaller, as the pitch is the distance between the LEDs. Outputting to the display should be the same.
I just ordered the 2.5mm myself as well 😊
It makes no difference at all :) The pitch just means the space between the each pixel. A smaller pitch means the matrix will be smaller. Where as a larger pitch means the matrix will be bigger. Hope this helps!
Hey there nice video, is there a way to connect this to a battery instead of a wall adapter? Would be really nice to hang it on a wall permanently only having to take it off for charging a rechargeable battery.
This is definitely a possibility however it’s something I have not tested. I would imagine you would need a pretty good battery and would have to charge it pretty often
Can I power it with a micro usb into the the pi