The low voltage event will cause some sort of throttling to be done, but cannot remember exactly what - might just prohibit turbo mode or similar . Will find out more details once knowlegable guy is in office.
The Raspberry Pi uses a nonstandard method involving mailboxes and the GPU to report what the current CPU clock rate is. In Raspbian there is a command vcgencmd that can be used to obtain the current clock speed.
Code: Select all
vcgencmd get_throttledCode: Select all
1010000000000000101 <- 19 bits rpi 3b+
||| |||_ under-voltage
||| ||_ currently throttled
||| |_ arm frequency capped
|||_ under-voltage has occurred since last reboot
||_ throttling has occurred since last reboot
|_ arm frequency capped has occurred since last reboot
Code: Select all
temp_soft_limit=70Code: Select all
#!/bin/bash
Counter=14
DisplayHeader="Time Temp CPU Throttle Vcore"
while true ; do
let Counter++
if [ ${Counter} -eq 15 ]; then
echo -e "${DisplayHeader}"
Counter=0
fi
Health=$(perl -e "printf \"%19b\n\", $(vcgencmd get_throttled | cut -f2 -d=)")
Temp=$(vcgencmd measure_temp | cut -f2 -d=)
RealClockspeed=$(vcgencmd measure_clock arm | awk -F"=" '{printf ("%0.0f",$2/1000000); }' )
CoreVoltage=$(vcgencmd measure_volts | cut -f2 -d= | sed 's/000//')
echo -e "$(date '+%H:%M:%S') ${Temp} $(printf '%4s' ${RealClockspeed})MHz $(printf '%019d' ${Health}) ${CoreVoltage}"
sleep 60
done