Page 1 of 2

[Addon] RuneUI GPIO: power on / off audio equipments

PostPosted: 23 Dec 2016, 13:17
by rern
[Addon] RuneUI GPIO: power on / off audio equipments
Tested on RPi3
for RuneAudio 0.3 and 0.4b


View code - GitHub
Try it - Demo

GPIO-connected relay module control for power on / off audio equipments.
(can be installed without relay module to play with interface)

gpio.gif
gpio.gif (91.76 KiB) Viewed 1515 times


Power on off audio equipments in sequence
    up to 4 equipments(relays)
    delay setting for each equipment(relay)
    notification broadcast for on off
Idle timer power off
    polling 'play' status every minute
    idle time setting
    notification last minute warning with countdown
    reset on play or during warning
Integrated into existing RuneUI
    GPIO (speaker icon) button on the left of top bar
    change button icon and color on on / off
    show button only when enable
    setting in Menu > GPIO (local browser: right click > Fullscreen (exit) > click GPIO tab)
    RPi pin numbering diagram included, show / hide on click
    Can be used with USB PC Remote

Warning !
    A relay module can be connected to GPIO, to see how it works, by anyone with basic skill.
    Wrong connection may just damage your RPi. (only 5V)
    Requires electrical skill and knowledge to connect these relays as power switches. (110V / 220V)
    Electric shock can kill.

Things to get

Dirt cheap on ebay
relay.jpg
relay.jpg (39.2 KiB) Viewed 1515 times



Things to do

(click for larger image)

Image Image Image Image

Install:
from Addons

Re: RuneUI GPIO for power on / off audio equipments

PostPosted: 25 Dec 2016, 10:57
by Stefan3v
When you try to install will receive this error.: "./install.sh: line 211: syntax error: unexpected end of file"
I can see the missing one "fi"

if ! grep -qs 'RuneUIe' /srv/http/app/templates/header.php; then
echo
echo '========================================================='
echo '"RuneUI Enhancement" not found.'
echo '========================================================='
echo
echo 'It must be installed first.'
echo
(( $disk == 1 )) && echo 'And disk space less than 300MB. Expand partition before install.'
echo
echo '---------------------------------------------------------'
echo
rm install.sh
exit
HERE is mising "fi"
if (( $disk == 1 )); then

Re: RuneUI GPIO for power on / off audio equipments

PostPosted: 25 Jan 2017, 20:33
by ColinT
Hello rern,

The GPIO's are HI when off and LO when on, is it possible to revers it?
I want HI is on and LO is off.

I have tried editing the python file but no succes :(

Thank for you help.

ColinT

Re: RuneUI GPIO for power on / off audio equipments

PostPosted: 28 Jan 2017, 08:03
by rern
Stefan3v wrote:When you try to install will receive this error.: "./install.sh: line 211: syntax error: unexpected end of file"
I can see the missing one "fi"

Sorry for responding way too late. Board notification somehow had never reached me.
That errors was fixed. Actually, there's no need to expand the partition any more. The latest install script should iron out most of the glitches.
Let me know if there's still any errors or questions.
Some feedback would be nice.

ColinT wrote:The GPIO's are HI when off and LO when on, is it possible to revers it?
I want HI is on and LO is off.

GPIO.output(pin, 0) > 0 resister > V+ > relay on
GPIO.output(pin, 1) > 1 resister > 0V > relay off

if you just want to substitute the 0 / 1, you may assign variables for them.
Code: Select all
HI = 0
LO = 1
# or
on = 0
off = 1

Re: RuneUI GPIO for power on / off audio equipments

PostPosted: 01 Feb 2017, 16:11
by rpt007
Hi,

just found out, that the installation of the enhanced interface breaks the setup menu on my 7" waveshare tft.
Any suggestions?

Re: RuneUI GPIO for power on / off audio equipments

PostPosted: 02 Feb 2017, 01:22
by rern
rpt007 wrote:just found out, that the installation of the enhanced interface breaks the setup menu on my 7" waveshare tft.
Any suggestions?

A screen image or more detail of the broken setup menu would be helpful.

Re: RuneUI GPIO for power on / off audio equipments

PostPosted: 02 Feb 2017, 22:03
by rpt007
"Broken setup menu" might not be the right expression.
What happens:
1. using a browser on my PC -> the setup menu icon reacts like a charm and all setup menu items are shown and are responsive
2. using my waveshare 7" tft all "active" touch and slide areas work as expected, but the menu icon shows no reaction when clicking on it. The display comes with a very high resolution. I reduced the resolution down to 800x600 or so and added some overscan pixels at the top and bottom screen to have a safe hit zone.
With the non-enhanced GUI everything works with that screen setup and, as said, your enhanced GUI works besides of the menu icon.

So I think my description gives you more information than a screenshot with a non-responsive menu icon :)

Edit as of Feb 05:
Discussion continues here: http://www.runeaudio.com/forum/runeui-enhancement-t4207-60.html

Re: RuneUI GPIO for power on / off audio equipments

PostPosted: 06 Feb 2017, 10:14
by rpt007
@rern:
Just re-installed GPIO enhancement.
The menu-item is still responding on my TFT display and GPIO is shown as submenu item.
But: when trying to use the GPIO setup submenu by clicking on the GPIO item -> no reaction on my TFT screen.

I repeated the action on my iPad: works flawlessly and I can switch GPIO on/off, modify values etc.
What I saw on the iPad: it opens a new tab, independend from the main screen.

This might be the problem with the waveshare 7" TFT -> it stays on the same screen. I think that the built in browser either has no tabs or it has to be activated in your script?

Raimund

Re: RuneUI GPIO for power on / off audio equipments

PostPosted: 07 Feb 2017, 08:16
by rern
Hi Raimund,

The GPIO settings page now opens in the same window.
rpt007 wrote:(from another post)
Now I will install the GPIO add-on and built it up with one or two relays (I have only one amp "behind" the DAC); will feed back when it works.

One or two relays seriously? :o
Unless you have to fit it in a limited space, it's just less than $3 for a 4 relays module. :P

rern

Re: RuneUI GPIO for power on / off audio equipments

PostPosted: 07 Feb 2017, 09:26
by rpt007
Yeah, I know the price and I own already a dozen of those relays (singles, doubles and quadros) -> mainly for some Arduino based projects.
But in my given case for RuneAudio I only need to switch the amp and the TFT screen which I want to power separately from the Raspi (this will stay powered all time to wake it up). Will see if I find some time today to get it done and feedback what happens.