Read the statement by Michael Teeuw here.
face recognizes display ON/OFF
-
@djboob66 look at his code, he uses the same commands
-
@djboob66 Hey, have you found any code yet? I’m looking for the same thing as well. Really need help with this.
-
@suvan looking for what?
-
as I said before, look at the GA code that does this… its the same 4 commands as always
https://github.com/bugsounet/screen/blob/master/index.js
and
async setPowerDisplay (set) { log("Display " + (set ? "ON." : "OFF.")) this.screen.power = set this.SendScreenPowerState() if (this.screen.awaitBeforeTurnOff && !set) await this.sleep(this.screen.awaitBeforeTurnOffTime) // and finally apply rules ! switch (this.config.mode) { case 1: if (set) exec("/usr/bin/vcgencmd display_power 1") else exec("/usr/bin/vcgencmd display_power 0") break case 2: if (set) exec("DISPLAY=:0 xset dpms force on") else exec("DISPLAY=:0 xset dpms force off") break case 3: if (set) exec("tvservice -p && sudo chvt 6 && sudo chvt 7") else exec("tvservice -o") break case 4: if (set) exec("echo 'on 0' | cec-client -s") else exec("echo 'standby 0' | cec-client -s") break case 5: if (set) exec("xset dpms force on") else exec("xset dpms force off") break } }
you should try each command to see what the results are
do this from and ssh connection to your pi, so you don’t have to fight getting the screen back on to work…note that most of these turn off the HDMI port, and NOT the actual monitor.
many newer displays (since 2016) are energy star compliant and will display an upgly no input signal when the hdmi port is turned off… no way to override that(and these displays will NOT turn back on when the hdmi port is turned back on)
ps… none of my displays will work with any of these commands
-
@sdetweil on the PI3… I just got mine working again this is the commands that work:
ON:
#! /bin/bash
sudo vcgencmd display_power 1OFF:
#! /bin/bash
sudo vcgencmd display_power 0 -
@cowboysdude cool. what monitor is that with?