Emma_Jir
Posts: 23
Joined: Wed Nov 29, 2017 11:13 am

3B+ vcgencmd display_power status

Tue Nov 19, 2019 10:14 am

Running RPi 3B+ with archlinux-arm i usually got either "display_power=0" or "display_power=1" as a return of "/opt/vc/bin/vcgencmd display_power" with no arguments. After a recent system upgrade i allways get "display_power=-1" regardless wether i've set it to 0 or 1 before:

Code: Select all

$ $ /opt/vc/bin/vcgencmd display_power
display_power=-1

$ /opt/vc/bin/vcgencmd display_power 0
display_power=0

$ /opt/vc/bin/vcgencmd display_power
display_power=-1

$ /opt/vc/bin/vcgencmd display_power 1
display_power=1

$ /opt/vc/bin/vcgencmd display_power
display_power=-1

I haven't found any key that explains 'status -1' yet, what does it mean? I used it as a condition in a python script wich is now impossible. Is it unrecommended in general to directly pull "vcgencmd display_status" in this way?

I'm using the following linux/vcgencmd versions.

Code: Select all

$ uname -a
Linux RPi 4.19.83-1-ARCH #1 SMP PREEMPT Wed Nov 13 02:54:37 UTC 2019 armv7l GNU/Linux

$ /opt/vc/bin/vcgencmd version
Nov 14 2019 15:25:06 
Copyright (c) 2012 Broadcom
version 2354eac70a98807e06bed2149bc0c5613e751c15 (clean) (release) (start)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25015
Joined: Sat Jul 30, 2011 7:41 pm

Re: 3B+ vcgencmd display_power status

Tue Nov 19, 2019 11:24 am

Hmmm. Quite a few recent changes in this area. I had guessed that no one actually used that return value for anything, looks like that guess was wrong. The pass to getting that data back from the firmware is quite convoluted which is why I didn't spend too much time on it. I'll take another look to see if there is an easy fix.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25015
Joined: Sat Jul 30, 2011 7:41 pm

Re: 3B+ vcgencmd display_power status

Tue Nov 19, 2019 3:04 pm

OK, this this is fixed, have pushed to our internal repo, will be in rpi-update in a few days.

You will still get -1 under some circumstances, usually if the system cannot tell whether something is plugged in or not.

Made some adjustments to the documentation to reflect the new ID parameter here https://github.com/raspberrypi/documentation/pull/1339
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

Emma_Jir
Posts: 23
Joined: Wed Nov 29, 2017 11:13 am

Re: 3B+ vcgencmd display_power status

Tue Nov 19, 2019 3:16 pm

Thank you for the effort. I was asking mostly because i was curious and i didn't find much online. I was a bit nervous because i needed that feature in case ssh access fails but i just found a way to work with a boolean without directly polling the status so the problem is solved. Again, thank you though.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25015
Joined: Sat Jul 30, 2011 7:41 pm

Re: 3B+ vcgencmd display_power status

Tue Nov 19, 2019 4:05 pm

Emma_Jir wrote:
Tue Nov 19, 2019 3:16 pm
Thank you for the effort. I was asking mostly because i was curious and i didn't find much online. I was a bit nervous because i needed that feature in case ssh access fails but i just found a way to work with a boolean without directly polling the status so the problem is solved. Again, thank you though.
No worries. Whether you use it or not, it needed to be fixed as it was an unintended change in behaviour.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

Return to “Troubleshooting”