Prevent Your Raspberry Pi From Sleeping
14 Feb 2015You’re using your Pi and your monitor keeps going blank and it’s driving you mad.
There are various methods to accomplish this so we’ll look at a few. That way if you find one isn’t working for you, you’ll have some alternatives.
setterm - terminal blanking
On a per session basis, you can run:
This will set the timeout of your monitor to 0, which will prevent it from going to sleep.
If you get yelled at about permissions, try “sudo setterm” instead.
You might not want to enter these commands every time you boot up your Pi. In this case, open up your .bashrc file (or .extras or other custom file you might use).
At the end of the file add a new line with the setterm command you entered before.
Hit ctrl+x to exit, ‘y’ to save your changes and enter to save the file.
Note: the default value for the -blank option is 0 so it may be excluded
Now when you boot up, your monitor will never sleep.
kbd configuration - terminal blanking
Open up your configuration:
Find the line for BLANK_TIME and POWERDOWN_TIME and set them to 0.
If these lines doesn’t exist go ahead and add them.
lxde configuration - Xsession blanking
The previous methods should work for the terminal. This method should prevent your screen saver from coming on in the GUI.
Open up your lxde autostart file:
If your Pi is newer, the file you’ll need to change may be:
Add these lines:
lightdm configuration - Xsession blanking
If adding those settings to your LXDE autostart didn’t work, this might help if you’re booting straight into the GUI.
Open your lightdm configuration:
Anywhere below the [SeatDefaults] header, add:
This will set your blanking timeout to 0 and turn off your display power management signaling.