• Stars
    star
    897
  • Rank 50,546 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The software that powers the sPot: a 4th generation "Click Wheel" iPod with a full Spotify client.

sPot

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:

Instructions

  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 https://dtcooper.github.io/raspotify/install.sh | 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 https://github.com/bablokb/pi-btaudio.git
cd pi-btaudio
sudo tools/install
  1. Install PiGPIO
wget https://github.com/joan2937/pigpio/archive/master.zip
unzip master.zip
cd pigpio-master
make
sudo make install
  1. Setup Spotify API

First Create an App at https://developer.spotify.com/dashboard/applications/

https://accounts.spotify.com/authorize?client_id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX&response_type=code&redirect_uri=http%3A%2F%2F127.0.0.1&scope=user-read-playback-state%20user-modify-playback-state%20user-read-currently-playing%20	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)

#!/bin/bash

[[ -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:

#!/bin/sh

# /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 "spotifypod.py" with autostart

sudo nano /etc/xdg/openbox/autostart

and add the following command to launch spotifypod.py:

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

sudo -H -u pi python3 spotifypod.py &

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 spotifypod.py are set( SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET,SPOTIPY_REDIRECT_URI)

export SPOTIPY_CLIENT_ID='your_SPOTIPY_CLIENT_ID'

export SPOTIPY_CLIENT_SECRET='your_SPOTIPY_CLIENT_SECRET'

export SPOTIPY_REDIRECT_URI='your_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 view_model.py with the following at line 16:

#spotify_manager.refresh_devices()

spotify_manager.refresh_data()

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".

DEVICE_TYPE="smartphone"

Wiring

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

Wiring Diagram

More Repositories

1

qr-file-share

Share small files from an offline source using only a QR code
HTML
198
star
2

pov_pong_mouse

Implementation of Pong that runs within a mouse's firmware and renders by moving the cursor fast enough to acheive persistence of vision
C
142
star
3

scopin-sans-typeface

Fully generated typeface that makes text look like it is being viewed as serial data on an oscilloscope
Python
67
star
4

clock_that_is_wrong

CircuitPython powered clock that shows the wrong time when it detects that someone is looking at it
Python
48
star
5

t9-macropad-circuitpython

CircuitPython 'app' to turn a 12-key macropad into a T9 "predictive text" keyboard.
Kotlin
47
star
6

hidden_agenda_pedal

All Project files for the "HIDden Agenda" multi-fx pedal
C++
44
star
7

twitch-plays-max

Control parameters in your Max/MSP patches (or Ableton M4L) via Twitch Chat
Max
29
star
8

simple-cast

A barebones Android application for playing arbitrary audio streams through your Chromecast/Google Cast enabled devices.
Kotlin
18
star
9

roli-blocks-melodic-bounce

Melodic Bouncing Ball patch for the ROLI Lightpad Block
14
star
10

a-la-qrte

Portable scanner/printer that turns QR code menus into physical copies.
Python
14
star
11

homebrew-hitclips

Hardware/Firmware/CAD files for a DIY HitClips cartridge
C
10
star
12

AutotuneKazoo

Software/Circuit info for my kazoo with built-in autotune (and MIDI control!!)
C++
7
star
13

dial_toner

Hardware/Software for The Dial Toner: a mechanical hex color picker.
Python
7
star
14

android-blink-scroll

Android AccessibilityService that performs gestures on behalf of the user whenever they blink their eyes.
Kotlin
6
star
15

itp-gifts-workshop

Step-by-step guide for building a simple "gift" using CircuitPython & Val Town
Python
5
star
16

mpe-kt

Kotlin implementation of the MIDI Polyphonic Expression spec. Use in your Java, Kotlin, and JS projects to parse and generate MPE messages.
Kotlin
4
star
17

strange-phone-circuitpython

CircuitPython firmware for an interactive prop phone
Python
4
star
18

midi_twister_mat

Converting an old Twister mat into a full MIDI controller
C++
3
star
19

ch559-circuitpython

CircuitPython library for the CH559 USB to Serial chip
Python
3
star
20

hotclasps-cartridge

HotClasps - a HitClips compatible audio cartridge
Python
3
star
21

person-sensor-circuitpython

CircuitPython driver for the Person Sensor by Useful Sensors
Python
3
star
22

pro_tools_iot_sync

Python App to sync your smart lights/socket/whatever with Pro Tools' recording state.
Python
2
star
23

hc-webapp

Kotlin web app to support the HotClasps (open source, HitClips-compatible cartridges) project.
Kotlin
1
star
24

remoticon-2020-max-workshop

Hackaday Remoticon 2020 Workshop: Prototyping to the Max
Max
1
star
25

keynote-visualizer-replica

All hardware/firmware/design assets for my Wurlitzer Key Note Visualizer replica
OpenSCAD
1
star