However, I thought this little utility might help people looking to shave even a little bit off of their project costs. It will also be useful for those experimenting with different overclocks.
Awhile back I threw together this short script to monitor my Pi 3 because I was regularly seeing the thermometer icon appearing on the top-right of the screen. I had added a fan/heatsink combo, and used this little tool to monitor the temp via SSH as I ran a variety of different tasks. The script (as you can see) was largely created by Vivek Gite, so many thanks to Vivek.
Once you have it setup you can constantly monitor both the CPU & GPU temps from your computer.
The first thing you will need to do is configure SSH. This will not only make it easier to create the script, but will be necessary to monitor temps during use. I use mRemoteNG (https://mremoteng.org/), but you can use PuTTY or any other preferred software that will let you use SSH.
Create the script:
Code: Select all
cd /bin
sudo nano pitemp.sh
Code: Select all
#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"
Code: Select all
sudo chmod +x pitemp.sh
To execute the script one time simply type:
Code: Select all
pitemp.sh
Code: Select all
watch –n”X” pitemp.sh