2

I'm currently trying to write a simple script that turns on and off my monitor connected to the rpi via hdmi-to-dvi cable.

I can turn off the monitor without issue using:

tvservice -o

However when I use tvservice -p the monitor will wake but it will be a blank screen (Monitor is on but is black and keeps try to switch between analog/digital to find a signal.)

I've changed the /boot/config.txt to:

hdmi_force_hotplug=1

I've also disabled screen blanking to no avail.

How can I power on my monitor without it resulting in blank screen?

Nick
  • 203
  • 1
  • 8

1 Answers1

3

If you run the following commands(you should be able to run this via ssh if you export display):

export DISPLAY=:0.0
tvservice -p
xset dpms force on
#redo the no-sleep commands if the screen had no sleep enabled before
xset -dpms
xset s off
xset s noblank

It should get your screen back on

raspi-ninja
  • 889
  • 2
  • 8
  • 15