Welcome to Raspbot V2 repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
7. Get real-time temperature of RPi
Get real-time temperature of RPi
Enter the command through the terminal to view the current CPU temperature of the Raspberry Pi.
Environment
System: Raspberry Pi OS
Raspbian is the old name of the official operating system of Raspberry Pi based on the Debian system, and Raspberry Pi OS is its new name after the name change in 2020.
Ideas
The CPU temperature information of the Raspberry Pi is located in the file /sys/class/thermal/thermal_zone0/temp, which is a read-only file; we can read the value and convert it into the actual temperature.
Get temperature parameters
Open the terminal and run the following two commands to get temperature parameters:
xxxxxxxxxxcd /sys/class/thermal/thermal_zone0cat temp
Actual effect
