Raspberry Pi 7” touch screen

You might still try it with a Pi3. Maybe the backlight logic has changed since I last checked.

It actually worked, copied rpi-backlight.dtbo to /config and added the userconfig.txt as suggested on a Raspberry Pi 3B with the official 7" LCD and I can now adjust backlight via /sys/devices/platform/rpi_backlight/backlight/rpi_backlight/brightness

Next question: Do you have a suggestion on how to adjust it depending on time of day since crontab does not seem to be available?

Correct. There’s no cron. Any kind of custom code has to use the package mechanism. In your case that would require the following. A new package containing at least:

  • An empty node.lua, as there is no graphical output
  • A 64x64 package.png
  • A package.json
  • A mostly empty node.json. As you need to write to /sys you must specify the run-as-root and unboxed permissions.
  • A service file which is then executed on the device. This might be a shell script or python. The native timezone is always UTC. The simplest implementation might be:
    #!/bin/sh
    while true; do
      HOUR=`date +%H` # hour in UTC timezone
      if [[ $HOUR -le 6 || $HOUR -ge 22 ]]; then
         echo dark > /sys/whatever
      else
         echo light > /sys/whatever
      fi
      sleep 60
    done
    
    

Package all up in a ZIP file somewhere, then import by url from the package list page. Add that package to an existing setup and it will be deployed to a device alongside your other content.

1 Like