
Raspberry Pi CPU Temperature Script
█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█
[Synopsis]
This video is about how you can get the core CPU temperature reading from the Raspberry Pi Raspbian operating system.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Procedure]
{Open up the terminal by pressing}
• "Ctrl" + "Alt" + "T"
Type in the commands.
{To create a script file}
• nano Name.sh
In my example
• nano print_tempexample.sh
Type or copy and paste the code into the file
• press "Ctrl" + "X" to exit, and save.
Make the script executable
• chmod +x print_tempexample.sh
To run the .sh file
• ./name of file.sh
OR
• . name of file.sh
To copy the .sh file to the bin directory
• cp filename.extension ~/file directory
In my example,
• cp print_tempexample.sh ~/bin
To delete the file in the root directory
• rm tempexample.sh
To use the Fahrenheit script first install the BC float point app in the terminal.
• sudo apt install bc (This will take a few minutes)
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Commands]
#Temperature Read#
vcgencmd measure_temp
vcgencmd measure_temp | egrep -o '[0-9]*\.[0-9]*'
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
#Temperature Read Script in Degrees C#
#!/bin/bash
printf "-15s%5s\n" "TIMESTAMP" "TEMP(degC)"
printf "%20s\n" "....................."
while true
do
temp=$(vcgencmd measure_temp | egrep -o '[0-9]*\.[0-9]*')
timestamp=$(date +'%s')
printf "%-15s%5s\n" "Stimestamp" "$temp"
sleep 1
done
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
#Temperature Read Script In Degrees F#
#!/bin/bash
printf "-15s%5s\n" "TIMESTAMP" "TEMP(F)"
printf "%20s\n" "....................."
while true
do
tempC=$(vcgencmd measure_temp | egrep -o '[0-9]*\.[0-9]*')
tempF=$(echo "scale=2; 1.8 *$tempC + 32" | bc)
timestamp=$(date +'%s')
printf "%-15s%5s\n" "$timestamp" "$tempF"
sleep 1
done
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Download Links]
◙ Temperature Script in degrees Celcius
• https://drive.google.com/open?id=13ED2mLGj_gFS8abtY03MpD8xn6UmPYTP
◙ Temperature Script in degrees Fahrenheit
• https://drive.google.com/open?id=1T2ab_E0S4W4fiF-giQ_iSRrz84fQnFdC
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Sources]
“Raspberry Pi Temperature Monitor.” Linuxhint, 2019, https://linuxhint.com/raspberry_pi_temperature_monitor/ .
Accessed 19 Jan 2020
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Links]
◙ Raspberry Pi 4 Related Videos
• https://he-1000-1975.com/video-directory/#RASP
█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█
Other Videos By Ace1000ks1975
2020-01-26 | Zombie Raider (1995) Arcade Playthrough Both Endings |
2020-01-26 | Zombie Raider (1995) Calibrate Gun |
2020-01-24 | How to Delete Partitions with Diskpart |
2020-01-22 | Dell Precision T3500/T5500 How to Install and Remove 5.25" Drive |
2020-01-22 | ICY DOCK Dual 2.5" SSD 1 x 3 5 HDD Device Bay to 5.25" adapter |
2020-01-21 | Lethal Enforcers 2 (1994) Arcade |
2020-01-20 | Spy Hunter (1983) Arcade |
2020-01-20 | Spy Hunter 2 (1987) Arcade |
2020-01-20 | E-Swat Cyber Police (1989) Arcade |
2020-01-19 | Viper (1988) Arcade Leland |
2020-01-19 | Raspberry Pi CPU Temperature Script |
2020-01-18 | Increase SWAP Memory Size in the Raspbian Operating System |
2020-01-17 | How to Create a PowerShell Script File |
2020-01-17 | Windows 10 File Sharing Problems with NAS Servers and Linux |
2020-01-14 | Half-Life 2: Lost Coast |
2020-01-13 | I, Robot (1983) Arcade Atari |
2020-01-13 | Half-Life 2 Episode 2 Part 6 End |
2020-01-13 | Half-Life 2 Episode 2 Part 4 |
2020-01-13 | Half-Life 2 Episode 2 Part 3 |
2020-01-12 | Half-Life 2 Episode 2 (2007) Part 1 |
2020-01-11 | Raspberry Pi 4 Modification |