Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off screen after certain time #465

Open
danielkastberg opened this issue Dec 25, 2024 · 4 comments
Open

Turn off screen after certain time #465

danielkastberg opened this issue Dec 25, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@danielkastberg
Copy link

I would like to turn off the screen after midnight. Is it possible since flutter pi runs without X11 or Wayland?
I read online but all posts are mentioning something related to X11 or Wayland like "xset", "tvservice" or "xrandr" but no use since they require X11 or Wayland running.

Can this be done or do I have to turn the power off the PI during nighttime?

@DisDis
Copy link
Contributor

DisDis commented Dec 25, 2024

You can take my example of turning the screen on and off on the Pi4 https://github.com/DisDis/dslideshow/tree/master/deb_factory/template_build_arm64/opt/dslideshow/scripts

@danielkastberg
Copy link
Author

Thank you! I'm away from my PI but will test it when I get back. I used tvservice before and got "Can't find display" but then I know it should work for the flutter pi

@tryy3
Copy link

tryy3 commented Dec 31, 2024

I had a similar case and thought I would share my solution.
I am running a Pi 5 with the new Touch Screen Display 2 and I couldn't get any of the tools that people recommended (tvservice, xrandr etc.) but managed to find that I could change the brightness directly with the backlight class.

Under /sys/class/backlight/ I was able to find my display and then set the brightness to 0 or max_brightness.
So In my case I can turn it off using echo 0 | sudo tee /sys/class/backlight/11-0045/brightness and turn it on with echo 20 | sudo tee /sys/class/backlight/11-0045/brightness

In my case I wanted "screensaver" functionality so changing the brightness worked wonderful since the display is on and reactive just no brightness. So I could just make a widget that lives at the top with a GestureDetector to trigger a timer.
Your case might be a bit different though and brightness might not be enough.

@danielkastberg
Copy link
Author

You can take my example of turning the screen on and off on the Pi4 https://github.com/DisDis/dslideshow/tree/master/deb_factory/template_build_arm64/opt/dslideshow/scripts

tvservice doesn´t seem to be included anymore in Bookworm. Have been replaced with vcgencmd. Tried vcgencmd display_power 0 but vcgencmd only works with vc4-fkms-v3d.

I had a similar case and thought I would share my solution. I am running a Pi 5 with the new Touch Screen Display 2 and I couldn't get any of the tools that people recommended (tvservice, xrandr etc.) but managed to find that I could change the brightness directly with the backlight class.

Under /sys/class/backlight/ I was able to find my display and then set the brightness to 0 or max_brightness. So In my case I can turn it off using echo 0 | sudo tee /sys/class/backlight/11-0045/brightness and turn it on with echo 20 | sudo tee /sys/class/backlight/11-0045/brightness

In my case I wanted "screensaver" functionality so changing the brightness worked wonderful since the display is on and reactive just no brightness. So I could just make a widget that lives at the top with a GestureDetector to trigger a timer. Your case might be a bit different though and brightness might not be enough.

My display doesn´t show up in backlight, just an empty folder...

Also tried ddcutil but running ddcutil getvcp scan results in Display not found.
I'm using the Wavesahre 11.9 inch touch display. https://www.waveshare.com/wiki/11.9inch_Touch_Monitor
Maybe this screen just won´t work without X11...

@ardera ardera self-assigned this Jan 13, 2025
@ardera ardera added the enhancement New feature or request label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants