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:


I've also disabled screen blanking to no avail.

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

  • 1
    have you tried this after doing the tvservice -p?: xset dpms force on May 17, 2015 at 16:42
  • This worked. If you make the comment an answer i'll accept it. It's also worth mentioning that running these commands via ssh won't work.
    – Nick
    May 17, 2015 at 17:21

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.