2

Responses to this post: How does RPi "know" when it hasn't got enough power indicate that there is a digital input somewhere on the RPi which indicates what the supply voltage has dropped off too low.

How can this be accessed by a script, please? Ideally, it would be Python, but if I can find the Linux file containing the data, I can work with that.

(I'm hoping to get really lucky and get access to the supply voltage, but the indications are that the RPi only has access to a digital signal indicating "too low".)

Thanks.

KDM
  • 718
  • 1
  • 9
  • 24

1 Answers1

2

Use vcgencmd get_throttled

This is the only reliable method, as the hardware changed between Pi models and in later models is only available from the kernel.

Interpretation of the results

https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=147781&start=50#p972790 https://www.raspberrypi.com/documentation/computers/os.html#get_throttled

0: under-voltage
1: arm frequency capped
2: currently throttled
3: Soft Temp limit reached  3
16: under-voltage has occurred
17: arm frequency capped has occurred
18: throttling has occurred
19: Soft Temp limit has occurred

If bit 0 is 1 under-voltage is detected.

Milliways
  • 62,573
  • 32
  • 113
  • 225