42

I am working on a project similar to the one at http://www.instructables.com/id/Raspberry-Pi-Wall-Mounted-Google-Calendar/?ALLSTEPS

Similarly, I need my pi to stay on constantly. I have the regular Raspbian OS installed and I am using Iceweasel browser to run a web application all day.

I have tried every single one of these suggestions from this link http://www.bitpi.co/2015/02/14/prevent-raspberry-pi-from-sleeping/

Yet the pi fails to stay on longer than 10 minutes. Any help would be greatly appreciated.

Javed Ali
  • 1,510
  • 2
  • 12
  • 18

7 Answers7

75

I installed xscreensaver

  1. sudo apt-get install xscreensaver
  2. Once installed, go to Rpi's desktop "Menu" (left top corner)
  3. Go to preference --> screensaver.
  4. You will see a screen saver main menu. In the mode drop-down menu, select "disable screensaver" then close the window.
  5. Reboot the Raspberry PI.

It should work now.

Cardinal System
  • 2,749
  • 3
  • 21
  • 42
Javed Ali
  • 1,510
  • 2
  • 12
  • 18
  • 3
    It would be helpful to add info on how to set xscreensaver to disable the screensaver through the command line too, for those who don't boot into the PIXEL desktop. – mikevanis Nov 28 '17 at 16:03
  • For a lightweight console-only solution, you could try `setterm -blank 0` – irbanana Mar 21 '18 at 11:14
  • You'll be asked if you wish to incarnate the daemon, politely hit cancel. Specially in low power devices like the Pi Zero. – Ray Foss Jan 17 '19 at 15:30
25

You don't need to install lib, just edit lightdm

1 - Open lightdm using your prefer text editor, eg using default editor(nano).:

sudo nano /etc/lightdm/lightdm.conf

2 - Add this line

xserver-command=X -s 0 -p 0 -dpms

Magnus
  • 2,016
  • 24
  • 32
Paulo Victor
  • 3,814
  • 2
  • 26
  • 29
13

I recently installed Raspian Buster with Desktop (circa 2019-September) - the smaller install with the Desktop, but without the "recommended software". I found there are two settings that have to be changed as either one of them will blank the screen in ten minutes under the default settings.
set screen saver timeout to zero:

xset s 0

and set dpms (EnergyStar) to disabled:

xset -dpms

This way I haven't needed to install anything (no screensaver). It was confusing because I'd tried both items, but it wasn't until I learned they both were blanking the screen at ten minutes that I saw what was going on.
As this has tested out OK, the next step for me is to put them into an autostart routine.
ps Verify your settings with

xset q
Pete Kelley
  • 3,713
  • 2
  • 16
  • 17
  • If you get an `unable to open display` error, you may need to set your display variable with `export DISPLAY=:0` (or whichever display). You can also do this inline like so: `DISPLAY=:0 xset s 0` – Sam Boyne Mar 26 '21 at 02:14
  • this is perfect! works great on Raspberry Pi 400 running Raspbian GNU/Linux 10 (buster) / Linux 5.10.17, I don't want to install anything extra, don't want to use valuable resources – Alex Apr 06 '21 at 04:41
4

Without installing anything, official Raspberry Pi doc:

On the Console If you are using the Raspberry Pi solely on the console (no desktop GUI), you need to set the console blanking. The current setting, in seconds, can be displayed using

cat /sys/module/kernel/parameters/consoleblank

Here, consoleblank is a kernel parameter. In order to be permanently set, it needs to be defined on the kernel command line.

sudo nano /boot/cmdline.txt

Add consoleblank=0 to turn screen blanking off completely, or edit it to set the number of seconds of inactivity before the console will blank. Note the kernel command line must be a single line of text.

https://www.raspberrypi.org/documentation/configuration/screensaver.md

Ray Foss
  • 3,649
  • 3
  • 30
  • 31
  • @Magnus this worked for me in the default LXDE GUI of raspbian – Ray Foss Jul 25 '20 at 06:38
  • we have 10+ RB 4b and none of them seems to care about this - also the link you have clearly says "edit it to set the number of seconds of inactivity before the console will blank." - seeming also to point to the fact that this doesn't involve X11 – Magnus Jul 30 '20 at 06:37
1

Simply enter the config with sudo raspi-config and disable screen blanking in the display settings.

0

I've created a picture frame with a pi 3 and want to stop the screen going blank. I installed xscreensaver as in answer 22 and it's working a treat:

sudo apt-get install xscreensaver

After install, went to Rpi's desktop "Menu" (left top corner)

Went to preference ---> screensaver.

Then In mode : section, selected "disable screensaver" and closed.

Rebooted Rpi.

0

I had the same issue with Raspbian OS that was installed on raspberry Pi device. I just installed xscreensaver by using the following command in default Command panel.

sudo apt-get install xscreensaver

After installation is completed, Go to the menu in the left corner and select preference. First time you will see a pop up to enable xscreensaver on your screen. Just accept it. After that you can disable the screensaver.

Chamila Maddumage
  • 3,304
  • 2
  • 32
  • 43