Touchscreen backlight control on raspberry pi

Entering

echo 1 > /sys/class/backlight/rpi_backlight/bl_power

manually works, but is there a screen blanker or energy option to turn off backlight after n minutes and switch it on as soon as any UI interaction occurs?

No – but I think that’s a different question altogether. This post was concerning control of backlight via sysfs. You may be able to write a script to do this however.

Just to wrap up: everything is there and working fine:

  • overerlay is active in recent version of OSMC
  • I installed the addon screenblanker PiTsOff from user marklam (see post above) via zip and it works like a charm. (I wished this was included in the standard Pi OSMC distribution :wink:)

Thanks to all of you for this great work, have a very nice and successful new year!

3 Likes

Glad it’s working for you. If @sam_nazarko wants to put it into the distribution, I’ve no problem with that. (I can relicense the GitHub project with whatever’s compatible with osmc if necessary)

1 Like

@marklam

PitsOf works fine for me. Thankyou for that.
Is it possible to add fadein fadeout ?

for fading you could try to add a loop to de-/increase the brightness value, if supported.
but i mean there are two version of display. 1st can’t fade, 2nd can.
what’s the command for a half bright display?
the other thing, what can be a problem, that bash and hardware is not fast enough for the code.

edit:

1 Like

I know this is old but i just tried it on the most recent version of osmc/kodi. Great Work!! I’ve been trying to get this working for several days and this works PERFECT. For anyone reading keep in mind its working on the official 7" pi touchscreen. Being that the only control I have on this pi (besides web gui and ssh) is touch so i don’t want to shut the touch screen off I just want it to go black and not wear out the back light while leaving the screen responsive to touch still. Great Work!

If anyone is trying to use this with the newer OSMC releases, I’ve created a new version of the screensaver for Kodi Matrix (on the GitHub releases page).
To get the touchscreen working I had to ssh in to the insalled OSMC, and modify /boot/config.txt to use vc4-fkms-v3d instead of vc4-kms-v3d and then add lines to /boot/config-user.txt to:

  • ignore the lack of hdmi
  • turn the touch screen the other way up
  • enable the analogue audio output
hdmi_ignore_cec=1
lcd_rotate=2
dtoverlay=pisound
dtparam=audio=on

(I can’t guarantee this won’t break the video playback or anything, because I only use this pi for audio)

Hi,

Great addon here for this backlight control.
I upgraded to Osmc on Kodi 19.4 and can’t install pitsoff screensaver on this release.

Looks like it deals with Python version.

  • will an updated version of addon.xml sufficient for upgrading ?
  • do you consider to publish a new version of pittsoff ? ( edit : ok, already done Dec 21)

Best regards and thank you for your work.

Edit: I just saw that your precedent post onboard this version of python upgrade

:heartbeat: