This page describes all setup steps I preformed on RaspberryPi to set it up as a SlideMusic Server
DHCP allocation
Setup my router to allocate a constant ip (192.168.1.180)
Pi User Password Change
ssh pi@192.168.1.180
default password (Raspberry)
Use passwd command to change password.
Disable X-Screen Blanking
-
sudo nano /etc/X11/xinit/xinitrc
Add this at the START of the file
-
#Added by RJM
-
xset s off # don't activate screensaver
-
xset -dpms # disable DPMS (Energy Star) features.
-
xset s noblank # don't blank the video device
-
sudo reboot
Add shared drives
First add user and group
This also makes the user Pi a member of share group so it can see the files:
-
sudo adduser shareuser
-
sudo addgroup sharegroup
-
sudo addgroup pi sharegroup
-
id pi
The last command id pi lists thr groups the user pi is a member of. Check that sharegroup is there in the list
Create Network folder and add credential files
-
mkdir /home/pi/network
-
cd /home/pi/network
-
sudo mkdir DropboxFol
-
sudo chown shareuser DropboxFol
-
sudo chgrp sharegroup DropboxFol
-
sudo echo username=Robert > DropboxFol.credentials
-
sudo chmod a-r DropboxFol.credentials
-
sudo chmod g-r DropboxFol.credentials
-
sudo chown root DropboxFol.credentials
-
sudo chgrp root DropboxFol.credentials
-
sudo mkdir robertsmedia
-
sudo chown shareuser robertsmedia
-
sudo chgrp sharegroup robertsmedia
-
sudo echo username=Robert > robertsmedia.credentials
-
sudo chmod a-r robertsmedia.credentials
-
sudo chmod g-r robertsmedia.credentials
-
sudo chown root robertsmedia.credentials
-
sudo chgrp root robertsmedia.credentials
Add the password to the credentials files:
-
sudo nano DropboxFol.credentials
-
username=Robert
-
password=XXX
Create map script
Create a file
-
sudo nano /etc/init.d/rjmnetmnt
-
#!/bin/sh
-
-
#
-
#Check the input paramaters are correct
-
#
-
if [ $# != 1 ]
-
then
-
echo "ERROR - Must supply one paramater"
-
exit 1
-
fi
-
-
parm_ok=0
-
for X in "start" "stop"
-
do
-
if [ ${X} = ${1} ]
-
then
-
parm_ok=1
-
fi
-
done
-
-
if [ ${parm_ok} = 0 ]
-
then
-
echo "Parameter 1 is not set correctly"
-
echo "It should be start or stop only"
-
exit 1
-
fi
-
-
if [ $1 = "start" ]
-
then
-
mount -t cifs //192.168.1.160/robertsmedia /home/pi/network/robertsmedia -o credentials=/home/pi/network/robertsmedia.credentials,uid=shareuser,gid=sharegroup
-
mount -t cifs //192.168.1.151/DropboxFol /home/pi/network/DropboxFol -o credentials=/home/pi/network/DropboxFol.credentials,uid=shareuser,gid=sharegroup
-
fi
-
-
if [ $1 = "stop" ]
-
then
-
umount /home/pi/network/robertsmedia
-
umount /home/pi/network/DropboxFol
-
fi
-
-
echo "DONE"
-
sudo chmod +x rjmnetmnt
Test it:
-
sudo /etc/init.d/rjmnetmnt start
-
ls /home/pi/network/DropboxFol
Set it for startup
-
sudo update-rc.d rjmnetmnt defaults
Restart and test again!
Change memory split
top line before I did split
-
KiB Mem: 448736 total, 163088 used, 285648 free, 13768 buffers
-
KiB Swap: 102396 total, 0 used, 102396 free, 95008 cached
Split to 128/128 for hight graphics
-
sudo raspi-config
(Goto advanced - ESC to exit then sudo reboot)
top line after I did split
-
KiB Mem: 383712 total, 115956 used, 267756 free, 10824 buffers
-
KiB Swap: 102396 total, 0 used, 102396 free, 56416 cached
Setup Java 8 Early Access
Goto https://jdk8.java.net/download.html
Choose Linux ARMv6/7 VFP, HardFP ABI
copy this file to
/home/pi
-
sudo tar -zxvf file_name -C /opt
-
sudo /opt/jdk1.8.0/bin/java -version
Setup SlideMusic java program
-
mkdir /home/pi/SlideMusic
Create file
/home/pi/SlideMusic/getLatest.sh as
-
DPDIR=/home/pi/network/DropboxFol
-
INSTDIR=/home/pi/SlideMusic
-
cp ${DPDIR}/Projects/SlideMusic/SlideMusicServer/deploy/SlideMusicServer.jar ${INSTDIR}/SlideMusicServer.jar
-
cp ${DPDIR}/Projects/java_libs/metadata-extractor-2.6.4/metadata-extractor-2.6.4.jar ${INSTDIR}/metadata-extractor-2.6.4.jar
-
cp ${DPDIR}/Projects/java_libs/metadata-extractor-2.6.4/xmpcore.jar ${INSTDIR}/xmpcore.jar
-
cp ${DPDIR}/Projects/java_libs/sqlite-jdbc-3.7.2.jar ${INSTDIR}/sqlite-jdbc-3.7.2.jar
/home/pi/SlideMusic/Server.sh as
-
HDIR=/home/pi/SlideMusic
-
CP=${HDIR}/SlideMusicServer.jar
-
CP=${CP}:${HDIR}/sqlite-jdbc-3.7.2.jar
-
CP=${CP}:${HDIR}/metadata-extractor-2.6.4.jar
-
CP=${CP}:${HDIR}/xmpcore.jar
-
-
java -cp ${CP} metcarob.com.slidemusic.server.MainApp ${HDIR}/SlideMusicServer.settings ${1} ${2} ${3} ${4} ${5}
/home/pi/SlideMusic/Client.sh as
-
HDIR=/home/pi/SlideMusic
-
CP=${HDIR}/SlideMusicServer.jar
-
CP=${CP}:${HDIR}/sqlite-jdbc-3.7.2.jar
-
CP=${CP}:${HDIR}/metadata-extractor-2.6.4.jar
-
CP=${CP}:${HDIR}/xmpcore.jar
-
-
java -cp ${CP} metcarob.com.slidemusic.client.MainApp ${1} ${2} ${3} ${4} ${5}
Make executable and install
-
cd /home/pi/SlideMusic
-
sudo chmod +x *.sh
-
./getLatest.sh
ls and check jar files have copied.
Now run slide music and check if it runs
Set display variable before running scripts
This needs to be done from SSH termnials
-
export DISPLAY=:0