-
-
Notifications
You must be signed in to change notification settings - Fork 19
Hardware Monitoring
A Raspberry Pi runs safely without any cooling solutions. When it's about to get too hot, it throttles back the CPU frequency and voltage, in order to protect the hardware. If that doesn't help, the Pi will halt.
If course, you don't want your Pi to reduce the CPU speed, as it severely impacts performance.
One of the features of Homebridge RPi is to monitor the Pi hardware, so you can check if additional cooling measures are needed.
Homebridge RPi uses the vcgencmd
command-line tool, to get the Pi hardware status.
It's using following commands:
Command | Description |
---|---|
vcgencmd measure_temp |
Report the CPU temperature. |
vcgencmd measure_clock arm |
Report the CPU frequency. |
vcgencmd measure_volts |
Report the CPU voltage. |
vcgencmd get_throttled |
Report the system status. |
The measure_temp
command returns the CPU temperature in degrees Celsius, with a 0.1°C resolution:
vcgencmd measure_temp
temp=55.8'C
You want to make sure the CPU temperature stays below 80°C (or 60°C for the Pi 3B+). For more info, see Frequency Management and Thermal Control.
The measure_clock arm
returns the CPU frequency in Hz:
vcgencmd measure_clock arm
frequency(45)=1400000000
This is on a Pi 3B+ running at 1400 MHz.
I haven't been able to find an overview of all Pi models with their maximum CPU speed, but I have found the following:
Model | CPU Frequency |
---|---|
Pi 3B | 1200 MHz |
Pi 3B+ | 1400 MHz (1200 MHz above 60°C) |
Pi 4B | 1500 MHz (1800 MHz for rev 1.4 on bullseye) |
Note that the Pi also reduces the CPU speed to 600 MHz when there's little to no system load.
The measure_volts
reports the CPU voltage in V, with a resolution of 0.1 mV:
vcgencmd measure_volts
volt=1.3688V
I'm not sure what the voltage is supposed to be, but I typically find the following values:
Model | CPU Voltage |
---|---|
Pi 3B | 1.2000 V |
Pi 3B+ | 1.3688 V |
Pi 4B | 0.8375 V |
The get_throttled
returns the system status as a bitmap:
vcgencmd get_throttled
throttled=0x80000
The bitmap contains two words. The low-end word indicates the current conditions. The corresponding bits are cleared as soon as the condition no longer occurs. The high-end word indicates whether a condition has occurred. The corresponding bits are cleared only on reboot.
So far, I've uncovered the following status bits:
Bit | Value | Meaning |
---|---|---|
0 | 0x1 | Under-voltage active. |
1 | 0x2 | ARM frequency capped. |
2 | 0x4 | Currently throttled. |
3 | 0x8 | Soft temperature limit active (Pi 3B+). |
16 | 0x10000 | Under-voltage has occurred. |
17 | 0x20000 | ARM frequency capped has occurred. |
18 | 0x40000 | Throttling has occurred. |
19 | 0x80000 | Soft temperature limit has occurred (Pi 3B+). |