jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2165
Joined: Thu Jul 11, 2013 2:37 pm

Re: Sleep Mode - and or turn off backlight?

Mon Nov 23, 2015 3:58 pm

@cpfeil: when you say "the display doesn't know if it's on or off", how are you determining this?

Can you post a dmesg log from the Pi in question?
Rockets are loud.
https://astro-pi.org

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Sleep Mode - and or turn off backlight?

Mon Nov 23, 2015 4:03 pm

Snyder wrote:

Code: Select all

echo 0 > /sys/class/backlight/rpi_backlight/bl_power
echo 1 > /sys/class/backlight/rpi_backlight/bl_power
I got the same error as described by Andrew earlier in this thread: Permission denied
I also tried to execute the above mentioned code with sudo but it didn´t help.
I think the problem comes from redirecting the output. The ">" operator is a redirect which is done by the shell. You'd need to login as root so you'd have a root shell that would persist through the redirect and have root permission to change the file.

Or run a bash string command with sudo such as

Code: Select all

sudo bash -c "echo 0 > /sys/class/backlight/rpi_backlight/bl_power"
Or put it in a script (Python or Shell) and run that using sudo.

Snyder
Posts: 31
Joined: Fri Sep 04, 2015 9:25 am

Re: Sleep Mode - and or turn off backlight?

Mon Nov 23, 2015 6:19 pm

Many thanks for answering so quickly. I deleted the line in /etc/udev/rules.d/backlight-permissions.rules which was supposed to give all users the permission to control the backlight. Then I entered via SSH the following commands:

Code: Select all

[email protected] ~ $ sudo echo 1 > /sys/class/backlight/rpi_backlight/bl_power
-bash: /sys/class/backlight/rpi_backlight/bl_power: Permission denied
[email protected]oomboxII ~ $ sudo bash -c "echo 1 > /sys/class/backlight/rpi_backlight/bl_power"
[email protected] ~ $ sudo bash -c "echo 0 > /sys/class/backlight/rpi_backlight/bl_power"
[email protected] ~ $ sudo bash -c "echo 1 > /sys/class/backlight/rpi_backlight/bl_power"
Write failed: Broken pipe

[Prozess beendet]
First I entered the command without:

Code: Select all

 sudo bash -c
Then I got the error "permission denied". Adding 'sudo bash -c' helped. I could turn the backlight off and back on. When I tried to turn it off again, the PI crashed again and started rebooting.

Here is the dmesg log from the boot sequence after crashing and rebooting:

http://pastebin.com/0FvsccDx

I am using a decent power supply which powers my hifiberry amp+ and the PI via GPIO pins. The PI does not crash when I disconnect the display from power supply. But I do not think that it is an issue related to power supply.

mquinteiro
Posts: 10
Joined: Thu Sep 24, 2015 12:31 pm

Re: Sleep Mode - and or turn off backlight?

Mon Nov 23, 2015 7:49 pm

gsh wrote:That's the easy bit...

echo 80 > /sys/class/backlight/rpi-backlight/brightness

With my current build (not released yet) will do that... The thing I'm having trouble with right now is getting it to correctly blank the backlight when it goes to suspend, sometimes it works sometimes not...

Gordon
Please Gordon, could you confirm that brightness control wouldn't be possible. I bought it thinking that it will and without it is absolutely unless.

Thanks

Snyder
Posts: 31
Joined: Fri Sep 04, 2015 9:25 am

Re: Sleep Mode - and or turn off backlight?

Tue Nov 24, 2015 8:33 pm

Or run a bash string command with sudo such as
CODE: SELECT ALL
sudo bash -c "echo 0 > /sys/class/backlight/rpi_backlight/bl_power"


Or put it in a script (Python or Shell) and run that using sudo.
I tried running a bash string and also running a python script. Both possibilities work fine for me. But sometimes my pi2 crashes. :(

I don´t have a clue what the reason might be. It would be much appreciated if anybody could give me a hint where to look. :?:

ulix
Posts: 72
Joined: Sat Apr 14, 2012 6:11 pm

Re: Sleep Mode - and or turn off backlight?

Thu Nov 26, 2015 1:17 pm

Could anyone form the foundation clarify the brightness control?
Thanks!

User avatar
DougieLawson
Posts: 36584
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Sleep Mode - and or turn off backlight?

Thu Nov 26, 2015 4:54 pm

ulix wrote:Could anyone form the foundation clarify the brightness control?
Thanks!
It's a binary control (on or off) not brightness.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ulix
Posts: 72
Joined: Sat Apr 14, 2012 6:11 pm

Re: Sleep Mode - and or turn off backlight?

Thu Nov 26, 2015 5:01 pm

Yes, I got this... but will brightness controll be available?
If the foundation makes more infos available we could think about it..
cheers

User avatar
DougieLawson
Posts: 36584
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Sleep Mode - and or turn off backlight?

Thu Nov 26, 2015 5:31 pm

ulix wrote:Yes, I got this... but will brightness controll be available?
If the foundation makes more infos available we could think about it..
cheers
The Foundation have learned not to pre-announce software or hardware (after making a dreadful foul up with the official screen announcement almost two years before it was available). Assuming it's even technically possible with the official screen hardware you won't be told until it's available. You can be fairly sure it's on the wish list (because they're not ignoring the forum).
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ulix
Posts: 72
Joined: Sat Apr 14, 2012 6:11 pm

Re: Sleep Mode - and or turn off backlight?

Thu Nov 26, 2015 8:42 pm

+1 for listening!
-1 for not getting a straight answer :x
cheers
Last edited by ulix on Thu Nov 26, 2015 9:12 pm, edited 1 time in total.

Marques de Monsas
Posts: 11
Joined: Tue Sep 29, 2015 4:34 pm

Re: Sleep Mode - and or turn off backlight?

Thu Nov 26, 2015 8:50 pm

DougieLawson wrote: The Foundation have learned not to pre-announce software or hardware (after making a dreadful foul up with the official screen announcement almost two years before it was available). Assuming it's even technically possible with the official screen hardware you won't be told until it's available. You can be fairly sure it's on the wish list (because they're not ignoring the forum).
Well, actually they have told us it is not possible.
jdb wrote:Unfortunately we can only support on/off switching of the backlight on the DSI display. Variable brightness control won't be possible.
Now we would like very much to know why not? Because maybe there is some (unofficial hack etc. e.g. losing CE certification is no issue to us, as we have to certificate our product anyway...) way to get it working. This would be very important information for (what it seems) many of us here, as at the moment the screen is unusable in several applications because of the unchangeable brightness. It would be important to know, also because if there is absolutely no work around we could shift our efforts else where and stop wasting our time (=money!) with this display. It is very sad and strange that we are not getting any response from the foundation, even that several people are asking politely. It is getting quite rude and disrespectful how they are handling this issue. Silence is newer a good way to treat customers...

Snyder
Posts: 31
Joined: Fri Sep 04, 2015 9:25 am

Re: Sleep Mode - and or turn off backlight?

Mon Nov 30, 2015 7:46 pm

cpfeil wrote:
Maybe a problem with your power source?
Christian, it was a problem with the power source.

My 7" display was powered via the GPIO pins of my PI2. The GPIO jumper cables did not supply the display with enough voltage. It was more a problem of the cable than of the power supply device.

Although I had a decent 6A power supply, my pi crashed very often when I switched off the backlight.

Since I am powering the display with a separate power supply, switching on/off the backlight is working reliable. :D

karlkiste
Posts: 189
Joined: Tue Jan 22, 2013 8:50 am
Location: berlin, germany

Re: Sleep Mode - and or turn off backlight?

Mon Dec 07, 2015 8:27 am

Marques de Monsas wrote:
DougieLawson wrote:
Well, actually they have told us it is not possible.
jdb wrote:Unfortunately we can only support on/off switching of the backlight on the DSI display. Variable brightness control won't be possible.
Now we would like very much to know why not? ...
I have no idea ;-)

But I can give some possibel causes:

EMI problems? Very unlikely to me. We could have been told, "we'd love to give this feature to you, but the bad bad regulatory guys won't let us."

The persisting silence on the topic of backlight dimming sounds to me more like...

"We're too busy with the new Zero device, so we won't ever be able to add the few missing firmware lines." Sorry, I feel this to be unlikely, too.

"We've made some stupid and really embarrassing beginner-type mistake when mass-producing the displays, and all who know about have sworn to take the secret to their graves." Yes. This sounds likely to me. There are things that go wrong. Examples? The factory says, "can we replace the microcontroller by a slightly cheaper one with the same features?" Ok. Same features, but perhaps the PWM output pin is at a different location... And there's no brightness control. More examples? There's firmware programmed to that microcontroller. Send the right file from the wrong directory as production image... And there's no brightness control. And / Or no way to reprogram the controller from the Pi side.

I expect that there might be an announcement one day, saying there's a new revision of the display board, which then even supports backlight dimming. Or, a document appears on Wikileaks which reveals the reason. Or, if it is a non-PWM-pin connected at the microcontroller, a close look to the board and the datasheets might give the answer.

:-)

Greets,
Kiste

switchcodes2
Posts: 2
Joined: Fri Dec 25, 2015 9:38 pm

Re: Sleep Mode - and or turn off backlight?

Fri Dec 25, 2015 9:50 pm

I have some issue to wake up system from sleep mode. Any way to force system not to put display touch screen to sleep ever?


Here is what I currently have:

- Linux testpi 4.1.15-v7+ #830 SMP Tue Dec 15 17:02:45 GMT 2015 armv7l GNU/Linux
- Connected Rpi official 7 inch touch screen.
- Boot in console mode only. No Keyboard or mouse.
- Setting up as kiosk.
- Connected in via ssh.

Issue:
-Once display go sleep with blank screen. No way to wake up display, with touch or even running following command wont effect.

Code: Select all

sudo bash -c "echo 0 > /sys/class/backlight/rpi_backlight/bl_power"
Noticed that this command only turn on backlight, but still nothing on display (with blank gray screen).

- But before screen automatically go to sleep I can successfully turn display on/off with:

Code: Select all

sudo bash -c "echo 0 > /sys/class/backlight/rpi_backlight/bl_power"
sudo bash -c "echo 1 > /sys/class/backlight/rpi_backlight/bl_power"
- Once screen sleep (gray screen with backlight on) , no way to wake up screen through command (via ssh) or touch on screen.

Question (need solution):
- Is there any way to completely turn of Sleep mode, and force screen never to sleep?
- Recover from sleep mode via command line in this specific case?

karlkiste
Posts: 189
Joined: Tue Jan 22, 2013 8:50 am
Location: berlin, germany

Re: Sleep Mode - and or turn off backlight?

Sat Dec 26, 2015 6:57 am

switchcodes2 wrote: - Is there any way to completely turn of Sleep mode, and force screen never to sleep?
This is no display sleep mode, it is the kernel screensaver. You can disable it like

setterm -powersave off -powerdown 0 -blank 0

Greets,
Kiste

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: Sleep Mode - and or turn off backlight?

Mon Dec 28, 2015 2:44 am

did an update.

this folder is now populated:
/sys/class/backlight

After some number of minutes, the display shuts off. Touching screen turns it on. Pressing keyboard turns it on.
What determines when the backlight shuts off?
Antikythera

backmailingbox
Posts: 48
Joined: Tue Jan 19, 2016 2:30 pm

Re: Sleep Mode - and or turn off backlight?

Sun Jan 24, 2016 7:01 am

Hi, I need to switch off and switch on the backlight from pyton
I recieve only err 13 - permissions......
How to solve this problem?

Snyder
Posts: 31
Joined: Fri Sep 04, 2015 9:25 am

Re: Sleep Mode - and or turn off backlight?

Sun Jan 24, 2016 11:30 am

This might help to get an idea how to do it with python:

https://github.com/elParaguayo/PiTFT_Sc ... tscreen.py

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Sleep Mode - and or turn off backlight?

Sun Jan 24, 2016 12:25 pm

backmailingbox wrote:Hi, I need to switch off and switch on the backlight from pyton
I recieve only err 13 - permissions......
How to solve this problem?
This is a thread I posted on adding a button to toggle the display backlight on and off.
viewtopic.php?f=108&t=125372

I also added a line to "/etc/lightdm/lightdm.conf" to turn off the automatic screen blanking, so the screen doesn't actually "blank" or "sleep" anymore, the button just manually turns the backlight on/off. Add the following under the "[SeatDefaults]" section in "/etc/lightdm/lightdm.conf".

Code: Select all

[SeatDefaults]
xserver-command=X -s 0 -dpms

User avatar
tonyhansen
Posts: 13
Joined: Sat Jan 03, 2015 6:20 am

Re: Sleep Mode - and or turn off backlight?

Wed Feb 03, 2016 5:30 pm

Just a note about running commands as root.

Running a command like

Code: Select all

echo > file
opens the file with your current permissions and then runs the command.

Running a command like

Code: Select all

sudo echo > file
still opens the file with your current permissions and then runs the command sudo, which in turn changes to root privileges and runs the command (echo in this instance) as root. However, note that the file is still opened prior to running the command using your current permissions.

To run a command as root and open the file as root, you need to do something like this:

Code: Select all

sudo sh -c "echo > file"
This starts the sudo command, switches to root, then executes the sh command as root, and has sh run the command

Code: Select all

"echo > file"
as root. Those quote marks are extremely important -- what is inside the quote marks is essentially a mini-shell script and can include anything you would normally do in the shell.

User avatar
Greg Erskine
Posts: 115
Joined: Sat Sep 15, 2012 4:20 am

Re: Sleep Mode - and or turn off backlight?

Sun Feb 14, 2016 10:34 pm

I have had a search for the answer but can't find it anywhere. :(

Can someone point me in the right direction, or confirm:

The mechanism for adjusting brightness works differently depending if you have version 1.0 or version 1.1 of the Official Foundation Screen.

V1.0 is simply off (0-127) or on (128-255)
V1.1 works as a proper brightness adjustment

Is there a published hardware tweak to make v1.0 work like v1.1

regards
Greg
* Raspberry Pi is a trademark of the Raspberry Pi Foundation

mquinteiro
Posts: 10
Joined: Thu Sep 24, 2015 12:31 pm

Re: Sleep Mode - and or turn off backlight?

Mon Feb 15, 2016 7:10 pm

Versión 1.1? With brightness adjustment?
Where is the announcement?
Where to buy?
It's possible to upgrade 1.0 to 1.1?
Farnell and RS say nothin about 1.1

Thanks for the good news, you make my day!

W. H. Heydt
Posts: 11118
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Sleep Mode - and or turn off backlight?

Wed Feb 17, 2016 6:29 am

Is it possible that the way to tell V1.0 from V1.1 is whether the controller board is already connected to the panel or not when you get it? (If so, I have a V1.0 unit, and converting it to V1.1 would be desirable, but I'd be happy to buy a V1.1 unit if that's what it takes to get one with truly adjustable brightness.)

ingohz
Posts: 1
Joined: Fri Feb 19, 2016 7:10 pm

Re: Sleep Mode - and or turn off backlight?

Fri Feb 19, 2016 7:17 pm

Got a touchscreen with an V1.1 board these days and can confirm: the brightness of the backlight is adjustable as expected now. Seems to be a feature/fix of the V1.1 boards!

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Sleep Mode - and or turn off backlight?

Fri Feb 19, 2016 10:12 pm

W. H. Heydt wrote:Is it possible that the way to tell V1.0 from V1.1 is whether the controller board is already connected to the panel or not when you get it? (If so, I have a V1.0 unit, and converting it to V1.1 would be desirable, but I'd be happy to buy a V1.1 unit if that's what it takes to get one with truly adjustable brightness.)
Mine has "Raspberry PI Display V1.0" printed right under the Raspberry Pi logo. I assume the new ones would have "V1.1".

That's a real bummer, I bet they still won't sell the controller separate so we can upgrade, and spending another $60 just to get brightness control is a bit out of my reach.

Return to “Beginners”