PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1819
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Under-voltage warnings

Wed Apr 05, 2017 9:21 am

Yes - the red LED and the lightning symbol are both driven from the same under-voltage signal at the same threshold, they just have different sampling and persistence characteristics. If you were to put a 'scope on the LED you would see it dipping, even if you can't see it.

ldon13
Posts: 35
Joined: Mon Mar 27, 2017 9:46 am
Location: Australia

Re: Under-voltage warnings

Wed Apr 05, 2017 9:41 am

Thanks @jamesh and @PhilE for your comments. :) right now im getting solid red power while lighting bolt appears n disappears every ~5mins, running from a PDU to a 12v 2.5A powersupply handling 5 Pis. Gonna go get an upgraded powersupply cheers.

hmmy92
Posts: 3
Joined: Fri Jul 07, 2017 1:54 pm

Re: Under-voltage warnings

Fri Jul 07, 2017 2:01 pm

Hello, I would like to ask, is there any way to read the status of the red led so I can detect voltage drops?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5144
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Under-voltage warnings

Fri Jul 07, 2017 9:03 pm

You can use

Code: Select all

vcgencmd get_throttled
See: viewtopic.php?f=63&t=147781&start=50#p972790

hmmy92
Posts: 3
Joined: Fri Jul 07, 2017 1:54 pm

Re: Under-voltage warnings

Tue Jul 11, 2017 8:32 am

dom wrote:You can use

Code: Select all

vcgencmd get_throttled
See: viewtopic.php?f=63&t=147781&start=50#p972790
Thanks for your reply. I checked your solution but didn't work. Despite there is or no under-voltage the returned value is always
throttled=0x50005

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5144
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Under-voltage warnings

Tue Jul 11, 2017 3:23 pm

Is the PWR LED lit up when you run this?
Have you got any custom configuration that alters the PWR LED state?

hmmy92
Posts: 3
Joined: Fri Jul 07, 2017 1:54 pm

Re: Under-voltage warnings

Thu Jul 13, 2017 12:10 pm

dom wrote:Is the PWR LED lit up when you run this?
Have you got any custom configuration that alters the PWR LED state?
I am not sure that I understood your question. I would like to mention that when raspberry is on under-voltage (so red led is off) the vcgencmd get_throttled command returns always 0x50005 which is ok. On the other side, when the voltage is ok (so red led is on) the previous command returns sometimes 0x50005 (under-voltage indication) and sometimes 0x50000 (voltage is ok indication). Any ideas about that? Also, I should mention that when I run the command vcgencmd get_throttled the red led is blinking (until the command return).

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4559
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Under-voltage warnings

Thu Jul 13, 2017 4:23 pm

hmmy92 wrote:
dom wrote:Is the PWR LED lit up when you run this?
Have you got any custom configuration that alters the PWR LED state?
I am not sure that I understood your question. I would like to mention that when raspberry is on under-voltage (so red led is off) the vcgencmd get_throttled command returns always 0x50005 which is ok. On the other side, when the voltage is ok (so red led is on) the previous command returns sometimes 0x50005 (under-voltage indication) and sometimes 0x50000 (voltage is ok indication). Any ideas about that? Also, I should mention that when I run the command vcgencmd get_throttled the red led is blinking (until the command return).
AIUI (@dom can confirm/correct, no doubt) red PoWeR led blinking is the "proper" under-voltage signal (off, I suspect, means that it's "extremely" under-voltage <<4.6V). So, when just vcgencmd get_throttled is running the voltage is fluctuating around the threshold, hence the blink, which, again, AIUI, has a "hardware time constant" associated with the threshold sensing circuitry, and the variation in the command's response (and, similarily, the "lightning bolt" icon) which has a (different?) software "time constant"**.
Trev.
** As observed during boot-up when using a power-bank or USB-port as a power source when the threshold-detection was introduced with the B+ by both @jamesh and myself. Once fully-booted, for those particular "setups" blinking ceased. It's quite likely that there's been some "fine-tuning" of those "time-constants" since then, of course.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
HawaiianPi
Posts: 2655
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Under-voltage warnings

Thu Jul 13, 2017 9:32 pm

hmmy92 wrote: ... Also, I should mention that when I run the command vcgencmd get_throttled the red led is blinking (until the command return).
If it blinks when you run the command then something is wrong. It really seems like you have a power problem.

I never see my red LED blink or otherwise change state, and my Pi3 always returns:

Code: Select all

vcgencmd get_throttled
throttled=0x0
My Pi3 is running off of a 5.3V/2.4A PSU with a short, high quality MicroUSB cable supplying the power (23 AWG OFC power wires).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5144
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Under-voltage warnings

Fri Jul 14, 2017 3:01 pm

If the power drops below the voltage threshold are brief (e.g. a few milliseconds) then you won't spot it on the LED.
But get_throttled has some persistence (matching the visible warning symbol) so it will show any undervoltage events that occurred recently (~ 1 second).

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4559
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Under-voltage warnings

Fri Jul 14, 2017 9:31 pm

dom wrote:If the power drops below the voltage threshold are brief (e.g. a few milliseconds) then you won't spot it on the LED.
But get_throttled has some persistence (matching the visible warning symbol) so it will show any undervoltage events that occurred recently (~ 1 second).
Thanks for that info. @dom - it clarifies the "time constants". [Slightly O.T.] One of the tricks I used to use to improve "detectivity" of LED's used for measurements of transmission through laser-drilled holes in metal sheeting was to use short (~1uS) pulses of quite high currents (but with a low mark-space ratio to keep the average power down) together with a phase-locked loop reciever. That worked in quite brightly (summer sunlight) lit labs. However, at low rep-rates, IIRC, the flicker was sometimes perceptible by some folks.
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

amcdonley
Posts: 140
Joined: Mon Jan 26, 2015 5:56 pm
Location: Florida, USA

Interpreting get_throttled=0x10000 or 0x30000

Wed Aug 23, 2017 4:35 pm

How should I interpret get_throttled=0x10000 or 0x30000 ?

This post seems to imply under-voltage and throttling come together
(I added hex views)
0: under-voltage (0xX0001)
1: arm frequency capped (0xX0002 or 0xX0003 with under-voltage)
2: currently throttled (0xX0004 or 0xX0005 with under-voltage)

16: under-voltage has occurred (0x1000X)
17: arm frequency capped has occurred (0x2000X or 0x3000X also under-voltage occurred)
18: throttling has occurred (0x4000X or 0x5000X also under-voltage occurred)

under-voltage occurs when voltage drops below 4.63V. The Pi is throttled
arm frequency capped occurs with temp > 80'C
over-temperature occurs with temp > 85'C. The Pi is throttled

Throttling removes turbo mode, which reduces core voltage, and sets arm and gpu frequencies to non-turbo value.
Capping just limits the arm frequency (somewhere between 600MHz and 1200MHz) to try to avoid throttling.
If you are throttled and not under-voltage then you can assume over-temperature. (confirm with vcgencmd measure_temp).
I am running boinc with two [email protected] and one [email protected] and have seen one minute status checks show:

79.5C 0x10000 4.936v or
78.5C 0x30000 4.852v or
74.6C 0x20000 4.925v

when my preferences allowed too much processor use.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5144
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Interpreting get_throttled=0x10000 or 0x30000

Fri Aug 25, 2017 1:13 pm

amcdonley wrote:
Wed Aug 23, 2017 4:35 pm
How should I interpret get_throttled=0x10000 or 0x30000 ?
0x10000 means low voltage has occurred
0x30000 means low voltage has occurred and arm frequency has been capped (due to temperature over 80'C).

Normally low voltage will trigger throttling of turbo, but that can be disabled with "avoid_warnings=2". Are you using that setting?

foice
Posts: 1
Joined: Sun Aug 27, 2017 8:48 pm

Re: Under-voltage warnings

Sun Aug 27, 2017 8:53 pm

Nice code (both bash and C). One question, from where was I supposed to learn that GPIO35 is a flag for under-voltage? (besides someone saying it on the forum ;)

Thanks for filling me in!
Roberto

[email protected] wrote:
Mon Jul 21, 2014 12:12 pm
Tried to write a little program to use the wiringPi ISR function on it, so I could log brown-outs, but it's not working )-:

I can poll for the pin change and that works fine:

Code: Select all

[email protected] ~/wiringPi/examples $ while true; do echo -n "`gpio -g read 35`" ; done
000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000^C
(yes, I'm doing something to deliberately trip low-power - don't ask)

but my little test program isn't picking it up.

I'm wondering if something in the kernel isn't passing interrupts back to userland on the 2nd bank of gpio pins?

The program is:

Code: Select all

#include <stdio.h>
#include <time.h>
#include <wiringPi.h>


#define LOW_POWER       35

/*
 * lowPower:
 *      This is an ISR that waits for the low-power signal going low and
 *      prints the result.
 *********************************************************************************
 */

void lowPower (void)
{
  time_t t ;

  time (&t) ;
  printf ("%s: LOW POWER DETECTED\n", ctime (&t)) ;
}


/*
 *********************************************************************************
 * main
 *********************************************************************************
 */

int main (void)
{
  wiringPiSetupSys () ; 

  wiringPiISR (LOW_POWER, INT_EDGE_FALLING, &lowPower) ;

  for (;;)
    delay (1000) ;

  return 0 ;
}
It works fine is I use pin 17 then toggle it using gpio -g mode 17 up ; gpio -g mode 17 down (uses the internal pull-up/down to trigger the interrupt)

The B+ has the latest kernel/firmware from apt-get update/upgrade rather than rpi-update if that makes a difference.

-Gordon

User avatar
Burngate
Posts: 5403
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
Contact: Website

Re: Under-voltage warnings

Mon Aug 28, 2017 4:49 pm

... see this thing on my head? I sometimes talk through it.
See below.
So I've deleted this post, and removed my hat.
Last edited by Burngate on Sat Sep 02, 2017 5:22 pm, edited 2 times in total.

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

Re: Under-voltage warnings

Mon Aug 28, 2017 8:07 pm

foice wrote:
Sun Aug 27, 2017 8:53 pm
Nice code (both bash and C). One question, from where was I supposed to learn that GPIO35 is a flag for under-voltage? (besides someone saying it on the forum ;)
https://github.com/raspberrypi/firmware ... t-blob.dts as described in https://www.raspberrypi.org/documentati ... uration.md

Look for [email protected]_LOW for your flavour of Pi. Do note that it is not always gpio 35!
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

bluenote
Posts: 58
Joined: Thu Feb 05, 2015 8:25 am

Re: Under-voltage warnings

Thu Dec 28, 2017 6:38 pm

So i recently had a host of problems related to the fact that the power supply on my headless Pi had degraded. As soon as I hooked up a LCD to it, and saw the lightning bolt, I understood what was happening. Is there some way that I can occasionally check a register that would tell me, for example, if the lightning bolt condition had occurred on this bootup?

thanks

User avatar
davidcoton
Posts: 3121
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Under-voltage warnings

Thu Dec 28, 2017 7:02 pm

Did you read the rest of this thread before posting? There is a link that explains the

Code: Select all

vcgencmd get_throttled
command and its output, which includes a latched low-voltage flag.
"Thanks for saving my life." See https://www.raspberrypi.org/forums/viewtopic.php?p=1327656#p1327656
“Raspberry Pi is a trademark of the Raspberry Pi Foundation”

bluenote
Posts: 58
Joined: Thu Feb 05, 2015 8:25 am

Re: Under-voltage warnings

Thu Dec 28, 2017 7:45 pm

davidcoton wrote:
Thu Dec 28, 2017 7:02 pm
Did you read the rest of this thread before posting? There is a link that explains the

Code: Select all

vcgencmd get_throttled
command and its output, which includes a latched low-voltage flag.
Apparently not enough, thanks for explaining, this does exactly what I needed.

ankushnag14
Posts: 10
Joined: Mon Apr 30, 2018 9:13 am

Re: Under-voltage warnings

Fri May 04, 2018 7:28 am

6by9 wrote:
Mon Aug 28, 2017 8:07 pm
foice wrote:
Sun Aug 27, 2017 8:53 pm
Nice code (both bash and C). One question, from where was I supposed to learn that GPIO35 is a flag for under-voltage? (besides someone saying it on the forum ;)
https://github.com/raspberrypi/firmware ... t-blob.dts as described in https://www.raspberrypi.org/documentati ... uration.md

Look for [email protected]_LOW for your flavour of Pi. Do note that it is not always gpio 35!
Hi guys. I am using RPi 3 B and I want to catch the low voltage event in an interrupt. Can you please help me if you have found something. In older version it was possible by GPIO 35. But now it is not possible I guess. :(

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5144
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Under-voltage warnings

Fri May 04, 2018 9:18 am

ankushnag14 wrote:
Fri May 04, 2018 7:28 am
Hi guys. I am using RPi 3 B and I want to catch the low voltage event in an interrupt. Can you please help me if you have found something. In older version it was possible by GPIO 35. But now it is not possible I guess. :(
Not possible - it's not on a dedicated gpio line, but through an I2C gpio exapander.
You'll need to poll with vcgencmd get_throttled or from the kernel:
https://github.com/raspberrypi/linux/pull/2397

ankushnag14
Posts: 10
Joined: Mon Apr 30, 2018 9:13 am

Re: Under-voltage warnings

Fri May 04, 2018 1:02 pm

dom wrote:
Fri May 04, 2018 9:18 am
ankushnag14 wrote:
Fri May 04, 2018 7:28 am
Hi guys. I am using RPi 3 B and I want to catch the low voltage event in an interrupt. Can you please help me if you have found something. In older version it was possible by GPIO 35. But now it is not possible I guess. :(
Not possible - it's not on a dedicated gpio line, but through an I2C gpio exapander.
You'll need to poll with vcgencmd get_throttled or from the kernel:
https://github.com/raspberrypi/linux/pull/2397
Thanks for the information. The link you gave is to poll using vcgencmd get_throttled. How do we poll from the kernel??

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5144
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Under-voltage warnings

Fri May 04, 2018 2:20 pm

ankushnag14 wrote:
Fri May 04, 2018 1:02 pm
Thanks for the information. The link you gave is to poll using vcgencmd get_throttled. How do we poll from the kernel??
The link includes a python file that polled the kernel sysfs file. It looks like this is the location:
/sys/devices/platform/soc/soc:firmware/get_throttled

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

Re: Under-voltage warnings

Fri May 04, 2018 2:56 pm

This file in the Linux repo might help? Does some throttled status grabbing via mailboxes.

https://github.com/raspberrypi/linux/bl ... pberrypi.c
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

ankushnag14
Posts: 10
Joined: Mon Apr 30, 2018 9:13 am

Re: Under-voltage warnings

Tue May 08, 2018 8:45 am

jamesh wrote:
Fri May 04, 2018 2:56 pm
This file in the Linux repo might help? Does some throttled status grabbing via mailboxes.

https://github.com/raspberrypi/linux/bl ... pberrypi.c
I have a small question regarding under voltage indication of Raspberry Pi. Could you please let me for how many seconds or milliseconds the indication will be there on the screen after the under voltage event has occurred.

Return to “Advanced users”

Who is online

Users browsing this forum: papous and 17 guests