Max operating temperature of Raspberry Pi is 85°C.
If the temperature exceeds 82°C, then the CPU’s clock speed will be slowed until the temperature drops below 82°C.
So it is very important to monitor the temperature of the board and Raspberry Pi has a built-in sensor for this.
In this note i will show how to check the CPU/GPU temperature of Raspberry Pi.
Cool Tip: Shutdown & reboot Raspberry Pi safely! Read more →
Check Temperature of Raspberry Pi
Measure the GPU temperature:
$ vcgencmd measure_temp
– or –
/opt/vc/bin/vcgencmd measure_temp
Check the CPU temperature:
$ echo temp=$((`cat /sys/class/thermal/thermal_zone0/temp`/1000)).0\'C
The CPU/GPU temperature of Raspberry Pi can be monitored using watch
command.
For example, to show the GPU temperature of Raspberry Pi each 5 seconds, execute:
$ watch -n5 vcgencmd measure_temp
Wow. Thanks for trying. You’ll get it. None of these commands worked.
All of these commands here failed. “Command not found”.
Can you recommend a web site that can show the the commands to get the temp of my pi CPU?
Works absolutely fine for me. But thanks for the dick-ish comment, Bill. Keep trying…you’ll get it.
Lol I googled vcgencmd for powershell (Win10) and I got this and read those two comments. Had to post my lol… Bill just a troll. Command works just fine and if not I’m sure a simple sudo apt-get install vcgencmd would have solved that issue.
Just in case Bill was being serious you need to use the command “vcgencmd measure_temp” on your command line. Do not type the dollar sign at the front. That just represents the command prompt.
vcgencmd has been available in the Raspbian/Rasberry Pi OS image for as long as I can remember so definitely works.
Just FYI, Will not work when running inside a docker container.
@hitesh,
It CAN work from inside a Docker container if you do some gymnastics. Here is my command line for starting Telegraf on a Pi 4. (Please, no “Use Compose comments.”) I’m sure there is a cleaner way, but I’m climbing the learning curve. 🙂 Note “/home/configs” is a NFS mount on my NAS.
docker run -d \
–name=telegraf.$HOSTNAME \
-h $HOSTNAME \
–restart=always \
-e INFLUX_SYS=$HOSTNAME \
–env-file /home/configs/telegraf/telegraf.env \
–network telegraf_wire \
-p 8125:8125 -p 8092:8092 -p 8094:8094 \
-v “/home/configs/telegraf/vcgencmd.sh:/etc/telegraf/vcgencmd.sh” \
-v “/home/configs/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf” \
-v “/home/configs/telegraf.d:/etc/telegraf/telegraf.d” \
-v /usr/bin/vcgencmd:/opt/vc/vcgencmd:ro \
-v /usr/lib/aarch64-linux-gnu/libvchiq_arm.so.0:/opt/vc/lib/libvchiq_arm.so.0:ro \
-v /usr/lib/aarch64-linux-gnu/libvcos.so.0:/opt/vc/lib/libvcos.so.0:ro \
–device=/dev/vchiq \
-e LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/vc/lib \
–label=com.centurylinklabs.watchtower.enable=true \
–user telegraf:video \
telegraf:latest –config-directory /etc/telegraf/telegraf.d