Hey all,
Since I managed to the RemotePi working with the hardware/remote power switch and then using LIRC I thought I would post the instructions in case someone else is looking for a solution.
I have also sent the instructions for the hardware/remote power up and down to Matt at MSL and he is going to post the instructions on the support pages for the RemotePi.
First, run the run the following 2 commands:syslemctl stop netctl-auto@wlan0
systemctl disable netctl-auto@wlan0
As mentioned else where on the forums, your RuneAudio box will go from taking about 2 minutes to boot to about 20 seconds!
Next, the instructions for adding the scripts for powering up and down and amending the RuneUI so the shutdown button uses the RemotePi too!
Create the RemotePi Script & ServiceKey incd /etc
sudo nano irswitch.sh
Copy and paste the following text into the editor window#!/bin/bash
# this is the GPIO pin receiving the shut-down signal
GPIOpin1=14
echo "$GPIOpin1" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio$GPIOpin1/direction
while true; do
sleep 1
power=$(cat /sys/class/gpio/gpio$GPIOpin1/value)
if [ $power != 0 ]; then
echo "out" > /sys/class/gpio/gpio$GPIOpin1/direction
echo "1" > /sys/class/gpio/gpio$GPIOpin1/value
sleep 3
sudo poweroff
fi
done
Press ctrl+x to exit, y to confirm, enter to save the file
Key insudo chmod +x irswitch.sh
Create the startup serviceKey incd /usr/lib/systemd/system
sudo nano irswitch.service
Copy and paste the following text into the editor window[Unit]
Description=RemotePi Service
After=systemd-modules-load.service
[Service]
Type=simple
ExecStart=/usr/bin/bash /etc/irswitch.sh
[Install]
WantedBy=multi-user.target
Press ctrl+x to exit, y to confirm, enter to save the file
Key insystemctl enable irswitch
That's if for the power up and down script for the hardware button on the RemotePi and startup/shutdown via remote.
You should now pair your remote as described here:
https://youtu.be/fOLIoRlQ1RETo invoke a shutdown from the RuneAudio UIKey incd /etc
sudo nano shutdown.sh
Copy and paste the following text into the editor window#! /bin/bash
GPIOpin=15
echo "$GPIOpin" > /sys/class/gpio/export
# execute shutdown sequence on pin
echo "out" > /sys/class/gpio/gpio$GPIOpin/direction
echo "1" > /sys/class/gpio/gpio$GPIOpin/value
sleep 0.125
echo "0" > /sys/class/gpio/gpio$GPIOpin/value
sleep 0.2
echo "1" > /sys/class/gpio/gpio$GPIOpin/value
sleep 0.4
echo "0" > /sys/class/gpio/gpio$GPIOpin/value
Key inchmod +x /etc/shutdown.sh
Edit the RuneAudio file so that the 'Turn Off - Shutdown’ option from the menu powers down using the RemotePi
Key innano +609 /var/www/command/rune_SY_wrk
Edit line 609 -
Change:
sysCmdAsync(‘poweroff');
To:
sysCmdAsync('/etc/shutdown.sh');
Right, that the RemotePi all setup!
Next, and this is optional and a bit of a pain, but if you want to use LIRC for other remote control functions then there is more work to do.This is the best guide to use which I found posted elsewhere on the forum:
http://yjo-blog.blogspot.jp/2015/05/...tting.html?m=1Following the instructions as is and you should be able to get it working however...
One thing that is different to the guide for the RemotePi is that step 8 should be
8. Creating /etc/modprobe.d/lirc.conf
options lirc_rpi gpio_in_pin=18
Also, as mentioned in the post, irrecord does not work in RuneAudio. I tried downloading a few .conf files from the internet for the Apple remote that I am using but no joy.
So I did exactly what is suggested in the post. Installed Volumio and used irrecord to generate the .conf file for the remote you are using. Once the conf is generated by irrecord you can view it and copy the data to use in RuneAudio.
Here is a few sites that helped be setting up LIRC on Volumio so I could get the .conf file for my remote.
https://volumio.org/forum/how-instal...umio-t360.htmlhttps://volumio.org/forum/using-remo...mio-t1923.htmlHere is some details on the remote commands that you can add to the '/etc/conf.d/lircrc' file for sending commands to MPD using MCP:
https://wiki.archlinux.org/index.php..._MPD_with_lircGuy