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

Raspberry Pi related support

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

Postby rern » 23 Dec 2016, 13:17

[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 483 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 483 times



Things to do

(click for larger image)

Image Image Image Image

Install:
from Addons
Last edited by rern on 24 Jan 2020, 13:40, edited 46 times in total.
RuneAudio+R @ github.com/rern
Raspberry Pi 4B
Raspberry Pi 3B > SMSL M8 DAC
Raspberry Pi Zero W
User avatar
rern
 
Posts: 653
Joined: 14 Jul 2016, 08:15

Re: RuneUI GPIO for power on / off audio equipments

Postby Stefan3v » 25 Dec 2016, 10:57

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
Stefan3v
 
Posts: 1
Joined: 25 Dec 2016, 10:48

Re: RuneUI GPIO for power on / off audio equipments

Postby ColinT » 25 Jan 2017, 20:33

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
ColinT
 
Posts: 8
Joined: 20 Jan 2017, 10:27

Re: RuneUI GPIO for power on / off audio equipments

Postby rern » 28 Jan 2017, 08:03

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
RuneAudio+R @ github.com/rern
Raspberry Pi 4B
Raspberry Pi 3B > SMSL M8 DAC
Raspberry Pi Zero W
User avatar
rern
 
Posts: 653
Joined: 14 Jul 2016, 08:15

Re: RuneUI GPIO for power on / off audio equipments

Postby rpt007 » 01 Feb 2017, 16:11

Hi,

just found out, that the installation of the enhanced interface breaks the setup menu on my 7" waveshare tft.
Any suggestions?
User avatar
rpt007
 
Posts: 25
Joined: 23 Jan 2017, 16:53
Location: Germany

Re: RuneUI GPIO for power on / off audio equipments

Postby rern » 02 Feb 2017, 01:22

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.
RuneAudio+R @ github.com/rern
Raspberry Pi 4B
Raspberry Pi 3B > SMSL M8 DAC
Raspberry Pi Zero W
User avatar
rern
 
Posts: 653
Joined: 14 Jul 2016, 08:15

Re: RuneUI GPIO for power on / off audio equipments

Postby rpt007 » 02 Feb 2017, 22:03

"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
User avatar
rpt007
 
Posts: 25
Joined: 23 Jan 2017, 16:53
Location: Germany

Re: RuneUI GPIO for power on / off audio equipments

Postby rpt007 » 06 Feb 2017, 10:14

@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
User avatar
rpt007
 
Posts: 25
Joined: 23 Jan 2017, 16:53
Location: Germany

Re: RuneUI GPIO for power on / off audio equipments

Postby rern » 07 Feb 2017, 08:16

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
RuneAudio+R @ github.com/rern
Raspberry Pi 4B
Raspberry Pi 3B > SMSL M8 DAC
Raspberry Pi Zero W
User avatar
rern
 
Posts: 653
Joined: 14 Jul 2016, 08:15

Re: RuneUI GPIO for power on / off audio equipments

Postby rpt007 » 07 Feb 2017, 09:26

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.
User avatar
rpt007
 
Posts: 25
Joined: 23 Jan 2017, 16:53
Location: Germany

support RuneAudio Donate with PayPal

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 10 guests