I have written these instructions to set up Moode. Thanks go to Tim Curtis for his wonderful distribution. I am not good with formatting the instructions so perhaps someone better than me could do this in another post. Hope I haven't made any typos as it works for me.
Step 1 - Write image
Download Moode 2.7 and write it to your sdcard based on your preferred method.
Step 2 - Boot and login
Boot Moode and ssh into it as follows:
ssh
pi@moode.local
password: raspberry
Step 3 - Get the files for the display
I didn't work this out. Thanks go to Dhrone and his Github page:
https://github.com/dhrone/Raspdac-Display" onclick="window.open(this.href);return false;
To get the display going run these commands:
wget
https://raw.githubusercontent.com/dhron ... Display.py" onclick="window.open(this.href);return false;
wget
https://raw.githubusercontent.com/dhron ... hicOLED.py" onclick="window.open(this.href);return false;
You also need a pages.py. Either download from dhrone or use mine below.
wget
https://www.dropbox.com/s/x8c1zn2rn9tfupf/pages.py" onclick="window.open(this.href);return false;
If you use my pages, also use my version of RaspDacDisplay.py For some reason, the latest one isn't working with my pages.py
wget
https://www.dropbox.com/s/hvwtv75n1odys ... Display.py" onclick="window.open(this.href);return false;
I then edit RaspDacDisplay.py to have my local timezone and change the animation speed from .08 to .24 in the 2 places it appears. I normally then set song title to about 24 seconds and artist to 4 seconds. Now going on:
sudo apt-get update
sudo apt-get install python-setuptools
sudo easy_install pip
sudo pip install moment
sudo pip install pylms
sudo pip install python-mpd2
Step 4 - Setup the power button scripts
cd /var/www/command/
sudo mkdir scripts
cd scripts
sudo nano power_button
Now add the following text:
#!/bin/bash
PATH=/bin:/usr/bin:/usr/bin/gpio
echo "Audiophonics Shutdown script starting..."
echo "Asserting pins : "
echo "ShutDown : GPIO17=in, Low"
echo "BootOK : GPIO22=out, High"
gpio -g mode 17 in
gpio -g write 17 0
gpio -g mode 22 out
gpio -g write 22 1
while [ 1 ]; do
if [ "$(/usr/bin/gpio -g read 17)" = "1" ]; then
echo "ShutDown order received, RaspBerry pi will now enter in standby mode..."
systemctl poweroff
break
fi
/bin/sleep 0.25
done
exit 0
Save that file then keep going.
sudo nano power_manager
Now add the following text:
#!/bin/bash
if [[ $1 == "poweroff" ]]
then
echo "power off RuneAudio"
gpio mode 7 out
gpio write 7 1
sleep 1
echo "Setting pin GPIO7 Low"
gpio write 7 0
else
echo "reboot RuneAudio"
# Reboot blink will stop after Boot OK return
echo "setting pin GPIO 4 High"
gpio -g mode 4 out
gpio -g write 4 1
fi
echo "Stop MPD and unmount shares..."
mpc stop
sudo systemctl stop nginx
sleep 0.5
sudo systemctl stop mpd
Save that file and keep going.
Make them executable by running:
sudo chmod +x *
Step 5 - Make sure gpio is where the scripts expect it
cd /usr/bin/
sudo cp /usr/local/bin/gpio .
Step 6 - Fix restart.sh to run the power button scripts
cd /var/www/command/
sudo nano restart.sh
In the reboot command, add the following line after "systemctl stop nginx":
/var/www/command/scripts/power_manager
In the poweroff command, add the following line after "systemctl stop nginx":
/var/www/command/scripts/power_manager poweroff
Step 7 - Fix rc.local
cd /etc
sudo nano rc.local
Now add the following text to the bottom before exit 0:
/var/www/command/scripts/power_button &
(sleep 20; sudo python /home/pi/RaspDacDisplay.py) &
Save the file and exit.
Now reboot. Good luck.