Difference between revisions of "Raspberry Pi 4 - Screen Blanking manually via command line 2023"
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
* Tested on Raspberry Pi 4 (Jan 18, 2023) | * Tested on Raspberry Pi 4 (Jan 18, 2023) | ||
+ | |||
+ | ==Disable and Enable Screen Blanking on RPi 4== | ||
'''Enable screen blanking on rpi4 so screen will automatically sleep after a while''' | '''Enable screen blanking on rpi4 so screen will automatically sleep after a while''' | ||
Line 9: | Line 11: | ||
export DISPLAY=:0;xset s noblank; xset s off; xset -dpms | export DISPLAY=:0;xset s noblank; xset s off; xset -dpms | ||
− | ==Description of xset screen blanking commands on raspberry pi== | + | ===Description of xset screen blanking commands on raspberry pi=== |
* xset s noblank | * xset s noblank | ||
** Sets the screen to not blank | ** Sets the screen to not blank | ||
Line 21: | Line 23: | ||
** (not sure) I think this is +dpms but also forces the monitor to turn on. | ** (not sure) I think this is +dpms but also forces the monitor to turn on. | ||
− | ==Auto start== | + | ===Auto start=== |
This command does not persist reboots. To run on every boot, create a script and add it to your startup items in your GUI. Or add to crontab -e on startup. Or make a systemd startup script. rc.local may even work if you're lazy. | This command does not persist reboots. To run on every boot, create a script and add it to your startup items in your GUI. Or add to crontab -e on startup. Or make a systemd startup script. rc.local may even work if you're lazy. | ||
+ | |||
+ | ==Disable RPi screen blanking in console== | ||
+ | '''This section is for an older Pi, I haven't tested on Pi 4''' | ||
+ | |||
+ | If your screen goes black during command line after 30 minutes or so, you have screen blanking enabled most likely. If you want to turn it off: | ||
+ | |||
+ | Edit the file '''/etc/kbd/config''' | ||
+ | Change these lines: | ||
+ | BLANK_TIME=0 | ||
+ | BLANK_DPMS=off | ||
+ | POWERDOWN_TIME=0 | ||
+ | |||
==Troubleshooting== | ==Troubleshooting== | ||
Line 32: | Line 46: | ||
==External Links== | ==External Links== | ||
− | [https://pimylifeup.com/raspberry-pi-disable-screen-blanking/|Screen Blanking - this helped me a ton] | + | [https://pimylifeup.com/raspberry-pi-disable-screen-blanking/| Screen Blanking - this helped me a ton] |
− | [https://www.geeks3d.com/hacklab/20160108/how-to-disable-the-blank-screen-on-raspberry-pi-raspbian/|Disable screen blanking - includes with auto-start] | + | |
+ | [https://www.geeks3d.com/hacklab/20160108/how-to-disable-the-blank-screen-on-raspberry-pi-raspbian/| Disable screen blanking - includes with auto-start] | ||
[[Category:Raspberry Pi]] | [[Category:Raspberry Pi]] |
Latest revision as of 18:59, 18 January 2023
This is how to disable screen blanking on Raspberry Pi in 2023. This would go in a crontab or can be manually run via the command line. I wanted my rpi screen to power off at night, then be on all day. Most guides seemed confusing, and raspi-config didn't seem to actually do screen blanking for some reason. This was my solution.
- Tested on Raspberry Pi 4 (Jan 18, 2023)
Contents
Disable and Enable Screen Blanking on RPi 4
Enable screen blanking on rpi4 so screen will automatically sleep after a while
export DISPLAY=:0; xset +dpms; xset s blank; xset s off; xset dpms force on
Disable screen blanking on rpi 4 so screen is always on
export DISPLAY=:0;xset s noblank; xset s off; xset -dpms
Description of xset screen blanking commands on raspberry pi
- xset s noblank
- Sets the screen to not blank
- xset s off
- Sets the screensaver off (if applicable)
- xset -dpms
- Turns off Display Power Management (dpms won't trigger the screen to sleep)
- xset +dpms
- This forces Display Power Management to kick in and sleep the monitor after a while
- xset dpms force on
- (not sure) I think this is +dpms but also forces the monitor to turn on.
Auto start
This command does not persist reboots. To run on every boot, create a script and add it to your startup items in your GUI. Or add to crontab -e on startup. Or make a systemd startup script. rc.local may even work if you're lazy.
Disable RPi screen blanking in console
This section is for an older Pi, I haven't tested on Pi 4
If your screen goes black during command line after 30 minutes or so, you have screen blanking enabled most likely. If you want to turn it off:
Edit the file /etc/kbd/config Change these lines:
BLANK_TIME=0 BLANK_DPMS=off POWERDOWN_TIME=0
Troubleshooting
Allow 15 minutes with each setting to see if the screen goes/doesn't go blank in the way you want. There may be other things that blank your screen, like system settings in MATE or other DE's, so look there too.
- Disable screen blanking in raspi-config
- Disable screensaver app, and in settings uncheck DPMS
- Check system settings (MATE or Lubuntu power settings etc)
- export DISPLAY=:0 is only needed if you run it via crontab or SSH.