Close
0%
0%

sPot: Spotify in a 4th-gen iPod (2004)

Full-on Spotify scrolling and streaming via a Raspberry Pi Zero W and the original iPod clickwheel. Bluetooth, WiFi, and haptic feedback!!

Similar projects worth following
My mother-in-law recently gifted me a bag of the family's retired iPods. I had forgotten how good it feels to hold and use one of these things. Naturally, I decided to modify one. I wanted to supply some modern features (streaming, search, Bluetooth audio, etc), while paying homage to the amazing UX that Apple originally released almost 20 years ago.

Fast forward a few months - here's the sPot (ess-pot)! We've got:
* Streaming/Search via Spotify.
* Scratch-built UI, written in Python, based on the OG iPod experience.
* Full control via the original "click wheel".
* Haptic feedback.
* Micro-USB port for charging.
*... Linux, because there's a Raspberry Pi inside.



Hardware overview:

* Power is provided by a standard rechargeable li-ion battery. It's charged through a 500 ma Adafruit USB charger, and boosted to 5V using the Adafruit PowerBoost Basic. Both the Raspberry Pi and the display run on 5V.
* The click wheel connected to the original iPod motherboard via an 8 pin FPC cable. Thanks to this 10-year-old Hackaday article (and accompanying blog post by Jason Garr , I was able to find the pinout. Using an FPC breakout board, I easily connected the click wheel controller's 3.3V, GND, Data, and Clock lines directly to the Raspberry Pi. (More on this in the software overview).
* I used one of the Raspberry Pi's GPIO pins to drive a small DC motor (through a transistor, of course) for haptic feedback. I use quick haptic pulses in place of the iPod's original click sound, which triggers as your finger crosses each of the click wheel's virtual "steps".

* Repurposed the iPod's original lock switch to control the device's power. Conveniently, the PowerBoost module has an "enable" pin that can simply be pulled low to cut all power.

* Connected the display directly to 5V and the Pi's composite video output!




Software:

* I installed Raspberry Pi OS Lite as my OS. I figured I'd be conservative by not installing a full desktop environment, not sure if that was actually necessary in retrospect. The Pi Zero is more capable than I originally figured.
* Streaming from Spotify was surprisingly simple. I installed Raspotify, which just runs as a daemon and handles everything once you've authenticated. When it's running, the Pi appears as a "Spotify Connect" device on your account, and you can instruct it to takeover playback via an HTTP request (or using the UI of another authenticated Spotify client!).
* I used the Spotipy Python library to authenticate, search Spotify's catalog, fetch my saved artists/albums/playlists, and send playback commands to Spotify's servers.
* I wrote the UI as a Python application using tkinter. It was honestly pretty great to work with - front-end frameworks are hard to pick up! And this project was the first time I put any real effort into learning (and trying to love) Python. Forgive me, I spend most of my time in JVM-land.
* Referencing Jason Garr's blog post, I wrote a C program to the bitbang the click wheel's serial data into the Pi. I used pigpio to control the GPIO pins. Once I parse out the button presses and finger position, I send the data to the UI application via UDP. Jason - THANK you, wherever you are. This project would have been nothing without the original click wheel, and I would not have been brave enough to try to figure out the pinout myself. I will - hopefully - on future projects.
* ^ I snuck the haptic control into the C program that reads the click wheel. When the user's finger position changes, I quickly pulse the GPIO pin that's hooked up to the haptic motor. This was super easy, but the downside is that the haptics don't sync perfectly with the UI. For example, if you reach the bottom of a list, the haptics will continue even when the scrolling stops. It syncs perfectly while actively scrolling, so I didn't think it was worth changing.
* I use Redis (via Python library) to persist/cache user's Spotify data.
* I use Openbox to host the UI Application, which starts automatically once the PI boots up.
* I use pi-btaudio to get Bluetooth audio out of the Pi.

All of my source code will eventually be available here.


iPod-Spotify client UI running on Desktop
I was able to develop the UI entirely on my MacBook! Only had to optimize a tiny bit when I migrated to the Pi.
Earlier in the build: Haptic motor too big. Battery too small. Sketchy charge/boost module. Tried using a transistor to switch all power, but it kept cutting out.
These screens are adorable. Not bad image for composite input, either!
The "Now Playing" screen

Issues / TODOs:
* At some point the Pi started emitting a high-pitch whine. Big spike at 16khz and a little something at 8khz. What could this be? Doesn't bother me too much...

Read more »

View all 10 components

View all 3 project logs

Enjoy this project?

Share

Discussions

nassafellow wrote 03/25/2021 at 09:17 point

Guy could you please update the components list and schematics for the new build please?  I am merging your design with Ricardo's build and I am stuck on the internals.  

Thanksl

  Are you sure? yes | no

jamietchisholm wrote 03/22/2021 at 00:02 point

Here's my openbox screenshots! thank you! https://drive.google.com/drive/folders/1mtY5qQvxN93nGYmGw7KHVlXaBoLvyQJi?usp=sharing

  Are you sure? yes | no

jamietchisholm wrote 03/21/2021 at 23:59 point

Hi guys! So I'm stuck on openbox. When I turn the PI on i can see it in my spotify devices. Can't connect to it. Bellow I'll add Openbox windows. Xinitric, autostart, openbox environment, and raspotify. When I log into the pi through VNC I see a blank screen and my cursor is an "X".. I assume this means that raspotify is trying to open.. 

Any help would be greatly appreciated! I'm so close! Would love to see someone else's openbox settings. Thank you Guy and everyone involved! This is so awesome. :)





  Are you sure? yes | no

Junaldinho wrote 03/21/2021 at 22:24 point

Hi Guys,

Ive been at this project for weeks, I have never coded before so this is all new to me.

I am stuck on step 9, for some reason I can't get Openbox to open up to be able to input the code and move onto the next step.

when I input - exec openbox-session - it doesn't do anything.

Any help would be much appreciated. (or a step by step guide at this point its been weeks)

Thanks

J

  Are you sure? yes | no

nassafellow wrote 03/21/2021 at 21:18 point

Please could you decline my request to join the team I am new here and I don't know how this site works.  I thought it would simply provide me with more information, so sorry please forgive me!

  Are you sure? yes | no

nassafellow wrote 03/21/2021 at 21:16 point

I would like to introduce myself to everyone here saying I am a science teacher (chemistry specialist) who has been asked to teach electronics.  I want to do something to inspire my students.  I have a very basic knowledge of the theory of electronics and I am still learning that.  I know pretty much nothing about the practical aspects, although I have every practical resource available to me and an entire lab at my disposal.  I desperately need to and want to learn.  I know nothing whatsoever about coding but I've got a computer science teacher who may be open to helping me.  I also have access to chemicals and an expensive 3D printer.

Three questions - I'm unsure if this issue is resolved yet.  1) Is the issue where we can't put in numbers into search solved yet?  2) Do you have to open the ipod up again if you want to change the wifi network?  If not I'm thinking I might have to ask a computer science teacher to take a look at the coding.

  Are you sure? yes | no

jamietchisholm wrote 03/19/2021 at 23:33 point

Hi guys! I'm stuck on step 3 with installing "dependencies". I type in the command and get a message saying "Could not open requirements files: [errno 2] No such file or directory: requirments.txt'

Forgive me if this is a simple fix! Also, I couldn't figure out how to access the PI through OpenBoc so I used VNC Viewer and can access the PI's interface there.

I assume I'm getting this error because I have the GitHub folder in the wrong spot? I'm not sure how to utilize that folder into the PI.  Every command before step 3 worked great!

Thank you guys so much for the support! Looking forward to this project :)

  Are you sure? yes | no

sebakitzing wrote 03/20/2021 at 13:17 point

@jamietchisholm go to the github issue #22. I explain that part there

  Are you sure? yes | no

chonnymon wrote 03/19/2021 at 21:46 point

Thanks again for sharing this project.

I finally finished mine tonight! thanks to everyone who has posted on the GitHub especially @Guy Dupont  & @Ricardo Sappia.

My biggest headache was getting everything to fit in and then getting the iPod closed back up. I found that if it was too tight the iPod buttons would be really 'stiff'

I ended up replacing the boost module and charger for the combined unit from adafruit and hard-wiring the battery to the charger to save a little bit of space.

If it helps anyone i 3d printed a mount for the 2" adafruit display you can use the original iPod screws and holes.

here mine https://imgur.com/a/76l3HG6


and screen mount https://www.thingiverse.com/thing:4799740

  Are you sure? yes | no

Guy Dupont wrote 03/19/2021 at 22:06 point

Looks awesome!!! I'm loving hearing about folks' alterations.

  Are you sure? yes | no

thatturkeyistaken wrote 05/28/2021 at 02:34 point

hey, you think you could share the software as a whole? I'm having problems coding and it would probably be easier to just use someone else's and configure it to work for me

  Are you sure? yes | no

Fernando wrote 03/18/2021 at 22:02 point

Love this project!! I already have the same iPod on my desk just collecting dust hahahah. I have a question does someone know if I could use this power booster that I found in aliexpress?? (https://www.aliexpress.com/item/32655610003.html?spm=a2g0o.productlist.0.0.74e82cf4Vcdp1T&algo_pvid=4bfceab2-b6ba-422e-979f-5364f7ef462d&algo_expid=4bfceab2-b6ba-422e-979f-5364f7ef462d-31&btsid=0bb0623d16161038842773452e4191&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_).

Any answer is well recived, thanks!

Regards from Chile!

  Are you sure? yes | no

Ricardo Sappia wrote 03/19/2021 at 08:44 point

en principio si, por  lado de la corriente no deberia ser problema porque el total de los módulos consume aproximadamente un promedio de 275mA, pero te faltarían algunas funciones en caso de que quieras apagar el iPod desde la raspberry, por ejemplo, el pin de EN. Por otro lado,  este módulo solo hace de powerboost pero no carga la bateria, para eso deberias agregar otro modulo mas. 

  Are you sure? yes | no

sebakitzing wrote 03/20/2021 at 13:21 point

@Ricardo Sappia tu ya lo hiciste funcionar? Yo tengo todo listo, cargo al frontend, pero corté el cable del clickwheel asique estoy esperando para ver si me funciona esa parte del programa

  Are you sure? yes | no

Ricardo Sappia wrote 03/20/2021 at 13:35 point

@sebakitzing  si! lo tebgo andando y cerrado ya, escribi un tutorial del hardware tambien! http://rsflightronics.com/spotifypod

  Are you sure? yes | no

xvartframtid wrote 03/18/2021 at 10:47 point

Question - will this work on a 6th generation ipod classic 160 gb as well? I've got an old one kicking around that I recently rehabilitated, but I am so used to spotify now that I have trouble using it and want to try my hand at some raspberry pi/soldering challenges. I believe they are the same size..

  Are you sure? yes | no

dave wrote 03/13/2021 at 08:58 point

I suceeded in getting Spot to work on my Desktop using spocon instead of raspotify but it only works after I activate my device through the spotify app ("connect spotify connect") otherwise it says "no device found". I would like to have my app work without booting Spotify app. Any ideas?

  Are you sure? yes | no

Guy Dupont wrote 03/11/2021 at 13:40 point

Head's up: looks like the displays are back in stock at Adafruit!

  Are you sure? yes | no

Ricardo Sappia wrote 03/11/2021 at 20:40 point

I found something similar in Aliexpress... maybe with some adaptions it could be an option!

AUO 2‘’ inch LCD display /2.0 LCD module /A020CN01.V1 display module (Drive board is 12V voltage)

https://a.aliexpress.com/_uHsH7f

  Are you sure? yes | no

Sean wrote 03/11/2021 at 23:59 point

I'm impressed with your LCD display implementation @Ricardo Sappia! Looking at your wiring for haptics, what is the purpose of the 1N4148 diode over the + and - of the haptic vibration motor?

  Are you sure? yes | no

Ricardo Sappia wrote 03/18/2021 at 15:27 point

@Sean i updated the post ;)

  Are you sure? yes | no

Sean wrote 03/08/2021 at 01:27 point

I have the software running nicely on my PC, and have just finished a test run connecting the Pi Zero, Boost module, Charge module and the 2.0" TFT display. Making steady progress... I posted some pics and a video of the initial display testing here: https://www.shogan.co.uk/builds/tiny-2-tft-composite-video-on-raspberry-pi-zero/

  Are you sure? yes | no

sonicspeed.opusone wrote 03/06/2021 at 12:16 point

Can any one please help me, I'm stuck with step 3. in the github repo page.

pip3 install -r requirements.txt

returns: No such file or directory

Thank you

  Are you sure? yes | no

sebakitzing wrote 03/06/2021 at 12:53 point

I explain that part here https://github.com/dupontgu/retro-ipod-spotify-client/issues/22

  Are you sure? yes | no

Sean wrote 03/08/2021 at 01:29 point

Are you doing that in the frontend directory? That is where requirements.txt is located. Also make sure you have python3 and pip3 installed and configured on your system path.

  Are you sure? yes | no

zburhop wrote 03/04/2021 at 14:16 point

Has anyone got it to run. I’ve reinstalled a few times and it boots to a black screen. (Screen works during setup and boot. The Ui is the problem)No interface at all. The underlying stuff works fine. It seems to be the UI that’s jacked. Any ideas

  Are you sure? yes | no

sebakitzing wrote 03/04/2021 at 20:33 point

I will upload to Git later today what I've got to make run and what I'm having issues with...

  Are you sure? yes | no

sebakitzing wrote 03/06/2021 at 04:06 point

I just uploaded my code to the GitHub Issues section it is #22

  Are you sure? yes | no

Matt wrote 09/07/2021 at 04:24 point

Hi, I've read through your Git issue and it sounds similar to mine.

I boot and get a black screen, if I SSH in I get the error xset: unable to open display ""

If I manually run spotifypod.py it works just fine, the issue is trying to do all this automatically on startup.

Were you ever successful in fixing this issue?

Thanks!

  Are you sure? yes | no

Phil Karza wrote 03/03/2021 at 02:05 point

Any progress on forking this to become a media player?  I would gladly donate with patreon - do you have a patreon account?

  Are you sure? yes | no

zburhop wrote 03/03/2021 at 11:51 point

What kind of media player?  How would that be different from what it is?  Are you talking about video?

  Are you sure? yes | no

Craig Hissett wrote 03/03/2021 at 14:11 point

Yeah this is pretty much any kind of player you could ever need. You'd just need to create some python scripts to handle whatever you're needing to play.

  Are you sure? yes | no

zburhop wrote 03/01/2021 at 11:50 point

I installed spotipy from github in the "fork" directly as the paths show.  However it does not boot autostart.  When I manually try to run it I get this error. any ideas?

pi@raspberrypi:~ $ cd fork
pi@raspberrypi:~/fork $ ls
retro-ipod-spotify-client
pi@raspberrypi:~/fork $ cd /home/pi/fork/retro-ipod-spotify-client/frontend/
pi@raspberrypi:~/fork/retro-ipod-spotify-client/frontend $ sudo -H -u pi python3 spotifypod.py &
[1] 3577
pi@raspberrypi:~/fork/retro-ipod-spotify-client/frontend $ Traceback (most recent call last):
  File "spotifypod.py", line 12, in <module>
    from view_model import *
  File "/home/pi/fork/retro-ipod-spotify-client/frontend/view_model.py", line 1, in <module>
    import spotify_manager
  File "/home/pi/fork/retro-ipod-spotify-client/frontend/spotify_manager.py", line 1, in <module>
    import spotipy
ModuleNotFoundError: No module named 'spotipy'

  Are you sure? yes | no

sebakitzing wrote 03/06/2021 at 12:55 point

have you tried just running:

pi@raspberrypi:~/fork/retro-ipod-spotify-client/frontend python3 spotifypod.py

That's the way I got it to work

  Are you sure? yes | no

sebakitzing wrote 02/26/2021 at 03:42 point

Has anyone made the software run? I still have no screen, but I was able to se the device on 'Spotify devices', then I went to configure the BT as it was shown on pi-btaudio and the device dissapeared from Spotify...

  Are you sure? yes | no

zburhop wrote 02/26/2021 at 07:18 point

I haven't even got that far. Mind if i ask you some questions?

  Are you sure? yes | no

zburhop wrote 02/26/2021 at 07:20 point

Also good call on checking spotify.  My device only boots up to the command line......but it does show up when I select devices on my desktop computers spotify.If i select it it says connecting but ignores the request and continues where it was playing before.   When i turn the raspberry pi off it dissappears from the list.

  Are you sure? yes | no

sebakitzing wrote 02/26/2021 at 12:57 point

@zburhop  I just followed the instructions and got as far as you are telling me, command line and showing on spotify devices. I was able to get a connection twice but got no audio aout from hdmi, so then I followed pi-btaudio instructions to get BT headphones connected and it never showed again on the list.

  Are you sure? yes | no

zburhop wrote 02/25/2021 at 13:20 point

I made this Fritzing wiring diagram the other night.  Its how I wired my ipod up.  In case anyone finds it useful.

https://ibb.co/7tVtXK5

  Are you sure? yes | no

ethanheiss wrote 02/26/2021 at 02:09 point

Very dumb noob question but what gauge wire did you use?

  Are you sure? yes | no

zburhop wrote 02/26/2021 at 04:02 point

I used this wire. It’s my favorite. It’s silicone sleeved and 24awg it’s nice and flexible when your trying to squeeze this all together.


https://www.amazon.com/StrivedayTMFlexible-Silicone-Electric-electronic-electrics/dp/B01LH1G2IE/ref=mp_s_a_1_3?dchild=1&keywords=silicone+wire&qid=1614311006&sr=8-3

  Are you sure? yes | no

zburhop wrote 02/24/2021 at 12:41 point

Has anyone got the software to run?  Mine boots to command line and nothing else.  I've added all of the nessicary auto start stuff.  Been over it with a fine tooth comb.... nothing pops out.

  Are you sure? yes | no

sebakitzing wrote 02/25/2021 at 05:52 point

Same is happening to me. Im connected to the monitor, not the 2" screen... But I've done everything twice anda checked everything

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates