Home Scripts Display the system temperature

Display the system temperature

by shedboy71

Here are a couple of BASH scripts to display the temperature of the BCM2835 SoC used on the Raspberry PI. Using this its fairly simple to create a temperature logging system or even going a step further and if the temperature exceeded a maximum you could shutdown your system.

Here are a couple of simple scripts, open the terminal and enter the following

Both are similar but the second adds a 1 second delay between readings

#!/bin/bash
for i in {1..10}
do
/opt/vc/bin/vcgencmd measure_temp
done

Example 2

#!/bin/bash
for i in {1..10}
do
/opt/vc/bin/vcgencmd measure_temp
sleep 1
done

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More