I have my Raspbian running Chromium in kiosk mode and works nicely. However, I would like it to turn the HDMI display off at 10pm and wake it up at 7am. I could not find such a setting in Raspbian.
I am using
xset dpms force off to turn off the display. This command uses Display Power Management Signaling.
In a cron job, you'll need to set the
DISPLAY variable, so that the crontab entries become something like:
* 22 * * * DISPLAY=:0 xset dpms force off * 7 * * * DISPLAY=:0 xset dpms force on
Make sure the X server is started with
You may want to look into HDMI CEC which allows you to send commands such as power on/off via HDMI to a TV set. There's a libcec for this, as well as an cec-client. For instance, this blog post about switching on/off a TV may help: https://timleland.com/raspberry-pi-turn-tv-onoff-cec/
Then set up a cron job to run cec-client in the evening and the morning.
Like Steffen Uhlig wrote, using
xset dpms force [on|off] is the solution for normal displays. Please note that his cronjob is running every minute in the specified hour.
crontab -e (as normal pi user) will allow you to add a cronjob, where you just need to add the following lines at the end:
0 22 * * * DISPLAY=:0 xset dpms force off 0 7 * * * DISPLAY=:0 xset dpms force on