0

I have been working with my RasPI 3 (using Jessie) for a little while on a project that I am SO CLOSE to finishing. Right now the main problem I am having is that I cannot keep the frigging screen from blacking out. I've managed to get the settings to work in the command line. But when I have made a script, it doesn't work (the script runs, but the power settings don't change).

A bit of background the project is using a 3.5" TFT screen so there is one odd command in there that I need (I'm guessing, I'm really at the point where I am plugging random code in and seeing what works). Anyway, if I go into the console and type these commands individually my screen stays on

export DISPLAY=:0
xset s noblank
xset s off
xset -dpms

I have put this in a startup script called startup.sh which I can run with a bash command. But my problem is that I have tried to have this bash script run at bootup following the instructions set out here but it doesn't the screen starts going blank again. I know the command is running because I have the startup script playing a sound and booting a browser into kiosk mode, but the power settings don't change.

What that stackexchange post says is to edit ~/.config/lxsession/LXDE-

pi/autostart and add
@bash /path/to/scriptname

on a side note if a command works in the console, are you supposed to put the "@" symbol in the script or just put it in the script the way you type it in the console?

i.e. if this command works in the console

xset s noblank

Should I have it appear in the script as

@xset s noblank

or

xset s noblank

Thanks!

0

I figured this out. I had to get the script to sleep for a few seconds. I guess something was conflicting in the boot sequence. Once I let it boot up, wait for a bit of time and then run the script it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.