-1

I have the official 7" touchscreen installed on a Pi 3B running Strech V9.

I have installed the touchscreen-dimmer project from the Github repository & followed the readme.me

the screen dims OK when I run

sudo ./timeout 10 15 event0

I have copied timeout & run-dimmer.sh to /etc/ & added: /etc/run-dimmer.sh to /etc/rc.local

I have run the command:

sudo su -c 'echo SUBSYSTEM==\"backlight\", RUN+=\"/bin/chmod 0666 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power\" > /etc/udev/rules.d/99-backlight.rules'

I got no feedback or error when I ran this command? Is this right?

I have ls installed & working.

I am using the default time & levels in run-dimmer.sh.

The upshot is that the screen does not dim after 30 secs.

What am I doing wrong?

3
  • Try my version github.com/DougieLawson/backlight_dimmer
    – Dougie
    Commented Aug 1, 2020 at 13:37
  • "I got no feedback or error when I ran this command?" That command just writes a udev configuration file. You might have to run sudo udevadm control --reload-rules or reboot to make it effective.
    – goldilocks
    Commented Aug 1, 2020 at 14:31
  • I tried Doug's file as is & got the same result - ie no dimming. Commented Aug 1, 2020 at 18:35

1 Answer 1

0

I have modified the file permissions on /etc/timeout & /etc/run-dimmer.sh so that they have -rwxrwsrwx 1 root root 1151. (/etc/run_dimmer.sh is coloured orange).

File permissions for /etc/timeout are: -rwxrwsrwx 1 root root 12684

I can run /etc/./run-dimmer.sh in a terminal window & it executes & the screen dims after 30 secs.

However, when I add /etc/./run-dimmer.sh or cd /etc ./run-dimmer.sh

to /etc/rc.local it doesn't work.

I'm not sure what to do to run run-dimmer.sh from rc.local

I tried Doug Lawson's app and followed his readme.md but it still won't execute from within rc.local

I have now got this fully working using Doug's app but I had to modify Doug's script to explicitly point to event0, rather than using the $dev variable to wake up the screen on touch. I am running the script from etc/profile, not rc.local. I also found an issue. If the pi is rebooted with the screen blanked it does not come back to full brightness. I fixed this by writing a script that runs the command echo 120 > /sys/class/backlight/rpi_backlight/brightness. I also put this script into /etc/profile and ran it before the display dimmer.

2
  • Got Doug's version to work by running it from /etc/profiles as run-timeout.sh &. I had to replace $dev in the nice command line with event0 to re-enable the screen on touch. Commented Aug 3, 2020 at 15:42
  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Commented Aug 10, 2020 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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