OctoBTT icon indicating copy to clipboard operation
OctoBTT copied to clipboard

Screen Sleep

Open darouss99 opened this issue 4 years ago • 15 comments

Hi,

Is there a way to configure the screen to turn off itself after 30 minutes of inactivity? If not, it will be a great feature to have inside OctoBTT, it will save the life of the screen. I don't think a screen open 24/7 will have a long life.

Thank you

darouss99 avatar Sep 04 '20 03:09 darouss99

You can do that , setting profiles in file "/home/pi/.xsession" , change the second line , for example : "xset -dpms" >>> "xset dpms 0 0 10" <<< Close the screen after 10 seconds

Parameter manual: xset dpms standby suspend off xset dpms force[standby|suspend|on|off] -dpms The -dpms option disables DPMS (Energy Star) features. +dpms The +dpms option enables DPMS (Energy Star) features. The dpms option allows the DPMS (Energy Star) parameters to be set. The option can take up to three numerical values, or the “force”flag followed by a DPMS state. The “force” flags forces the server to immediately switch to the DPMS state specified. The DPMS state can be one of ‘standby’ or ‘suspend’ , ‘off’, ‘on’ When numerical values are given, they set the inactivity period (in units of seconds) before the three modes are activated. The first value given is for the “standby”mode, the second is for the “suspend”mode, and the third is for the “off”mode. Setting these values implicitly enables the DPMS features. A value of zero disables a particular mode.

bigtreetech avatar Sep 08 '20 03:09 bigtreetech

Thank you for your answer. I add "xset dpms 0 0 10" in my .xsession file to test. It's working, the screen goes blanc but the backlight remain on.

Is there a way to turn off the backlight too?

Thank you

darouss99 avatar Sep 08 '20 03:09 darouss99

Sorry, backlight cannot be turned off completely because the screen backlight is not programmed to be turned off unless there is a separate backlight switch on the hardware to do so manually.

bigtreetech avatar Sep 08 '20 03:09 bigtreetech

Ok, so I guess we can't dim the backlight too? Maybe a great improvement for a next revision. Is the programmation can be changed or if we need to modify the backlight to add a switch or a relay?

darouss99 avatar Sep 08 '20 23:09 darouss99

Indeed, the backlight brightness and backlight switch cannot be controlled by the program at present.You can remove the R6 0 Ω resistor, replaced by a sliding rheostat brightness control can be realized, if need to increase the switch, with a switch in the circuit in series can implement switch screen backlight.

bigtreetech avatar Sep 10 '20 03:09 bigtreetech

I just tried it and it's work great. :) I will wire it to a relay and when I will turn on my printer it will turn on the backlight at the same time. Thank you for your help.

darouss99 avatar Sep 10 '20 21:09 darouss99

it would be a useful feature to be able to turn the backlight on and off by software, I use klipper and the pi is on 24/7 which means the screen is also on and while I can make it go blank it is still very bright especially at night

tobyfu avatar Oct 14 '20 21:10 tobyfu

it would be a useful feature to be able to turn the backlight on and off by software, I use klipper and the pi is on 24/7 which means the screen is also on and while I can make it go blank it is still very bright especially at night

Yes, I will add your Suggestions in the future version, please stay tuned.

bigtreetech avatar Oct 23 '20 06:10 bigtreetech

it would be a useful feature to be able to turn the backlight on and off by software, I use klipper and the pi is on 24/7 which means the screen is also on and while I can make it go blank it is still very bright especially at night

I tried to connect the control pin of the backlight of the screen with PWM controlled IO to realize the backlight brightness control. This backlight adjustment function can be realized in the future.

Shine6Z avatar Oct 23 '20 06:10 Shine6Z

I tried to connect the control pin of the backlight of the screen with PWM controlled IO to realize the backlight brightness control. This backlight adjustment function can be realized in the future.

How did you manage to do that? Do you use a transistor to switch the two pins of R6 or do you just use 3V PWM?

SHexplorer avatar Dec 21 '20 14:12 SHexplorer

there are not enough settings for the display brightness (backlight) and the option to completely turn off the backlight. Here is an implementation, https://github.com/linusg/rpi-backlight

I have BIGTREETECH PITFT50 V1.0 installed and in idle moments, the display turns black, but the backlight still lights up.

ssavickiy avatar Jan 09 '21 21:01 ssavickiy

I tried to connect the control pin of the backlight of the screen with PWM controlled IO to realize the backlight brightness control. This backlight adjustment function can be realized in the future.

How did you manage to do that? Do you use a transistor to switch the two pins of R6 or do you just use 3V PWM?

just use 3V PW

Shine6Z avatar May 07 '21 10:05 Shine6Z

it would be a useful feature to be able to turn the backlight on and off by software, I use klipper and the pi is on 24/7 which means the screen is also on and while I can make it go blank it is still very bright especially at night

I tried to connect the control pin of the backlight of the screen with PWM controlled IO to realize the backlight brightness control. This backlight adjustment function can be realized in the future.

Sorry I am not understanding here. Did you manage to get the backlight of the 1.0 screen to be controllable via Linux? If so can you please elaborate a bit? Where is the control pin for the backlight and what mechanism did you use software wise to actually control it?

Syco54645 avatar Jul 22 '21 15:07 Syco54645

it would be a useful feature to be able to turn the backlight on and off by software, I use klipper and the pi is on 24/7 which means the screen is also on and while I can make it go blank it is still very bright especially at night

I tried to connect the control pin of the backlight of the screen with PWM controlled IO to realize the backlight brightness control. This backlight adjustment function can be realized in the future.

Sorry I am not understanding here. Did you manage to get the backlight of the 1.0 screen to be controllable via Linux? If so can you please elaborate a bit? Where is the control pin for the backlight and what mechanism did you use software wise to actually control it?

The IO pin of raspberry PI controls the screen brightness control point mentioned above (where the R6 resistor is located). Raspberry PI needs to control the IO pin in PWM mode through the program to realize the brightness control of the screen. The current program has not added IO control code, so the people in need need to implement this function by themselves.

Shine6Z avatar Jul 23 '21 01:07 Shine6Z

@Shine6Z : The IO pin of raspberry PI controls the screen brightness control point mentioned above (where the R6 resistor is located). Raspberry PI needs to control the IO pin in PWM mode through the program to realize the brightness control of the screen. The current program has not added IO control code, so the people in need need to implement this function by themselves.

This is a good idea. Without a diagram, I'll attempt to repeat what you said to see if I'm right.

@bigtreetech : You can remove the R6 0 Ω resistor, replaced by a sliding rheostat brightness control can be realized, if need to increase the switch, with a switch in the circuit in series can implement switch screen backlight.

0Ω resistor basically means it's just a straight wire, interesting.

So this, along with the other statement above, means Pulse Width Modulation (PWM). which means we can operate it on a duty cycle of 0% (fully open) to 100% (fully closed), and any value in-between.

@Shine6Z : just use 3V PW

I'm not following this part. Are you saying set the RPi GPIO to PWM, at 3.3V? So, the frequency doesn't matter? Just as long as 50% duty just means 50% GND/VREF (need to measure)? That sounds easy enough.

You also mention voltage, 3.3V.

So, can one guess that this may be a simple 1-wire hack to control backlight? Take the PWM control, and connect it directly to the R6 location? Is it VREF or GND?

Is the backlight powered by this voltage / do we need to worry about the power draw of the backlight from the PWM control circuit?


Full disclosure, I have a V2.0 display of the Pi TFT50 - which has a rheostat on it for brightness. However, the 3d printed case I am using does not allow access to the knob. So I wonder if it can be "bypassed" with this PWM control.

eduncan911 avatar Dec 15 '21 20:12 eduncan911