Moode Forum
[IDEA] GPIO for display state - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8)
+--- Thread: [IDEA] GPIO for display state (/showthread.php?tid=3177)



GPIO for display state - Ale2.0 - 11-21-2020

Hello there

I am currently using a Waveshare 5" Display as main control unit. The annoying thing about it, is the backlight which is not dimmed or turned off at any point. 

Because of this I made a little circuit which dims the display according to the signal of a LDR (Light dependant resistor) as well as the possibility to turn off the backlight completely if a 5V high signal is put on it. 

This means, I can now turn off the display completely and it is dimmed according to the actual amount of light in the room. (If someone wants the schematic, let me know)

What I would need now is a GPIO from the raspberry which goes high if the HDMI output / rpi is in sleep. 

I saw some complicated possibilities for this but as you already integrated an output on change it may be an easy task for you.

It would really be great, because the always gray screen during night is annoying and also destroys the backlight. 
(I did not use the official Display because of the thick frame as well as the usage of many GPIOs)

Thank you beforehand and thanks one more time for this great System!

Sincerely Ale


RE: GPIO for display state - Cardone - 11-21-2020

(11-21-2020, 11:29 AM)Ale2.0 Wrote: Hello there

I am currently using a Waveshare 5" Display as main control unit. The annoying thing about it, is the backlight which is not dimmed or turned off at any point. 

Because of this I made a little circuit which dims the display according to the signal of a LDR (Light dependant resistor) as well as the possibility to turn off the backlight completely if a 5V high signal is put on it. 

This means, I can now turn off the display completely and it is dimmed according to the actual amount of light in the room. (If someone wants the schematic, let me know)

What I would need now is a GPIO from the raspberry which goes high if the HDMI output / rpi is in sleep. 

I saw some complicated possibilities for this but as you already integrated an output on change it may be an easy task for you.

It would really be great, because the always gray screen during night is annoying and also destroys the backlight. 
(I did not use the official Display because of the thick frame as well as the usage of many GPIOs)

Thank you beforehand and thanks one more time for this great System!

Sincerely Ale

Hello,
on this page https://tangielskyblog.wordpress.com/2018/05/19/ein-ausschalter-fuer-das-raspberry-pi-display/ something is described.
Maybe this will help you ...


Ciao
zeferino


RE: GPIO for display state - Ale2.0 - 11-22-2020

(11-21-2020, 12:05 PM)Cardone Wrote: Hello,
on this page https://tangielskyblog.wordpress.com/2018/05/19/ein-ausschalter-fuer-das-raspberry-pi-display/ something is described.
Maybe this will help you ...


Ciao
zeferino

Hello there.

First thank you for the link but thats not what I want to do.
I do not have the Raspberry screen so it wont work and I do not want to use any sensor to wake the screen up.

I just want a GPIO that goes into high state when the screen blanks.

Some Ideas I had:

    Code:
    /opt/vc/bin/tvservice -s
  • or

    Code:
    vcgencmd display_power
  • With these commands you can see the hdmi status, does it turn off while blanking? If yes we could construct a script around it. (I can create scripts in batch, a bit powershell visualbasic but sadly nothing Raspberry related...)
I can see that we are using a Raspbian image without xfce or any Desktop running. I don't know how blanking is managed by Tim. Maybe he just built his own function. As I thought saw the option of a GPIO activated by display change we could also just take this signal and delay it for the set blanking time. This would maybe work but is a rather dirty solution.

Have a nice rest of the weekend!
Ale


RE: GPIO for display state - Tim Curtis - 11-22-2020

moOde uses xserver for attached displays

Packages:
xinit xorg lsb-release xserver-xorg-legacy chromium-browser libgtk-3-0 libgles2

The script that sets up display blanking is
/home/pi/.xinitrc

The Raspberry Pi Touch has a sys class option for backlight brightness 0 - 255
/sys/class/backlight/rpi_backlight/bl_power