hondagx35 wrote:Hi ricardo1979,
installing this should be easy on RuneAudio.
Its just the LED is constantly flashing?! But I do not understand what that means and so far nobody explained me this
This is because your DAC does not get the correct signals from your Pi.
1) use the latest image for RP2/RP3
2) update RuneAudio
- Code: Select all
cd /var/www
git pull
3) install wiringPi
- Code: Select all
pacman -Sy wiringpi
4) save this file as /usr/local/bin/sds.sh
- Code: Select all
#!/bin/bash
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 [ "$(/home/pi/wiringPi/gpio/gpio -g read 17)" = "1" ]; then
echo "ShutDown order received, RaspBerry pi will now enter in standby mode..."
/var/www/command/rune_shutdown poweroff
systemctl poweroff
break
fi
/bin/sleep 0.25
done
exit 0
5) make it executable
- Code: Select all
chmod +x /usr/local/bin/sds.sh
6) change /var/www/command/rune_shutdown
- Code: Select all
....
# file: command/rune_shutdown
# version: 1.3
# coder: Simone De Gregori
#
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..."
.....
7) make a service for sds.sh
save this as /usr/lib/systemd/system/sds.service
- Code: Select all
[Unit]
Description=Audiophonics Shutdown Service
After=network.target
[Service]
ExecStart=/usr/local/bin/sds.sh
ExecReload=/usr/bin/kill -HUP $MAINPID
KillMode=process
Restart=always
RestartSec=10
StartLimitInterval=30
StartLimitBurst=20
[Install]
WantedBy=multi-user.target
8) enable the service
- Code: Select all
systemctl enable sds.service
This all is not tested!
I hope it works.
Frank
So time to try, and I did
But i see some error
But decided to continue with your instructions and I finish the whole lot
But I am still not sure if I have the button wired the right way.
So if I press it and it gets latched in the position, the button LED and RPi LED flash and it goes OFF. And RPi not boot.
If I double press it, the RPi boots with button LED flashing and after a while it stays lit
So it seems your code done some good
But if this is right I do not know.
So if I press it again button LED is lit and the RPi goes off in 1 s. So I dont think its shuts the system at all.
Another test was, once is ON I double press it and the button LED is blinking but nothing is happening, even in long period of time, like over 10-15 mins. So I think it does nothing