what I already tried is to replace
$cmd = 'mpc stop && poweroff';
$cmd = '/etc/shutdown.sh';
This should trigger the RasPi to send a dedicated signal pattern on GPIO15. The RemotePi usually recognizes this pattern and itself sets GPIO14 to high level.
The following script called irswitch.sh also located in /etc then stops the mpc and performs the shutdown.
this is the GPIO pin receiving the shut-down signal
echo “$GPIOpin1” > /sys/class/gpio/export
echo “in” > /sys/class/gpio/gpio$GPIOpin1/direction
while true; do
if [ $power != 0 ]; then
echo “out” > /sys/class/gpio/gpio$GPIOpin1/direction
echo “1” > /sys/class/gpio/gpio$GPIOpin1/value
shutdown -h now
The GPIO14 is also set by the RemotePi Board when it receives a comand from the IR remote or it’s push button is pressed. The above script is executed and the Pi shuts down.
I’ll try to find out if the script shutdow.sh is executed and if the intended signal sequence is sent.