- Boot OK : GPIO 22
- Shutdown : GPIO 17
- SoftShutdown : GPIO 4
Allo Digione is using GPIO17, so sds.sh must be modified if using this HAT board. (e.g. 27)
Edit /boot/config.txt, add :
dtoverlay=gpio-poweroff,gpiopin=22,active_low
dtoverlay=gpio-shutdown,gpio_pin=17,active_low=0,gpio_pull=down
That's all, you will be able to control power of the RPI with SPC, having a real power shutdown, and no CPU idle. Compatible with most if not all distributions. However the power will not be cut if you initiate Power Off from software, only from button, this behavior require a script.
cd /home/pi
wget https://raw.githubusercontent.com/audiophonics/Raspberry-pwr-management/master/spc_moode.py
cd /var/local/www/commandw/
sudo nano restart.sh
- Update this section :
if [[ $1 = "poweroff" ]]; then
mpc stop
systemctl stop nginx
python /home/pi/spc_moode.py shutdown
# poweroff
fi
- Edit rc.local :
sudo nano /etc/rc.local
Add before exit :
python /home/pi/spc_moode.py &
sudo mkdir /usr/lib/audiophonics/
sudo wget https://github.com/audiophonics/Raspberry-pwr-management/raw/master/runeaudio.sds.service -O /usr/lib/audiophonics/runeaudio.sds.service
sudo wget https://github.com/audiophonics/Raspberry-pwr-management/raw/master/sds.sh -O /usr/lib/audiophonics/sds.sh
sudo ln -s /usr/lib/audiophonics/runeaudio.sds.service /etc/systemd/system/runeaudio.sds.service
sudo chmod +x /usr/lib/audiophonics/sds.sh
sudo ln -s /usr/lib/audiophonics/sds.sh /usr/local/bin/sds.sh
sudo systemctl enable runeaudio.sds.service
sudo systemctl start runeaudio.sds.service
sudo mkdir /usr/lib/audiophonics/
sudo wget https://github.com/audiophonics/Raspberry-pwr-management/raw/master/softreboot.sh -O /usr/lib/audiophonics/softreboot.sh
sudo chmod +x /usr/lib/audiophonics/softreboot.sh
sudo ln -s /usr/lib/audiophonics/softreboot.sh /usr/bin/softreboot.sh
sudo mkdir /usr/lib/audiophonics/
sudo wget https://github.com/audiophonics/Raspberry-pwr-management/raw/master/softshutdown.sh -O /usr/lib/audiophonics/softshutdown.sh
sudo chmod +x /usr/lib/audiophonics/softshutdown.sh
sudo ln -s /usr/lib/audiophonics/softshutdown.sh /usr/bin/softshutdown.sh
Instructions on our Forum
http://forum.audiophonics.fr/viewtopic.php?f=12&t=1967&p=7991
Thanks to him for this very nice plugin
https://github.com/Saiyato/volumio-audiophonicsonoff-plugin
Installation :
mkdir ./audiophonicsonoff-plugin
wget https://github.com/Saiyato/volumio-audiophonicsonoff-plugin/raw/master/volumio-audiophonicsonoff-plugin.zip
miniunzip volumio-audiophonicsonoff-plugin.zip -d ./audiophonicsonoff-plugin
cd ./audiophonicsonoff-plugin
/// From Volumio 2.457 :
apt-get update && apt-get install -y build-essential
npm i
From Volumio 2.457 \\\
volumio plugin install