WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: HDMI ON-OFF  (Read 3257 times)

Offline thorald

  • Newbie
  • *
  • Posts: 20
HDMI ON-OFF
« on: June 05, 2017, 04:22:34 AM »
Hi!
Is there a way to prevent the hdmi to go to sleep?
Im running over ssh with a screen hooked up, but after a few minutes the picture disappears, but the power is still on.

And the other way around, how do I turn hdmi off.

Cheers

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: HDMI ON-OFF
« Reply #1 on: June 05, 2017, 05:24:51 AM »
For Xorg, I think
Code: [Select]
xset s off -dpms
should work.

For CLI only, try
Code: [Select]
setterm -blank 0

To completely turn off the display (needs  rpi-vc.tcz  to be loaded)
Code: [Select]
tvservice -o
... and to turn it back on
Code: [Select]
tvservice -p
NOTE: after turning the display off, you will have to blindly enter the command to turn it on again. Or via ssh or other means.
Also note, you may then have to switch VTs back and forth (CTRL+ALT+F1, CTRL+ALT+F2) to get the display activated.
Download a copy and keep it handy: Core book ;)

Offline thorald

  • Newbie
  • *
  • Posts: 20
Re: HDMI ON-OFF
« Reply #2 on: June 07, 2017, 07:19:19 AM »
Thank you!
Will try!

Offline thorald

  • Newbie
  • *
  • Posts: 20
Re: HDMI ON-OFF
« Reply #3 on: June 12, 2017, 06:25:23 AM »
I installed rpi-vc and got it working:)
Nice to be able to turn on and off the screen.


The issue is that since i only use this machine with ssh, no mouse or keyboard, but need to see information from the screen.
Is there a way to simulate a keyboard keypress or a mouse, that keeps the system from entering the screen to sleep mode?

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: HDMI ON-OFF
« Reply #4 on: June 12, 2017, 06:37:17 AM »
What about the  xset  and  setterm  commands mentioned above?
Download a copy and keep it handy: Core book ;)

Offline thorald

  • Newbie
  • *
  • Posts: 20
Re: HDMI ON-OFF
« Reply #5 on: June 12, 2017, 07:26:05 AM »
Oh sorry, i missed to include that.
neither setterm or xset can be found..

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: HDMI ON-OFF
« Reply #6 on: June 12, 2017, 07:46:21 AM »
Sorry as well, didn't mention where to get those tools from
setterm  is provided by  util-linux.tcz
xset  is provided by  Xlibs.tcz

By the way, if you don't know which extension provides a certain file, you can find out by using the "Provides" feature via the Apps GUI or  tce-ab  CLI tool.
Download a copy and keep it handy: Core book ;)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: HDMI ON-OFF
« Reply #7 on: June 12, 2017, 09:29:26 AM »
Tried it on a RPi3 through ssh and noticed it's a little fussy.

For X
Code: [Select]
ssh <IP> "DISPLAY=:0.0 xset s off -dpms"

CLI alternative,  util-linux.tcz  not needed.
Code: [Select]
### ESC [ 9 ; n ]       Set screen blank timeout to n minutes. "0" to disable.
### ESC [ 13 ]          Unblank the screen.
ssh <IP> "echo -e '\033[9;0]' >> /dev/tty1; echo -e '\033[13]' >> /dev/tty1"
Download a copy and keep it handy: Core book ;)

Offline thorald

  • Newbie
  • *
  • Posts: 20
Re: HDMI ON-OFF
« Reply #8 on: June 16, 2017, 12:52:24 AM »
Ah thank you!
Got it working!

* I did not try xset, since i dont´t need it. CLI commands does work!
« Last Edit: June 16, 2017, 01:17:19 AM by thorald »