Temperature script

Here is all the tutorials, FAQ and support for RaspiBoy Kit
Post Reply
harvey
Posts: 14
Joined: Fri 7 Sep 2018 10:12

Temperature script

Post by harvey » Tue 1 Jan 2019 06:18

Here's a script to check the CPU and GPU temps while in Emulationstation.
(You can also SSH and copy and paste these commands.)

If in RetroPie, drop to the command line (F4) and type:

nano /home/pi/RetroPie/retropiemenu/Check\ Temperature.sh

(This will open a text editor where you will then type:)

#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))°C"
sleep 5


Then press 'ctrl+o' to save, 'enter' to confirm and 'ctrl+x' to exit back to the command line.

Now you make the script executable by typing:

chmod +x /home/pi/RetroPie/retropiemenu/Check\ Temperature.sh

(All that's left is to restart Emulation Station by typing:)

emulationstation

If you want to erase the script, here is the command:
rm /home/pi/RetroPie/retropiemenu/Check\ Temperature.sh
Attachments
IMG_3269.JPG
CPU and GPU
IMG_3269.JPG (76.46 KiB) Viewed 270 times
IMG_3268.JPG
Check Temperature
IMG_3268.JPG (119.54 KiB) Viewed 270 times

User avatar
Admin
Administrateur du site
Posts: 396
Joined: Sat 10 Dec 2016 13:12

Re: Temperature script

Post by Admin » Tue 12 Mar 2019 15:28

Nice! Thanks for sharing

Post Reply