Schorschi
Posts: 245
Joined: Thu Nov 22, 2012 9:38 pm

Is there a way to reset the status returned by vcgencmd get_throttled?

Fri May 31, 2019 3:46 am

I suspect I know the answer, but asking just the same... Is there a way to reset the status returned by vcgencmd get_throttled? Short of an explicit reboot? I have some automation scripting that monitors the various 'warnings' that are returned by vcgencmd get_throttled. After I have captured the status as such, depend on the situation it would be nice to be able to reset the status without an explicit reboot. Even if it was just for the warnings that are not 'since reboot' could be reset, that would be sufficient.

User avatar
rpdom
Posts: 17708
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Fri May 31, 2019 4:11 am

If you are seeing any warning other than "since reboot" then the situation is still happening and obviously can't be reset. Your monitoring software should be able to cope with that.
Unreadable squiggle

User avatar
bensimmo
Posts: 4988
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Fri May 31, 2019 8:18 am

Each one has a since reboot and a currently option?
If you're logging, just use the currently and compare.

Unless there is a specific reason.
But I don't think you can. An engineer may be along and advise properly.

Andyroo

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Fri May 31, 2019 8:29 am

Do not look at the value as an integer but look at it as a bitmap.

From GITHUB Link the bits have the means of:

Bit Meaning
0 Under-voltage detected
1 Arm frequency capped
2 Currently throttled
3 Soft temperature limit active
16 Under-voltage has occurred
17 Arm frequency capped has occurred
18 Throttling has occurred
19 Soft temperature limit has occurred

Just use bit 2 and report it is 'currently throttled' or not and bit 18 for 'throttled since last reboot'

edit: Addition of bold + quotes

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

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Fri May 31, 2019 8:35 am

Andyroo wrote:
Fri May 31, 2019 8:29 am
Do not look at the value as an integer but look at it as a bitmap.

From GITHUB Link the bits have the means of:

Bit Meaning
0 Under-voltage detected
1 Arm frequency capped
2 Currently throttled
3 Soft temperature limit active
16 Under-voltage has occurred
17 Arm frequency capped has occurred
18 Throttling has occurred
19 Soft temperature limit has occurred

Just use bit 2 and report it is 'currently throttled' or not and bit 18 for 'throttled since last reboot'

edit: Addition of bold + quotes
Yes, this.

You cannot reset the bits.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9885
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Fri May 31, 2019 8:45 am

I'm going to disagree with my esteemed colleague, although I haven't got a Pi that I can trigger throttling on easily to test.

"vcgencmd get_throttled 1" should reset bits 16-19. (The value doesn't actually matter, just that there is an extra argument passed in).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Andyroo

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Fri May 31, 2019 9:24 am

6by9 wrote:
Fri May 31, 2019 8:45 am
I'm going to disagree with my esteemed colleague, although I haven't got a Pi that I can trigger throttling on easily to test.
...
Fight Fight Fight - I'll call Miss! :D :lol: :D

Sorry - I have to say I'm not the keen on resetting status / error flags that way as you never know what will be added into the 'register' long term. May be better to just reset the BIT than blat the whole thing. Maybe a 'clear previously throttled flag' parameter would be better?

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

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Fri May 31, 2019 9:38 am

Actually, the argument passed to get_throttled changes the variable returned, and acts as a bitmask to reset the additional variable.
There are two sets of sticky bits, permanent and recent.

a) get_throttled with no arguments returns permanent sticky bits in the top 16 bits - these are never reset.
b) get_throttled with a hex or decimal bitmask argument (bits 0-3) resets the "recent" sticky bits, and returns the state of the recent sticky bits in the top 16 bits prior to resetting.
b) get_throttled with a non-zero argument but bits 0-3 clear returns the "recent" sticky bits in the top 16 bits without resetting them.
Rockets are loud.
https://astro-pi.org


6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9885
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Fri May 31, 2019 10:21 am

Doh, skim read the code rather and missed the later bitmask :oops:
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

buteb
Posts: 1
Joined: Sun Sep 08, 2019 6:31 am

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Sun Sep 08, 2019 6:52 am

Hi everybody,
I learned a lot from this discussion already. But could anybody please explain the difference between options "b)" and "c)" a bit more?
b) get_throttled with a hex or decimal bitmask argument (bits 0-3) resets the "recent" sticky bits, and returns the state of the recent sticky bits in the top 16 bits prior to resetting.
Found this example somewhere:

pi@pib:~ $ vcgencmd get_throttled 0x05
throttled=0x50000
pi@pib:~ $ vcgencmd get_throttled 0x05
throttled=0x0


But found another example that used 0x07 instead of 0x05. Is that perhaps to clear extra sticky bits?
c) get_throttled with a non-zero argument but bits 0-3 clear returns the "recent" sticky bits in the top 16 bits without resetting them.
An example would be highly appreciated!
And same question as for option b: are the other bits used to select which sticky bits should be reset?
Thanks a lot!!!

niwa3836
Posts: 57
Joined: Mon Nov 05, 2012 9:08 pm

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Wed Jul 08, 2020 8:15 am

Hello all,

I have some questions if I may, although the first I "probably" know the answer to:

a)
when i type: vcgencmd get_throttled
I get throttled=0x50000
but when I type: vcgencmd get_throttled 0x05
I get error=2 error_msg="Invalid arguments", is this because I've got old code?

b) how often is this updated in memory? I'm thinking very quickly? I've repeated the command maybe every 5 secs and see sometimes throttled=0x50005 which suggests that the PSU isnt that well (agree?). The following suggests its ok through?
pi@raspberrypi:~ $ vcgencmd measure_volts
volt=1.2000V
pi@raspberrypi:~ $ vcgencmd measure_volts sdram_c
volt=1.2000V
pi@raspberrypi:~ $ vcgencmd measure_volts sdram_i
volt=1.2000V
pi@raspberrypi:~ $ vcgencmd measure_volts sdram_p
volt=1.2250V
pi@raspberrypi:~ $ vcgencmd measure_volts sdram_p
volt=1.2250V

c)
when a voltage is occuring what actually is a good command to see what is happening (or is it too quick?)
pi@raspberrypi:~ $ vcgencmd get_throttled
throttled=0x50005
pi@raspberrypi:~ $ vcgencmd measure_volts
volt=1.2000V

Is there anything better I can do to monitor / alarm (and how often) that there is an issue? I've got a quantity of units that are currently showing the same thing.

Thanks all

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

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Wed Jul 08, 2020 9:56 am

Just tried

Code: Select all

vcgencmd get_throttled 0x05
and it worked fine.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

LTolledo
Posts: 4108
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Is there a way to reset the status returned by vcgencmd get_throttled?

Wed Jul 08, 2020 11:46 am

that list provided by Andyroo (ret.) about the bits....

can those be accessed by python?

lets say I make an LED indicator board showing if each bit has been triggered or not....
and make individual "reset" button to reset any re-settable bits, and clearing the specific LED(s).
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “General discussion”