RemotePi Board Plus 2015 & RuneAudio

Raspberry Pi related support

RemotePi Board Plus 2015 & RuneAudio

Postby guyb » 08 Oct 2015, 20:55

Hey all,

I was thinking of getting one of these to provide on/off via a power button and via a remote along with the addition of play/pause/next/previous via remote if I can get it working:
http://www.msldigital.com/collections/a ... -plus-2015

On their support pages they have scripts for setting it up for Volumio (scroll down). Will this work with RuneAudio:
http://www.msldigital.com/pages/support ... -plus-2015

Thanks

Guy
guyb
 
Posts: 33
Joined: 08 Sep 2015, 14:10

Re: RemotePi Board Plus 2015 & RuneAudio

Postby hondagx35 » 09 Oct 2015, 12:14

Hi,

Will this work with RuneAudio:

No, because RuneAudio is based on arch linux which uses "systemctl" to start the system.

The mentioned script:
Code: Select all
#!/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
    mpc stop
    echo "out" > /sys/class/gpio/gpio$GPIOpin1/direction
    echo "1" > /sys/class/gpio/gpio$GPIOpin1/value
    sleep 3
    shutdown -h now
  fi
done

will work.


You have to start this script with a systemctl service at boot.
Please search the forum, there should be a description.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: RemotePi Board Plus 2015 & RuneAudio

Postby guyb » 11 Oct 2015, 08:49

Great, thanks. It should arrive next week so I'll try and get it working and report back.

Guy
guyb
 
Posts: 33
Joined: 08 Sep 2015, 14:10

Re: RemotePi Board Plus 2015 & RuneAudio

Postby guyb » 16 Oct 2015, 23:06

OK, so I have the RemotePi now.

I have written the script and service and everything works perfectly :)

I am now trying to get LIRC to work!!!

I am try to use a silver apple remote with the RemotePi.

I have tried to follow a few guides but can't get it to work.

I can't get irrecord to work so have been trying to find a conf for the remote online but not sure if it is the right one.

Also, I am not sure if I am supposed to map the GPIO pins used for the IR sensor with LIRC but I don't know which ones are used.

Essentially I am stabbing in the dark!!!

Can anyone help?

Guy
guyb
 
Posts: 33
Joined: 08 Sep 2015, 14:10

Re: RemotePi Board Plus 2015 & RuneAudio

Postby XploD » 17 Oct 2015, 10:30

Irrecord doesn't work on Archlinux. If you have a spare (micro)SD card somewhere, you can put Raspbian on it and create config file from there, or find it somewhere online. For the GPIO pin, try to look here: http://www.msldigital.com/pages/support ... plus-2015/ , search for "The Hardware" and there's a table with GPIO pins used. You can also track connections on the board where IR sensor is connected to be sure.

About LIRC, if you use Raspberry Pi 1, take a look here: http://yjo-blog.blogspot.jp/2015/05/run ... tting.html . If you use Pi2, I have a tutorial which I use and which works, somewhere in Word file. In case of any further problems with LIRC, let me know and I will write it here.

EDIT: Here you go: http://buzzthisnow.com/ir-remote-with-l ... archlinux/
Music taste: xplodmusic @ Last.fm
Audio source: Raspberry Pi 2 + Sabre ES9023 DAC + WD 500 GB HDD + TP-Link TL-WN722N Wi-Fi + D-LINK Dub H7 USB hub
Hi-Fi: Phillips DCD-7010
Mixer: Nady Audio MM-242
Misc: Tube Stereo Vumeter (Magic Eye)
User avatar
XploD
 
Posts: 77
Joined: 24 Mar 2015, 18:32
Location: Croatia

Re: RemotePi Board Plus 2015 & RuneAudio

Postby guyb » 19 Oct 2015, 17:34

XploD wrote:Irrecord doesn't work on Archlinux. If you have a spare (micro)SD card somewhere, you can put Raspbian on it and create config file from there, or find it somewhere online. For the GPIO pin, try to look here: http://www.msldigital.com/pages/support ... plus-2015/ , search for "The Hardware" and there's a table with GPIO pins used. You can also track connections on the board where IR sensor is connected to be sure.

About LIRC, if you use Raspberry Pi 1, take a look here: http://yjo-blog.blogspot.jp/2015/05/run ... tting.html . If you use Pi2, I have a tutorial which I use and which works, somewhere in Word file. In case of any further problems with LIRC, let me know and I will write it here.

EDIT: Here you go: http://buzzthisnow.com/ir-remote-with-l ... archlinux/


Hi,

Thanks for that. I was following the guide posted above but was being lazy and assumed that I could just download and find a conf file from the Apple Remote that I am using on the internet. I tried a few and none worked. So, finally I caved, installed Volumio, used irrecord to generate the conf and make a copy to take back to Rune...

Best Regards

Guy
guyb
 
Posts: 33
Joined: 08 Sep 2015, 14:10

Re: RemotePi Board Plus 2015 & RuneAudio

Postby guyb » 19 Oct 2015, 17:43

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 & Service

Key in

cd /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 in

sudo chmod +x irswitch.sh

Create the startup service

Key in

cd /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 in

systemctl 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/fOLIoRlQ1RE

To invoke a shutdown from the RuneAudio UI

Key in

cd /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 in

chmod +x /etc/shutdown.sh

Edit the RuneAudio file so that the 'Turn Off - Shutdown’ option from the menu powers down using the RemotePi

Key in
nano +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=1

Following 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.html
https://volumio.org/forum/using-remo...mio-t1923.html

Here 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_lirc

Guy
guyb
 
Posts: 33
Joined: 08 Sep 2015, 14:10

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 11 guests