How to Turn Off Monitor/backlight (not black screen)


9 posts
by svetlev » Wed Sep 05, 2012 12:21 am
Hi, Guys.

I'm trying to save back-light hours on monitors that will be connected to Pi's as a kiosk, so they need to powersave/standby every evening and then turn back on automatically in the morning.

I've tried several approaches based on advice on other linux forums, mostly involving xset, setterm, and vbetool. Xset is available for Pi, but I've have trouble finding vbetool and suspect hardware incompatibility. I've been able to set up a shell script and cron entry to black out the screen (what xset considers "off") but nothing yet that signals my monitor to truly save power.

Is this even possible? Is the Pi's video hardware capable of sending such a signal?

Thanks in advance. This is the last piece to figure out for this project.
Posts: 6
Joined: Sun Jul 01, 2012 10:46 pm
by ghans » Fri Sep 07, 2012 8:35 am
AFAIK HDMI supports this. Any input ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 7207
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by jfornango » Fri Sep 14, 2012 8:20 pm
Q: How is your backlight getting power?

My thoughts: Set a timer running in the background (might have to add an RTC module, I think the Pi doesn't have one). At the 'Turn On' time, drive one of the GPIO pins high. That pin gets tied either to the backlight pin of the display (it the display can use the low voltage), or to a relay if it needs more juice to drive it. then, at the 'Turn Off' time, pull the signal on the GPIO low.

If this is for a stand-alone Kiosk, then maybe build the timer as a separate circuit and bypass the Pi altogether.
I'm only wearing black until they find something darker.
Posts: 113
Joined: Fri Sep 14, 2012 7:46 pm
Location: St. Louis, MO USA
by psergiu » Mon Sep 17, 2012 7:08 am
Turn off HDMI & Composite output: /opt/vc/bin/tvservice -o

/opt/vc/bin/tvservice -h for a little more info.
User avatar
Posts: 222
Joined: Mon Nov 07, 2011 8:36 am
Location: TX, U.S.A. (was: RO, E.U.)
by kspn » Mon Sep 17, 2012 12:40 pm
This works for turning the HDMI/Composite outputs off, but what about turning them back on?

The only way I have been able to get the monitor to come back on is by rebooting the RasPi :(
No Coffee, No Workee
User avatar
Posts: 68
Joined: Mon Jan 16, 2012 9:52 pm
Location: Melbourne
by svetlev » Mon Sep 17, 2012 11:29 pm
psergiu wrote:Turn off HDMI & Composite output: /opt/vc/bin/tvservice -o

/opt/vc/bin/tvservice -h for a little more info.


Thanks so much, this "tvservice" is exactly what was needed (although using GPIO to physically turn the backlight off would be very impressive.) ;)

Now that I can turn it off, my focus has turned to turning it back on fully. :? The "/opt/vc/bin/tvservice -p" turns the monitor power back on, but it's black and unfortunately I can't get xset to "goose" it back to a live screen in X. I have to switch consoles to get the display back which won't work in this application. I think this user (viewtopic.php?t=7570&p=92870) has solved the problem, but I'm not following the scripting exactly. Does anyone follow what specifically must be done?

Thanks again for the help, and sorry for the late response. I thought I had clicked "Notify me when a reply is posted." I did this time for sure.
Posts: 6
Joined: Sun Jul 01, 2012 10:46 pm
by svetlev » Mon Sep 17, 2012 11:56 pm
svetlev wrote:
psergiu wrote:Turn off HDMI & Composite output: /opt/vc/bin/tvservice -o

/opt/vc/bin/tvservice -h for a little more info.


Thanks so much, this "tvservice" is exactly what was needed (although using GPIO to physically turn the backlight off would be very impressive.) ;)

Now that I can turn it off, my focus has turned to turning it back on fully. :? The "/opt/vc/bin/tvservice -p" turns the monitor power back on, but it's black and unfortunately I can't get xset to "goose" it back to a live screen in X. I have to switch consoles to get the display back which won't work in this application. I think this user (viewtopic.php?t=7570&p=92870) has solved the problem, but I'm not following the scripting exactly. Does anyone follow what specifically must be done?

Thanks again for the help, and sorry for the late response. I thought I had clicked "Notify me when a reply is posted." I did this time for sure.


Actually, I just figured it out. "chvt" changes the foreground virtual terminal, so the quick/dirty fix would be to add
Code: Select all
chvt 6
chvt 7
at the end of my power-on script, since X always runs on tty7 in my setup. A more elegant solution is what Phil came up with at the link I mentioned above. Thanks again, everyone. Problem solved. :D Hopefully future versions of "tvservice" will make this small hack unnecessary.
Posts: 6
Joined: Sun Jul 01, 2012 10:46 pm
by jfornango » Tue Sep 18, 2012 3:50 pm
Excellent. I may still see about the GPIO solution once my RPi comes in, but having a working solution in hand is always good.
I'm only wearing black until they find something darker.
Posts: 113
Joined: Fri Sep 14, 2012 7:46 pm
Location: St. Louis, MO USA
by simlun » Thu Jul 24, 2014 3:14 pm
Thanks for teaching me how to do this!

Here's a practical bash script inspired by this forum thread:
https://gist.github.com/simlun/1b27b14d707abbba8fc1
Posts: 1
Joined: Thu Jul 24, 2014 3:09 pm