thechosenginger
Posts: 2
Joined: Sun Dec 24, 2017 8:57 pm

Enable/disable HDMI on times schedule

Wed Apr 08, 2020 3:59 pm

Hello,

I am looking for some help and guidance. I would like to set a raspberry pi I use for work applications to enable and disable the HDMI port each workday at 7am and 7pm. I think I understand the build blocks for what I need, but I do not understand where to start within the pi applications.

Thank you for the help.

User avatar
procount
Posts: 2245
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Enable/disable HDMI on times schedule

Wed Apr 08, 2020 4:03 pm

Can you just set 2 entries in cron, one for 7am, the other for 7pm, that respectively call "tvservice -p" and "tvservice -o" ?
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

trejan
Posts: 2566
Joined: Tue Jul 02, 2019 2:28 pm

Re: Enable/disable HDMI on times schedule

Wed Apr 08, 2020 4:57 pm

procount wrote:
Wed Apr 08, 2020 4:03 pm
Can you just set 2 entries in cron, one for 7am, the other for 7pm, that respectively call "tvservice -p" and "tvservice -o" ?
It is better to use "vcgencmd display_power 0/1" as that only turns on/off the HDMI PHY. Using tvservice will shutdown the entire pipeline and you need to refresh the display when turning it back on or it'll only show a black screen.

klricks
Posts: 7236
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Enable/disable HDMI on times schedule

Wed Apr 08, 2020 6:22 pm

trejan wrote:
Wed Apr 08, 2020 4:57 pm
procount wrote:
Wed Apr 08, 2020 4:03 pm
Can you just set 2 entries in cron, one for 7am, the other for 7pm, that respectively call "tvservice -p" and "tvservice -o" ?
It is better to use "vcgencmd display_power 0/1" as that only turns on/off the HDMI PHY. Using tvservice will shutdown the entire pipeline and you need to refresh the display when turning it back on or it'll only show a black screen.
Also note that depending on your monitors brand, model and OSD settings. The vcgencmd display_power 1 command may not wake the monitor from standby.

In my case issuing vcgencmd display_power 0 shuts off the HDMI output as expected. Then the monitor displays a "No Signal" banner for about 20 min. then goes into standby. So when in standby and after issuing vcgencmd display_power 1, I must also press the physical power button on the monitor or remote.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

Return to “Advanced users”