Introduction of using BASH script to check temperatures on the Raspberry Pi
This is a simple bash script that retrieves the CPU and GPU temperature of the Raspberry Pi Single Board Computer (SBC).
- Go to directory
cd pitemp
- Run Script
bash pitemp.sh
Huats Pitemp Bash Script
Pi Temperature of <hostname> @ <Day-Date-Time-Year>
---------------------------------------
CPU Temperature is => <CPU-Temp> 'C
GPU Temperature is => <GPU-Temp> 'C
This is a simple bash script that retrieves and log the CPU and GPU temperature of the Raspberry Pi Single Board Computer (SBC).
- Go to directory
cd pitemp
- Make timepi.sh executable
sudo chmod +x timepi.sh
- edit crontab to run timepi.sh every minute
crontab -e
enter the following command
*/1 * * * * /bin/bash /home/<username>/pitemp/timepi.sh
- Read templog.txt output
Pi Temperature of <hostname> @ <DAy-Date-Time-Year>
CPU Temperature is => 40 C
GPU Temperature is => temp=41.0'C
----------------------------