-
1Step 1
Burn image and boot up
Use the image supplied by Kookye so you have their drivers.
-
2Step 2
SSH into the Pi
Use Putty or whatever to SSH into the Pi. The Kookye image uses the default Raspbian login.
User: pi
Password: raspberry
-
3Step 3
Run updates
First run: sudo apt-get update
Next, you have to lock in the Raspbian kernel so it doesn't update. If it does update, you lose the touchscreen drivers.
Run: sudo apt-mark hold raspberrypi-kernel
Then run: sudo apt-get upgrade
-
4Step 4
Basic config
Run: sudo raspi-config
Now you can change the hostname to give your Pi Player a name.
After that, I always resize the filesystem to make sure I'm using all of the SD card I can.
Now reboot and SSH into the Pi again.
-
5Step 5
Install and configure MPD and MPC
I used MPD and MPC to organize and play the audio. Here's how I did it.
Run: sudo apt-get install mpd mpc
Once that's installed, it's time to configure. Make sure the audio adapter is plugged in then, using nano or vim or whatever, edit .asoundrc in the home directory. I edited the file to look like this:
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
That tells the Pi which audio device to use. Your device might not be on card 1. Mine was.
You might want to edit the config file for MPD. Edit /etc/mpd.conf and change the location of music_directory if you want. I moved it into the home directory so I can create a samba share. That will let me upload music files easily.
I didn't touch anything else in that config file.
-
6Step 6
Testing time
I like to do things in steps. So once I got to this point I downloaded an mp3 file to the music directory. Next I updated the database for MPD.
Run: mpc update
Then run: mpc ls | mpc add
That will add all files into the playlist. Now plug in some headphones or speakers and be ready to test it.
Run: mpc play
You should hear music at this point.
-
7Step 7
Install Apache and PHP
For the UI, we will be using a webpage, served locally, that calls a PHP script to control the player. That means we need to install Apache and PHP.
Run: sudo apt-get install apache2
Then run: sudo apt-get install php5 libapache2-mod-php5
-
8Step 8
Automate kiosk mode
We want this so once the Pi boots up, it goes full screen to the player interface. We need a couple of little programs to help with that. First we install XAutomation, then Unclutter.
Run: sudo apt-get install xautomation
Next run: sudo apt-get install unclutter
Once installed, we can set up a script to clean things up. Go to ~/.config/lxsession/LXDE-pi/ and edit or create a file called autostart. It should look like this:
@xset s off
@xset -dpms
@unclutter -idle 0.1 -root
@start_kiosk.sh
Now create a file in /usr/bin/ called start_kiosk.sh and add the following:
#!/bin/sh
epiphany-browser -a --profile /home/pi/.config http://localhost &
sleep 10s
echo key F11 | xte
That set of commands launches the browser and opens the page found at localhost (/var/www/html), then it waits 10 seconds and presses the F11 key to send it into kiosk mode.
Lastly, you need to change permissions on that shell script.
Run: sudo chmod +x /usr/bin/start_kiosk.sh
Now reboot and see the default page launch.
Next up is to create the interface.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.