aristosv
Posts: 159
Joined: Mon Dec 08, 2014 7:47 pm

how to stop the screen from going blank on a lite system running x

Thu Dec 13, 2018 10:48 am

I installed Raspbian Stretch Lite (2018-11-13)
Then I installed xinit and chromium (sudo apt-get install -y xinit chromium-browser)

Now I start cromium, on demand basis, to show a website on the TV the raspberry pi is connected. I basically handle this as a service and it works great! I can get the status, stop and start it on a schedule, It works!

Code: Select all

[Unit]
Description=browser
After=network.target
[Service]
ExecStart=/bin/bash -c "export DISPLAY=:0.0 ; sudo startx /usr/bin/chromium-browser $website --no-sandbox --window-size=9000,9000 --start-fullscreen --kiosk --incognito --noerrdialogs --no-first-run --translate-script-url --fast --fast-start --disable-infobars --disk-cache-dir=/dev/null"
Restart=always
[Install]
WantedBy=multi-user.target
My problem is that after a few minutes, the screen goes blank.
So this is what I tried so far to fix this.

I placed these three lines in /etc/rc.local so they run during boot.

Code: Select all

xset -dpms
xset s off
xset s noblank
I also placed them in /etc/X11/Xsession.options and in /etc/X11/xinit/xserverrc
I also placed xset s noblank before the command sudo startx /usr/bin/chromium-browser runs in the service file above.

But none of these attempts worked. And I googled it a lot. Many of the suggestions I found, are to modify files that don't even exist on my system. Most probably because its the lite version.

Any suggestions?

Andyroo

Re: how to stop the screen from going blank on a lite system running x

Thu Dec 13, 2018 11:29 am

What desktop are you running?

From the apt-get you have the xwindow startup program but no window manager.

You could try the

Code: Select all

startx
command to see if that makes a difference.

aristosv
Posts: 159
Joined: Mon Dec 08, 2014 7:47 pm

Re: how to stop the screen from going blank on a lite system running x

Thu Dec 13, 2018 11:53 am

What do you mean? I'm already using startx just to display the browser window in kiosk mode.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: how to stop the screen from going blank on a lite system running x

Thu Dec 13, 2018 12:31 pm

As you have already done everything I know of to prevent X from blanking, have you looked at other power management outside of X that X may be obeying? I expected there to be something at the kernel command line, though looking at the cmdline.txt files on my Raspbian setups I do not see anything.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

aristosv
Posts: 159
Joined: Mon Dec 08, 2014 7:47 pm

Re: how to stop the screen from going blank on a lite system running x

Thu Dec 13, 2018 1:57 pm

I did try this suggestion http://www.pihome.eu/2017/10/11/raspber ... imisation/ to disable power management but it made no difference.

aristosv
Posts: 159
Joined: Mon Dec 08, 2014 7:47 pm

Re: how to stop the screen from going blank on a lite system running x

Thu Dec 13, 2018 3:34 pm

Unfortunately I had to go with a workaround, even through I don't like them, and installed xdotool to simulate a key press every 5 minutes.

Code: Select all

[Unit]
Description=browser
After=network.target
[Service]
ExecStart=/bin/bash -c "export DISPLAY=:0.0 ; sudo startx /usr/bin/chromium-browser gmail.com -no-sandbox --window-size=9000,9000 --start-fullscree$
ExecStartPost=/bin/bash -c "while true; do export DISPLAY=:0.0 ; sudo xdotool sleep 300 key Ctrl; done &"
Restart=always
[Install]
WantedBy=multi-user.target
If anyone figures out a better way please reply.

Return to “General discussion”