Page 7 of 8

Re: Under-voltage warnings

Posted: Wed Apr 05, 2017 9:21 am
by PhilE
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.

Re: Under-voltage warnings

Posted: Wed Apr 05, 2017 9:41 am
by ldon13
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.

Re: Under-voltage warnings

Posted: Fri Jul 07, 2017 2:01 pm
by hmmy92
Hello, I would like to ask, is there any way to read the status of the red led so I can detect voltage drops?

Re: Under-voltage warnings

Posted: Fri Jul 07, 2017 9:03 pm
by dom
You can use

Code: Select all

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

Re: Under-voltage warnings

Posted: Tue Jul 11, 2017 8:32 am
by hmmy92
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

Re: Under-voltage warnings

Posted: Tue Jul 11, 2017 3:23 pm
by dom
Is the PWR LED lit up when you run this?
Have you got any custom configuration that alters the PWR LED state?

Re: Under-voltage warnings

Posted: Thu Jul 13, 2017 12:10 pm
by hmmy92
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).

Re: Under-voltage warnings

Posted: Thu Jul 13, 2017 4:23 pm
by FTrevorGowen
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.

Re: Under-voltage warnings

Posted: Thu Jul 13, 2017 9:32 pm
by HawaiianPi
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).

Re: Under-voltage warnings

Posted: Fri Jul 14, 2017 3:01 pm
by dom
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).

Re: Under-voltage warnings

Posted: Fri Jul 14, 2017 9:31 pm
by FTrevorGowen
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.

Interpreting get_throttled=0x10000 or 0x30000

Posted: Wed Aug 23, 2017 4:35 pm
by amcdonley
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.

Re: Interpreting get_throttled=0x10000 or 0x30000

Posted: Fri Aug 25, 2017 1:13 pm
by dom
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?

Re: Under-voltage warnings

Posted: Sun Aug 27, 2017 8:53 pm
by foice
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

Re: Under-voltage warnings

Posted: Mon Aug 28, 2017 4:49 pm
by Burngate
... see this thing on my head? I sometimes talk through it.
See below.
So I've deleted this post, and removed my hat.

Re: Under-voltage warnings

Posted: Mon Aug 28, 2017 8:07 pm
by 6by9
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!

Re: Under-voltage warnings

Posted: Thu Dec 28, 2017 6:38 pm
by bluenote
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

Re: Under-voltage warnings

Posted: Thu Dec 28, 2017 7:02 pm
by davidcoton
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.

Re: Under-voltage warnings

Posted: Thu Dec 28, 2017 7:45 pm
by bluenote
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.

Re: Under-voltage warnings

Posted: Fri May 04, 2018 7:28 am
by ankushnag14
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. :(

Re: Under-voltage warnings

Posted: Fri May 04, 2018 9:18 am
by dom
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

Re: Under-voltage warnings

Posted: Fri May 04, 2018 1:02 pm
by ankushnag14
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??

Re: Under-voltage warnings

Posted: Fri May 04, 2018 2:20 pm
by dom
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

Re: Under-voltage warnings

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

https://github.com/raspberrypi/linux/bl ... pberrypi.c

Re: Under-voltage warnings

Posted: Tue May 08, 2018 8:45 am
by ankushnag14
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.