The goal of this project is to provide a shared music playing device where songs can be choosen from a user quickly and easily.
DJPi is designed to be easily duplicatable. Following a few steps should allow you to build your own DJPi instance
- Deploy DJPi-GAE server code to a Google App Engine instance (You must register and create your own)
- Modify base url in project to match your specific app engine url. Example: XXXXX.appspot.com
- Start DJPi-Pi code on Raspberry Pi with options
python2 djpi.py -u spotify.email@domain.com -p passwordForSpotifyAccount -n titleOfThisPlayer
to register player - Build and run iOS app to add/remove songs from a player's queue (Don't forget about your appkey.h)
- Relax and enjoy the music!
##API Full Documentation of the DJPi API is available at http://docs.djpiapiv1.apiary.io
This project uses two submodules (AFNetworking & CocoaLibSpotify)
-
On inital clone use
git clone --recursive https://github.com/cvanderschuere/DJPi.git
to also clone the submodules -
If you do not have the '--recursive' option:
-
git clone https://github.com/cvanderschuere/DJPi.git && cd DJPi && git submodule init && git submodule update
-
If you have already cloned the repo, you can use
git submodule --init
to achieve the same effect
All the source files are provided for creating the necessary server instance. To run in your own project you should create your own app engine account. This will give you a new base URL that will require changes to:
- iOS Source URL
- Pi Source URL
- API Documentation (Optional
Building the player is written with a Raspberry Pi and Arch Linux in mind, but this setup should be fairly easily duplicatable on other hardward running another variant of Linux.
- Download Arch Linux-arm6hf via torrent file
- DD image to SD card (Steps to do this can be found at
- SSH into pi with user:root password:root
- Install necessary dependencies: 'pacman -S git glibc alsa-lib clang'
- Copy latest libspotify from http://developer.spotify.com to home directory
- Run 'make prefix=/usr install'
- Test pkg export with 'pkg-config --print-provides libspotify' (Should output that library found with correct version number)
- Clone this repo to /home 'git -r clone https://github.com/cvanderschuere/DJPi.git'
- If you do not have the '-r' option:
git clone https://github.com/cvanderschuere/DJPi.git && cd DJPi && git submodule init && git submodule update
- Init pyspotify library 'python2 setup.py install'
- Download Spotify app keys from http://developer.spotify.com
- Raspberry-Pi: Download binary key and place in DJPi-RaspberryPi/ (Should be named spotify_appkey.key)
- iOS: Copy c code into a file appkey.h and place in DJPi-iOS/
Spotify is used as music source and search engine for DJPi.
In order to build DJPi you need to follow a couple steps:
- Create, or use an existing, Spotify Premium account that is enabled for development
- Download the appkey.c (renamed appkey.h in DJPi) from http://developer.spotify.com
- Include appkey.h to iOS and Raspberry Pi project where appropriate (These two pieces will not compile without one)
###iOS
- Searching for Artists/Albums/Tracks
- Converting track to URL that can later be played on the Pi
###Raspberry Pi
- Plays spotify URLS