Touchscreen is not blanking

I originally setup my VenusOS system back in about June of 2021 and everything worked just fine. I have a RPi 3B+ and a Waveshare 5” touch screen. It doesn’t seem to have proper backlight control but it would at least show a black screen after 30 seconds.

Last month I needed to reinstall VenusOS from scratch. I set it up with GUI V1 (not V2). Everything is working except I no longer get a black screen after 30 seconds (or whatever value is set for “Display off time”). I’ve tried many things over several hours to get this working again but I’m stuck and hoping someone can help.

Settings → Firmware shows v3.67

I’ve installed and setup RpiDisplaySetup and GuiMods (from @kwindrem ). I’ve reviewed the info at venus-os-configuration/docs/Touchscreen-Sleep.md at main · ldenisey/venus-os-configuration · GitHub and even dug up an old thread at Found a Raspberry Pi LCD touchscreen that needs no drivers or configuration - VictronEnergy

/u-boot/config.txt looks like this:

kernel=u-boot.bin

[pi2]
device_tree=bcm2709-rpi-2-b.dtb

[pi3]
device_tree=bcm2710-rpi-3-b.dtb
dtoverlay=miniuart-bt
core_freq=400
core_freq_min=400

[pi3+]
device_tree=bcm2710-rpi-3-b-plus.dtb

[pi02]
device_tree=bcm2710-rpi-zero-2-w.dtb
dtoverlay=miniuart-bt,krnbt=on

[all]
dtparam=spi=on

hdmi_blanking=1
#### RpiDisplaySetup begin
disable_overscan=1
# allow HDMI display to enter low powr mode
hdmi_blanking=1
hdmi_force_hotplug=1
hdmi_group=0
#### RpiDisplaySetup end

The command cat /etc/venus/blank_display_device gives:

/sys/class/graphics/fb0/blank

The command cat /etc/venus/backlight_device gives:

/sys/class/backlight/rpi_backlight

The most recent time I ran /data/RpiDisplaySetup/setup looked like this:

--- starting setup script v3.16 action: NONE

messages are NOT written to log file - only to console

patching QtQuick 1.1 to QtQuick 2 in all .qml replacements

This package sets up the Raspberry PI for the offical RPI touchscreen
  and for some other DSI or HDMI displays
Some hand editing of config.txt may be needed for an HDMI display

The screen saver will switch to a black screen
  with the backlight still on for HDMI displays that do not support standby
Display brighness controll is enabled only for the RPI touchscreen

Uninstalling disables the local display (sets headless)

Available actions:
  Install and activate (i)
  Reinstall (r) based on options provided at last install
  Uninstall (u) and restores all files to stock
  Quit (q) without further action
  Display log (l) outputs the last 100 lines of the log

Choose an action from the list above: i

This script supports the following displays:
    (R) Raspberry PI touchscreen - may also work with other DSI displays
    (H) HDMI display connected to port 0 (closest to power connector)
    (C) skip display configuration and run touch screen calibration only

Choose a display from the list above (R / H / C): H

HDMI displays require configuration lines to be added to /u-boot/config.txt
  and may also require toush screen calibraiton

HDMI mode
  some displays will automatically configure (A)
  some will conform to predefined settings (P)
  others will require custom configuration settings (C)

Select the HDMI mode from the above list (A / P / C): A
Rotate the display 180 degrees (y/n)?: n
Enter custom blanking and dimming devices (y/n)?: y
enter blanking device (/sys/class/...): /sys/class/graphics/fb0/blank
enter dimming device (/sys/class/...): /sys/class/backlight/rpi_backlight

Touch screen calibration requires the ts_calibtate utility from tsLib
  and temporariliy turning off the local GUI. System must reboot twice

Do you want to calibrate the touch screen (y/n)?: n
++ Installing display config to /u-boot/config.txt for display: HDMI
updating config.txt
using custom blank_display_device file: /sys/class/graphics/fb0/blank
using custom backlight_device file: /sys/class/backlight/rpi_backlight
disabling AutoBrightness
Reboot system now (y) or do it manually later (n): n
system must be rebooted to finish installation and activate components
reboot needed to complete operaiton

I checked a few things then executed the reboot command. I’m still not getting a black screen. The GUI simply stays in view at all times.

I previously tried running /data/RpiDisplaySetup/setup by choosing the Raspberry Pi touchscreen instead of HDMI but it made no difference. Everything worked but no black screen ever.

When referencing the Gui V1 fix there is a reference to a file named /etc/venus/blank_display_device.in. I do not have that file and the sed command fails due to the missing file.

Does anyone have any suggestions to help get the display to go blank again?

Yeah! I got it working finally. After some more poking around I found Issue #12 for the RpiDisplaySetup project. Despite the fact that that issue is related to the Waveshare 7" HDMI display, the solution is working for my Waveshare 5" DSI display.

I uninstalled RpiDisplaySetup and then installed it again. I chose a custom HDMI install. Before rebooting I changed the contents of /etc/venus/blank_display_device from /sys/class/graphics/fb0/blank to /sys/class/graphics/fb1/blank. I then rebooted and once everything was displaying, the screen went black after 30 seconds (the value for “Display off time”).

The screen was very bright so I ended up changing the brightness with:

echo 10 > /sys/devices/platform/rpi_backlight/backlight/rpi_backlight/brightness

which replaced the default brightness of 255.

The relevant section of my /u-boot/config.txt is:

disable_overscan=1
# allow HDMI display to enter low powr mode
hdmi_blanking=1
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt=800 480 60 3 0 0 0
hdmi_drive=1

I don’t recall needing that much in my setup from years ago but it works so I’m not messing with it any more. It’s weird that a supposed DSI display needs to be setup as an HDMI display but whatever. It works well enough. The backlight is still on but at least the screen is blank.