pi_lover
Posts: 80
Joined: Fri Apr 28, 2017 4:00 am

How to disable screen blanking ?

Tue Apr 24, 2018 8:27 am

Hi,
The screen goes dark after a period of inactivity ... How to stop this ?

User avatar
RaTTuS
Posts: 10828
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: How to disable screen blanking ?

Tue Apr 24, 2018 8:47 am

edit /boot/cmdline.txt *
and add
consoleblank=0
right after the rootwait
then reboot



*
if using NOOBS
then
Use the NOOBS recovery system [spam the [SHIFT] key during boot to activate it] and edit that /boot/cmdline.txt
Last edited by RaTTuS on Fri Apr 27, 2018 9:03 am, edited 1 time in total.
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

pi_lover
Posts: 80
Joined: Fri Apr 28, 2017 4:00 am

Re: How to disable screen blanking ?

Tue Apr 24, 2018 9:23 am

Yes I am using Noobs.

What exactly should I add to that /boot/config.txt?

User avatar
B.Goode
Posts: 14738
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: How to disable screen blanking ?

Tue Apr 24, 2018 9:33 am

What exactly should I add to that /boot/config.txt?
Exactly nothing.

I think there was a minor typing error - maybe due to autocorrect - in the second part of the advice above.

It is cmdline.txt that you need to modify with the Configuration Editor on the NOOBS Recovery Console.

pi_lover
Posts: 80
Joined: Fri Apr 28, 2017 4:00 am

Re: How to disable screen blanking ?

Tue Apr 24, 2018 9:37 am

If I create a script with "xset s off" and run it will it work ?

weeper
Posts: 4
Joined: Tue Apr 17, 2018 12:59 pm

Re: How to disable screen blanking ?

Wed Apr 25, 2018 12:21 am

You can install an application:

sudo apt-get install xscreensaver

After installation. Go to Menu => Preferences => Screensaver, then just disable it there :)

klricks
Posts: 8648
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: How to disable screen blanking ?

Wed Apr 25, 2018 1:11 am

I believe the edit to cmdline mentioned above is only useful if the system is set to boot to command line only.

For boot to desktop then adding the 3 lines below to autostart works for me.

Edit with nano editor:

Code: Select all

nano /home/pi/.config/lxsession/LXDE-pi/autostart
Add these 3 lines at the end:

Code: Select all

@xset s noblank
@xset s off
@xset s -dpms
Save and exit CTRL x Y

xscreensaver also works but you have to install 40MB of fluf.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

pi_lover
Posts: 80
Joined: Fri Apr 28, 2017 4:00 am

Re: How to disable screen blanking ?

Wed Apr 25, 2018 10:18 pm

@klricks

Your solution worked. Thanks a lot.

hippy
Posts: 13434
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: How to disable screen blanking ?

Mon Jan 14, 2019 1:58 am

klricks wrote:
Wed Apr 25, 2018 1:11 am
Edit with nano editor:

Code: Select all

nano /home/pi/.config/lxsession/LXDE-pi/autostart
Add these 3 lines at the end:

Code: Select all

@xset s noblank
@xset s off
@xset s -dpms
Save and exit CTRL x Y
I could have sworn this also worked for me when I tried it earlier this year, but on a virgin Raspbian Desktop install ( image not NOOBS, no recommended software, updated to today, boot to GUI ), creating that file ( it didn't already exist ) with those contents just leaves me with a black screen after a reboot, albeit that the mouse cursor is there. Delete the file and reboot and everything is fine again.

Any ideas or suggestion on how to debug, find out what's wrong, or make it work ?

klricks
Posts: 8648
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: How to disable screen blanking ?

Mon Jan 14, 2019 1:14 pm

hippy wrote:
Mon Jan 14, 2019 1:58 am
....
I could have sworn this also worked for me when I tried it earlier this year, but on a virgin Raspbian Desktop install ( image not NOOBS, no recommended software, updated to today, boot to GUI ), creating that file ( it didn't already exist ) with those contents just leaves me with a black screen after a reboot, albeit that the mouse cursor is there. Delete the file and reboot and everything is fine again.

Any ideas or suggestion on how to debug, find out what's wrong, or make it work ?
Due to changes to mentioned in the blog, Raspbian now uses the global autostart in this location:

Code: Select all

/etc/xdg/lxsession/LXDE-pi/autostart
If you prefer to use the one at /home/pi/.config/.......... then it must contain these lines:

Code: Select all

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@point-rpi
If autostart exists at /home/pi/.config/.... then the one at /etc/xdg/....... is ignored.

To stop screen blanking you only need these 2 commands:

Code: Select all

@xset s off
@xset -dpms
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

hippy
Posts: 13434
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: How to disable screen blanking ?

Mon Jan 14, 2019 1:45 pm

klricks wrote:
Mon Jan 14, 2019 1:14 pm
Due to changes to mentioned in the blog, Raspbian now uses the global autostart in this location ...
Ah yes. Many thanks for that. I had completely forgotten about that change :oops:

If disabling screen blanking had been a raspi-config or clickable desktop preferences or appearance option I wouldn't have had to care about what needed altering or where settings were stored.

It would be nice if options like this could be made more easily accessible than having to manually edit configuration files but I'm not going to suggest percussive re-education of any developers.

WhyNine
Posts: 104
Joined: Thu May 30, 2019 7:00 pm

Re: How to disable screen blanking ?

Thu May 30, 2019 7:25 pm

I have an LCD screen on the Pi which is set as the main display on boot and displays the desktop. I want to use it as a displaybaord/kiosk so I have set up a service which runs a script file containing:

Code: Select all

#!/bin/bash
xset -display :0 s off
xset -display :0 s noblank
xset -display :0 -dpms
unclutter -display :0 &
# Normal website that does not need any exceptions
/usr/bin/chromium-browser --enable-gpu-compositing --remote-debugging-port=9222 --incognito --start-maximized --kiosk file:/home/pi/Pi-Plex/index.html
My web page displays correctly as full screen but the screen still blanks after 5-10 minutes. If I SSH to the Pi and type "xset -display:0 -dpms", the screen unblanks again.

What am I doing wrong?

I have also tried putting the xset commands in the /etc/xdg/lxsession/LXDE-pi/autostart file but no joy.

It is very frustrating :?

klricks
Posts: 8648
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: How to disable screen blanking ?

Fri May 31, 2019 5:50 am

Did you install xscreensaver? xset commands won't work if xscreensaver is installed.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

WhyNine
Posts: 104
Joined: Thu May 30, 2019 7:00 pm

Re: How to disable screen blanking ?

Fri May 31, 2019 8:00 pm

klricks wrote:
Fri May 31, 2019 5:50 am
Did you install xscreensaver? xset commands won't work if xscreensaver is installed.
No, xscreensaver is not installed.

WhyNine
Posts: 104
Joined: Thu May 30, 2019 7:00 pm

Re: How to disable screen blanking ?

Fri May 31, 2019 8:43 pm

WhyNine wrote:
Fri May 31, 2019 8:00 pm
klricks wrote:
Fri May 31, 2019 5:50 am
Did you install xscreensaver? xset commands won't work if xscreensaver is installed.
No, xscreensaver is not installed.
If I type "xset -display :0 -dpms" in a terminal, the screen never goes blank.

User avatar
Roken
Posts: 410
Joined: Sun Dec 31, 2017 4:35 pm
Location: Wales, home of the Pi

Re: How to disable screen blanking ?

Fri May 31, 2019 10:06 pm

Or, the traditional xorg way. Edit /etc/X11/xorg.conf and in the Monitor section, add

Code: Select all

Option	"DPMS" "off"
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

klricks
Posts: 8648
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: How to disable screen blanking ?

Sat Jun 01, 2019 1:15 am

WhyNine wrote:
Thu May 30, 2019 7:25 pm
......

I have also tried putting the xset commands in the /etc/xdg/lxsession/LXDE-pi/autostart file but no joy.
Do you have another autostart file anywhere in /home/pi/.config/........
If so the one in /etc/xdg/........ will be ignored.

Note this will show the current settings of the xset commands:

Code: Select all

xset q
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

WhyNine
Posts: 104
Joined: Thu May 30, 2019 7:00 pm

Re: How to disable screen blanking ?

Sun Jun 02, 2019 4:14 pm

Roken wrote:
Fri May 31, 2019 10:06 pm
Or, the traditional xorg way. Edit /etc/X11/xorg.conf and in the Monitor section, add

Code: Select all

Option	"DPMS" "off"
That seems to have done the trick. Many thanks for that tip. :D

matteoraggi
Posts: 156
Joined: Thu Dec 01, 2016 11:04 am

Re: How to disable screen blanking ?

Sun Jun 09, 2019 5:48 pm

Raspbian stretch changed a lot from november 2018 are you sure that these informations are updated? Which instructions should I use to disable the blank screen with raspbian stretch of may 2019?
I am using:
Raspberry Pi 3 model B and B+ - with Raspberry OS
Raspberry pi 4 (with 2 gb of ram) - with Raspberry OS

WhyNine
Posts: 104
Joined: Thu May 30, 2019 7:00 pm

Re: How to disable screen blanking ?

Sun Jun 09, 2019 6:17 pm

matteoraggi wrote:
Sun Jun 09, 2019 5:48 pm
Raspbian stretch changed a lot from november 2018 are you sure that these informations are updated? Which instructions should I use to disable the blank screen with raspbian stretch of may 2019?
The "xorg.conf" file is actually in the /usr/share/X11/xorg.conf.d folder. I have a number of files in there and one of them already had a Device section so I added a Screen and Monitor section as well, with the suggested Option. However in the end that didn't fix it (it did after one reboot but not thereafter for some reason).

So my fix was to add a file in /etc/profile.d called screen.sh (the name doesn't matter) with:

Code: Select all

xset -display :0 s off
xset -display :0 s noblank
xset -display :0 -dpms
unclutter -display :0 &
It's a bit of a hack but works for me. :D

david_1234
Posts: 658
Joined: Mon Jan 01, 2018 2:14 pm

Re: How to disable screen blanking ?

Thu Sep 26, 2019 8:59 am

I'm having the same problem
I have try this 2 options:

Code: Select all

/home/pi/.config/lxsession/LXDE-pi/autostart

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
@xset s noblank
point-rpi
@chromium-browser --start-fullscreen --start-maximized /home/pi/angular-node/src/startPage.html

@lxterminal -e /usr/bin/python3 /home/pi/mu_code/MyProgram/Startup.py

Code: Select all


@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
@xset s noblank
@xset s off
@set s 0
@xset-dpms
point-rpi

@chromium-browser --start-fullscreen --start-maximized /home/pi/angular-node/src/startPage.html
@lxterminal -e /usr/bin/python3 /home/pi/mu_code/MyProgram/Startup.py
but after a few min the screen turn to black

why ?
what is wrong?

the screen didn't turn off for 2 months , but yesterday I did update&&upgrade
and then is start to make problems

is there any connection between?

I really need your help - this is a working disaply station

I'm ruuning

Code: Select all

 cat /etc/debian_version
9.9
pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

warpdesign
Posts: 17
Joined: Sat Sep 29, 2012 7:53 pm

Re: How to disable screen blanking ?

Fri Sep 27, 2019 7:36 am

I am having the same problem: after some time the screen turns black instead of going in stand by mode. It means it's always on unless I power it off myself.

I looked at the solutions but none worked. I could not add the lines in /home/pi/.config/lxsession/LXDE-pi/autostart because this file doesn't exist on my installation. Maybe that's because I installed xfce?

klricks
Posts: 8648
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: How to disable screen blanking ?

Fri Sep 27, 2019 1:18 pm

warpdesign wrote:
Fri Sep 27, 2019 7:36 am
I am having the same problem: after some time the screen turns black instead of going in stand by mode. It means it's always on unless I power it off myself.

I looked at the solutions but none worked. I could not add the lines in /home/pi/.config/lxsession/LXDE-pi/autostart because this file doesn't exist on my installation. Maybe that's because I installed xfce?

Rapsbian now uses a different autostart location:

Code: Select all

/etc/xdg/lxsession/LXDE-pi/autostart


By default there is no standby mode. Only screen blanking which just turns the pixels black.
If you have a RPi3 or older then adding the following to /boot/config.txt will turn off HDMI when the screen blanks:

Code: Select all

hdmi_blanking=1
This will make the display use its own standby mode, but once the monitor turns itself off, you may need to turn the monitor back on using the physical power button or remote.
The above does not work on a RPi4.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

notna999
Posts: 2
Joined: Sun May 10, 2020 4:12 pm

Re: How to disable screen blanking ?

Sun May 10, 2020 4:29 pm

Hey Hippy, same thing happened to me, how did you delete that file when screen is black?
hippy wrote:
Mon Jan 14, 2019 1:58 am
klricks wrote:
Wed Apr 25, 2018 1:11 am
Edit with nano editor:

Code: Select all

nano /home/pi/.config/lxsession/LXDE-pi/autostart
Add these 3 lines at the end:

Code: Select all

@xset s noblank
@xset s off
@xset s -dpms
Save and exit CTRL x Y
I could have sworn this also worked for me when I tried it earlier this year, but on a virgin Raspbian Desktop install ( image not NOOBS, no recommended software, updated to today, boot to GUI ), creating that file ( it didn't already exist ) with those contents just leaves me with a black screen after a reboot, albeit that the mouse cursor is there. Delete the file and reboot and everything is fine again.

Any ideas or suggestion on how to debug, find out what's wrong, or make it work ?

klricks
Posts: 8648
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: How to disable screen blanking ?

Mon May 11, 2020 1:59 pm

notna999 wrote:
Sun May 10, 2020 4:29 pm
Hey Hippy, same thing happened to me, how did you delete that file when screen is black?
....
If you mean you are geetting the gray openbox screen on boot, then right click on the screen and choose terminal.

Note that screen blanking can now be disabled using the GUI config tool or sudo raspi-config.... No need to edit any files.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

Return to “Raspberry Pi OS”