This code is meant to accompany this project in which a Spotify client is built into an iPod "Classic" from 2004. Everything is meant to run on a Raspberry Pi Zero W.

Since we are using the lite version of raspbian, some extra packages need to be installed:


  1. Install updates
sudo apt-get update 
sudo apt-get upgrade
  1. Install Required Packages.

Installation for python3-pip, raspotify, python3-tk, openbox

sudo apt install python-setuptools python3-setuptools

sudo apt install python3-pip

sudo curl -sL | sh

sudo apt-get install python3-tk 

sudo apt-get install redis-server

sudo apt-get install openbox

sudo apt install xorg

sudo apt-get install lightdm

sudo apt-get install x11-xserver-utils

  1. Install Dependencies
pip3 install -r requirements.txt
  1. Install pi-btaudio
git clone
cd pi-btaudio
sudo tools/install
  1. Install PiGPIO
cd pigpio-master
sudo make install
  1. Setup Spotify API

First Create an App at	app-remote-control%20streaming%20playlist-modify-public%20playlist-modify-private%20playlist-read-private%20playlist-read-collaborative
  1. raspi-config

sudo raspi-config

Console Autologin

Display Option -> Screen Blanking -> Off if you want to avoid the screen turning black after a few seconds.

  1. bash_profile

In .bash_profile added the following (if the file is not htere, you must create it)


[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor

# Disable any form of screen saver / screen blanking / power management

xset s off

xset s noblank
  1. Configure xinitrc

sudo nano /etc/X11/xinit/xinitrc

Inside, make sure the following is there:


# /etc/X11/xinit/xinitrc

# global xinitrc file, used by all X sessions started by xinit (startx)

# invoke global X session script

#. /etc/X11/Xsession

exec openbox-session #-> This is the one that launches Openbox ;)
  1. Run "" with autostart

sudo nano /etc/xdg/openbox/autostart

and add the following command to launch

cd /home/pi/fork/retro-ipod-spotify-client/frontend/

sudo -H -u pi python3 &

sudo /home/pi/fork/retro-ipod-spotify-client/clickwheel/click &

Make sure that the paths are ok with your setup!!

in sudo nano /etc/xdg/openbox/environment all the variables needed to run are set( SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET,SPOTIPY_REDIRECT_URI)



  1. Synchronizing Spotify data!
    Last but not least, if you want to make sure all your playlists artists, etc are synchronized every time you turn on your Spotypod, you can simply modify the script with the following at line 16:



instead of calling refresh_device, you can execute refresh_data. This will sync all your data and then will eceute refresh.devices. This will make the boot up way slower! but it will synchronize every single time you switch on :).
If you dont run at least once refresh_data() no playlist, artist or anything related with your account will be displayed!

  1. Configure Raspotify

sudo nano /etc/default/raspotify

Uncomment and fill the following line:

OPTIONS="--username <USERNAME> --password <PASSWORD>"

And maybe you want also to consider the following:

# The displayed device type in Spotify clients. 

# Can be "unknown", "computer", "tablet", "smartphone", "speaker", "tv",

# "avr" (Audio/Video Receiver), "stb" (Set-Top Box), and "audiodongle".



Here is the wiring of the hardware, as of revision 1. Note that the pin numbers correlate to those referenced in click.c