chilipie-kiosk icon indicating copy to clipboard operation
chilipie-kiosk copied to clipboard

How to configure that the Monitor power off after 10 minutes and power on on touch?

Open blueicehaller opened this issue 4 years ago • 15 comments

I would like to configure that the monitor is going to sleep when nobody using the system. One Wakeup event is when anybody uses the touchscreen (Iiyama ProLite T2735MSC). Is there a preferred way?

Solution Open sudo raspi-config, select 7 Advanced Options - Configure advanced settings and enable A6 Screen Blanking - Enable/Disable screen blanking

Edit ~/.xsession and change the following (comment out two xset options and add two other)

# Set some useful X preferences
xset s off # don't activate screensaver
# xset -dpms # disable DPMS (Energy Star) features.
# xset s noblank # don't blank the video device
xset +dpms                 # enable DPMS (Energy Star) features
xset dpms 3600 0 0         # xset [dpms standby [ suspend [ off]]]

You can test using 20 instead of 3600 seconds.

Then sudo reboot

Further Information: xset manual page


Previous written Is it possible to use the scripts in Home (which are used in crontab)?

~/display-off.sh
~/display-on.sh

Is blanking (consoleblank) or xscreensaver what I'm searching for? https://www.raspberrypi.org/documentation/configuration/screensaver.md

And what is this? https://www.raspberrypi.org/documentation/configuration/config-txt/video.md hdmi_blanking

The hdmi_blanking command controls what happens when the operating system asks for the display to be put into standby mode, using DPMS, to save power. If this option is not set or set to 0, the HDMI output is blanked but not switched off. In order to mimic the behaviour of other computers, you can set the HDMI output to switch off as well by setting this option to 1: the attached display will go into a low power standby mode.

On the Raspberry Pi 4, setting hdmi_blanking=1 will not cause the HDMI output to be switched off, since this feature has not yet been implemented.

blueicehaller avatar May 18 '20 19:05 blueicehaller

@blueicehaller Did you have to install xscreensaver? When I activate screen blanking via raspi-config I get the message "dpkg-query: no packages found matching xscreensaver".

codeclinic avatar Jun 17 '20 13:06 codeclinic

Yes I confirm that behavior.

blueicehaller avatar Jun 17 '20 15:06 blueicehaller

So you did install xscreensaver?

codeclinic avatar Jun 17 '20 17:06 codeclinic

No I didn't because it's not necessary in my case. Today I tested on a fresh install and I just had to enable A6 Screen Blanking - Enable/Disable screen blanking, comment out two xset options and add two other and then sudo reboot. You can test the behavior using 20 seconds: xset dpms 20 0 0

Offtopic: Fresh install was necessary on a new SD Card because my previous no longer started with kernel panic. This is mentioned on README.md .

blueicehaller avatar Jun 18 '20 22:06 blueicehaller

@blueicehaller I don't have A6 Screen Blanking - Enable/Disable screen blanking on advanced settings, any idea why? I just did a fresh install and for me A6 is A6 Pixel Doubling.

bernardovalente avatar Jul 14 '20 19:07 bernardovalente

Which model? I'm running two 4 Model B rev 1.1. I tried to update one Raspberry Pi (sudo raspi-config, select 8 Update and sudo apt update && sudo apt upgrade is running) to see if the option disappears. At the moment the option is still available, even after sudo reboot.

[1] https://www.raspberrypi.org/documentation/configuration/raspi-config.md [2] https://www.raspberrypi.org/documentation/configuration/screensaver.md

blueicehaller avatar Jul 15 '20 21:07 blueicehaller

3b+. It's working though, i just edited the .xsession file an installed xscreensaver. Thank you

bernardovalente avatar Jul 15 '20 22:07 bernardovalente

3b+. It's working though, i just edited the .xsession file an installed xscreensaver. Thank you

@bernardovalente Please share your edited .xsession file. I also have the 3b+ and cannot get it working.

codeclinic avatar Jul 16 '20 08:07 codeclinic

sorry for the delay:

xset +dpms xset dpms 20 0 0

offtopic:

i'm trying to use a proximity sensor but i'm having a problem, it gets detected but cannot turn on screen, can anyone help me? i'm following this: https://www.ketzler.de/2017/12/exit-screensaver-on-raspberry-pi-with-motion-sensor/

bernardovalente avatar Jul 29 '20 20:07 bernardovalente

Currently I don't have access to my Raspberries on another location. Can you please check if the Monitor powers on if you call ~/display-on.sh? If yes maybe you can call it from the gpio-watch? When I understand it right you create an symlink sudo ln -s /etc/gpio-scripts/4 ~/display-on.sh

blueicehaller avatar Jul 29 '20 21:07 blueicehaller

yes i can call ~/display-on.sh but i'm not really sure how to auto run the gpio-watch -e rising 4 command on start up or how to use a symlink, sorry i'm kind of new on raspberrys...

bernardovalente avatar Jul 29 '20 21:07 bernardovalente

Five Ways to Run a Program On Your Raspberry Pi At Startup

One method is edit the crontab file sudo crontab -e , you're prompted to select an installed Editor of your choice. On the End of the file write e.g. @reboot gpio-watch -e rising 4.

Install gpio-watch, create the symlink depending on the connected GPIO pin e.g. sudo ln -s /etc/gpio-scripts/4 ~/display-on.sh and start watching using e.g. gpio-watch -e rising 4.

Crossing my fingers. 🤞 🤞

blueicehaller avatar Aug 24 '20 16:08 blueicehaller

i have 3B+ and 7" touchscreen and am trying to follow instructions here to setup screen so it goes off after set amount of time and then turns back on with touch. turned on blanking but I cannot find xsession anywhere to edit it. tried via winscp. can somebody point me in the right direction how to find and edit it. thanks

DaveWW00 avatar Oct 28 '21 01:10 DaveWW00

The hidden .xsession (the filename starts with dot) is located in pi home folder/directory. Some example commands: Display the current path:

pi@chilipie-kiosk:~$ pwd
/home/pi

Edit the file when you are in the home directory:

pi@chilipie-kiosk:~$ vi .xsession

Edit the file when you are in another directory e.g. /etc :

pi@chilipie-kiosk:/etc$ vi ~/.xsession

blueicehaller avatar Oct 28 '21 10:10 blueicehaller

got it working. appreciate the help and the software!

DaveWW00 avatar Oct 28 '21 18:10 DaveWW00