steve103
Posts: 16
Joined: Sun Oct 29, 2017 1:11 pm

How prevent screen going blank with raspian stretch?

Thu Jan 18, 2018 7:10 am

I open a terminal and run a java app from the command line (java -jar...)
After a few minutes the screen goes blank. I assume the pi goes to sleep?

I require that the display stays on the screen (do not require a screensaver also).
I have seen some mails on jessie and wheezy and have not been able to prevent the display
going blank.
have tried (in the command terminal prior to running app), e.g.,
setterm -powerdown 0
sudo xset s off
sudo xset -dpms
sudo xset s noblank
have also tried:
xserver-command=X -s 0 dpms (in /etc/lightdm/lightdm.conf)


Would you know how this can be resolved?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23950
Joined: Sat Jul 30, 2011 7:41 pm

Re: How prevent screen going blank with raspian stretch?

Thu Jan 18, 2018 10:35 am

Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

steve103
Posts: 16
Joined: Sun Oct 29, 2017 1:11 pm

Re: How prevent screen going blank with raspian stretch?

Mon Jan 22, 2018 7:47 am

have prevented display going blank after 10 minutes using:

xset s off
xset -dpms
xset s noblank

The display still goes blank after a few hours. Would you have an idea why this might be the case?

n.b. am booting to desktop. - (not console).

thank you

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

Re: How prevent screen going blank with raspian stretch?

Mon Jan 22, 2018 1:40 pm

Install xcreensaver then on the main preferences page set MODE: Disable Screen Saver

Code: Select all

sudo apt update
sudo apt install xscreensaver
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

steve103
Posts: 16
Joined: Sun Oct 29, 2017 1:11 pm

Re: How prevent screen going blank with raspian stretch?

Mon Jan 29, 2018 7:33 am

I have tried the xscreensaver as in previous note.
However the display goes blank after 3-4 hours.
Would you know what is causing this? how can be fixed?
thank you

bmeissen
Posts: 7
Joined: Mon Mar 26, 2018 1:25 am

Re: How prevent screen going blank with raspian stretch?

Wed Mar 28, 2018 1:14 am

Bumping this up - I've been trying for a few days now to get my model 3B+ to keep the screen on and for the life of me every suggestion does not work.

Paul Hutch
Posts: 402
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: How prevent screen going blank with raspian stretch?

Fri Apr 06, 2018 11:51 pm

This week I got my two 3B's running Stretch with Desktop and my Raspberry Pi Desktop Virtual Machine all keeping the screen on.
  1. Install xscreensaver.
    For the VM I was able to install it from Preferences - > Add/Remove Software
    For the 3B's I had to use klricks command line instructions from above
  2. Reboot so that the xscreensaver service is running
  3. Open the screensaver settings program Preferences - > Screensaver
  4. In the upper left of the Display Modes tab set the Mode: drop down list to Disable Screen Saver
  5. On the Advanced tab uncheck the Power Management Enabled box

tony1812
Posts: 354
Joined: Sat Jul 15, 2017 12:40 pm
Location: Boston MA.

Re: How prevent screen going blank with raspian stretch?

Sat Apr 07, 2018 12:47 am

I hated the auto blank as well but don't go the xscreensaver route. just another piece of junk to take up space.
Edit this file /home/pi/.config/lxsession/LDXE-pi/autostart, be sure you use this path. There is another autostart file somewhere else, that is the wrong autostart file.
add

@xset s noblank
@xset s off
@xset -dpms

reboot

This works great on my pi3 stretch.

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: How prevent screen going blank with raspian stretch?

Sun Apr 08, 2018 3:50 am

tony1812 wrote:
Sat Apr 07, 2018 12:47 am
Edit this file /home/pi/.config/lxsession/LDXE-pi/autostart, be sure you use this path.
do not use this path!

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

Re: How prevent screen going blank with raspian stretch?

Sun Apr 08, 2018 4:14 am

tony1812 wrote:
Sat Apr 07, 2018 12:47 am
I hated the auto blank as well but don't go the xscreensaver route. just another piece of junk to take up space.
Edit this file /home/pi/.config/lxsession/LXDE-pi/autostart, be sure you use this path. There is another autostart file somewhere else, that is the wrong autostart file.
add

@xset s noblank
@xset s off
@xset -dpms

reboot

This works great on my pi3 stretch.
Please edit your post and correct the path....
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

alphanumeric
Posts: 2116
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: How prevent screen going blank with raspian stretch?

Sun Apr 08, 2018 12:03 pm

xscreensaver will not install for me? Something about not available but referred to by another package?
E: Package 'xscreensaver' has no installation candidate
Latest Stretch release updated and upgraded.

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

Re: How prevent screen going blank with raspian stretch?

Sun Apr 08, 2018 12:44 pm

alphanumeric wrote:
Sun Apr 08, 2018 12:03 pm
xscreensaver will not install for me? Something about not available but referred to by another package?
E: Package 'xscreensaver' has no installation candidate
Latest Stretch release updated and upgraded.
Run sudo apt update and try again.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

alphanumeric
Posts: 2116
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: How prevent screen going blank with raspian stretch?

Sun Apr 08, 2018 1:07 pm

I did a sudo apt-get update sudo apt get upgrade prior to trying to install xscreensaver. It's doing that on several Pi's that I just did fresh installs on. Will try it again though.

alphanumeric
Posts: 2116
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: How prevent screen going blank with raspian stretch?

Sun Apr 08, 2018 1:11 pm

Installing now? I had just done the update upgrade yesterday, is normal to have to do that more than once after a fresh image?

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

Re: How prevent screen going blank with raspian stretch?

Sun Apr 08, 2018 1:17 pm

It may not be 'normal', but my understanding is that a recent upgrade operation changed the locations of some of the repository sources, so that a further update was needed to activate them for access by your package manager.

alphanumeric
Posts: 2116
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: How prevent screen going blank with raspian stretch?

Sun Apr 08, 2018 1:29 pm

Oh well, problem solved anyway. I'm just redoing a couple of other Pi's I did new images on yesterday. It looks like 4 packages are being updated and then the screensaver installs Ok. I would have likely tried it again at some point. The screen constantly blanking while your doing something is a bit annoying.

EinSoldiatGott
Posts: 10
Joined: Sat May 27, 2017 5:24 am

Re: How prevent screen going blank with raspian stretch?

Sun Dec 30, 2018 5:19 am

klricks wrote:
Sun Apr 08, 2018 4:14 am
tony1812 wrote:
Sat Apr 07, 2018 12:47 am
I hated the auto blank as well but don't go the xscreensaver route. just another piece of junk to take up space.
Edit this file /home/pi/.config/lxsession/LXDE-pi/autostart, be sure you use this path. There is another autostart file somewhere else, that is the wrong autostart file.
add

@xset s noblank
@xset s off
@xset -dpms

reboot

This works great on my pi3 stretch.
Please edit your post and correct the path....
The path is not valid for raspbian 4.14

Code: Select all

[email protected]:~ $ cd  /home/pi/.config/
[email protected]:~/.config $ dir
chromium  lxpanel  lxterminal  user-dirs.dirs  user-dirs.locale

[email protected]:~ $ sudo find / -name "autostart"
find: ‘/proc/706/task/706/net’: Argumento inválido
find: ‘/proc/706/net’: Argumento inválido
find: ‘/run/user/1000/gvfs’: Permiso denegado
/etc/xdg/lxsession/LXDE/autostart
/etc/xdg/lxsession/LXDE-pi/autostart
/etc/xdg/openbox/autostart
/etc/xdg/autostart
/etc/xdg/lxsession/LXDE-pi/autostart worked for me

Best regards
Last edited by EinSoldiatGott on Sun Dec 30, 2018 6:29 am, edited 1 time in total.

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

Re: How prevent screen going blank with raspian stretch?

Sun Dec 30, 2018 5:51 am

After the last update the autostart to use now is:

Code: Select all

/etc/xdg/lxsession/LXDE-pi/autostart
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

Return to “Beginners”