Posted in linux
3385
11:39 pm, February 17, 2021
 

how to check the temperature of the pi using command line

to get the temperature of the pi in shell or command line type the following:

BASH

vcgencmd measure_temp

This measures the GPU temperature.

Which should generate something like this:

To get the ARM CPU temperature you will need a bit of a shell script.

Add this to a .sh file and make it executable

BASH

nano ~/temp.sh

in this file add the following

BASH

cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$((cpu/1000)) c"

then make the file +x or executable with chmod

BASH

chmod +x ~/temp.sh
~/temp.sh

Here is a working example:

View Statistics
This Week
46
This Month
341
This Year
432

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
Old programmers never die; they just lose some of their functions.
Random CSS Property

min-width

The min-width CSS property sets the minimum width of an element. It prevents the used value of the width property from becoming smaller than the value specified for min-width.
min-width css reference