Work in Progress - Screensaver Disable RPI Backlight

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
SebastiansIT Offline
Junior Member
Posts: 3
Joined: Aug 2016
Reputation: 0
Post: #1
Hello,

I use a Raspberry Pi 3 together width the official 7" Display and Kodi as an audio player. At the beginning I use the screensaver "Black". But there are two problems width this:

1. The display isn't really black because the backlight is always on. So, you can see the display glowing in a dark room.
2. Touching the Display stops the screensaver and, in addition, starts the action on the screen behind the screensaver. Because of this I often switch to another song when I touch the display.

To get a better solution I wrote a new Screensaver: The Disable RPI Backlight Screensaver

This Screensaver only supports Kodi, installed on a Linux distribution (i.E. LibreElec), running on a Raspberry Pi connected to the official 7" Display. When somebody is out there with such a set-up, please test it and tell me your opinion. Thanks.


The plugin can downloaded from Github: https://github.com/sebastiansIT/RPI-Disp...sabler.zip

The source code is under GPLv3 also on Github: https://github.com/sebastiansIT/RPI-Disp...t-disabler
(This post was last modified: 2017-03-06 20:43 by SebastiansIT.)
find quote
florca Offline
Junior Member
Posts: 1
Joined: Nov 2016
Reputation: 0
Post: #2
Thanks for this - just what I was looking for, although I've adapted it slightly so that it works with a "standard" external HDMI EnergyStar-compliant monitor. To do this replace two lines in screensaver.py:

Code:
shellCommand = 'echo 1 > /sys/class/backlight/rpi_backlight/bl_power'
and
Code:
shellCommand = 'echo 0 > /sys/class/backlight/rpi_backlight/bl_power'

with...

Code:
shellCommand = 'vcgencmd display_power 0'
and
Code:
shellCommand = 'vcgencmd display_power 1'

which toggles the HDMI monitor powersaving / standby on & off from my Slice (RPi-based player)

Also - the current downloadable ZIP packaging won't allow the Addon to be manually installed, at least under Kodi 17. Needs to be structured as per here: http://stackoverflow.com/questions/28286...-incorrect with all files in a top-level folder within the ZIP named as per the Addon.

Thanks for a VERY useful addon,
Brgds Phil
find quote
SebastiansIT Offline
Junior Member
Posts: 3
Joined: Aug 2016
Reputation: 0
Post: #3
To support the package structure of Kodi 17.0, I have released an update to version 0.1.1. It's functional the same as the version 0.1.0, only changed the addon.xml and the packaging.
find quote
airvb Offline
Junior Member
Posts: 6
Joined: Oct 2014
Reputation: 0
Post: #4
Hello, to get yr screen saver works on OpenElec, OSMC, LibreElec you need to be root to send the command

i propose this

Code:
def onInit(self):
        self.log('Start Screensaver')
        self.exit_monitor = self.ExitMonitor(self.exit)
        shellCommand = 'echo 1 > /sys/class/backlight/rpi_backlight/bl_power'
    if os.geteuid() != 0:
        shellCommand = 'sudo bash -c \'' + shellCommand + '\''      
    os.system(shellCommand)

    def exit(self):
        self.exit_monitor = None
        shellCommand = 'echo 0 > /sys/class/backlight/rpi_backlight/bl_power'
    if os.geteuid() != 0:    
        shellCommand = 'sudo bash -c \'' + shellCommand + '\''
    os.system(shellCommand)
        self.close()
        self.log('Stop Screensaver')

inspired by https://github.com/marklam/PiTsOff/blob/...ensaver.py

Working on my OSMC box !

@+
find quote
SebastiansIT Offline
Junior Member
Posts: 3
Joined: Aug 2016
Reputation: 0
Post: #5
Hi airvb,

thanks for your tip. Can you tell me in which distribution Kodi isn't run with the root account? I use LibreElec at the moment and it works well without sudo.
find quote
airvb Offline
Junior Member
Posts: 6
Joined: Oct 2014
Reputation: 0
Post: #6
(2017-03-27 19:11)SebastiansIT Wrote:  Hi airvb,

thanks for your tip. Can you tell me in which distribution Kodi isn't run with the root account? I use LibreElec at the moment and it works well without sudo.

I try again with OSMC fresh install without sudo tip , not working

Ok with sudo !
find quote