pi_lover
Posts: 75
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: 10178
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: 75
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?

B.Goode
Posts: 6986
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: 75
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: 6145
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

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 Raspbian Stretch w/ Desktop OS.

pi_lover
Posts: 75
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: 4459
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: 6145
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

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 Raspbian Stretch w/ Desktop OS.

hippy
Posts: 4459
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.

Return to “Raspbian”