Posted in linux
3300
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
82
This Month
357
This Year
347

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
Even if you fall on your face, you're still moving forward.
Victor Kiam
Random CSS Property

border-top-style

The border-top-style CSS property sets the line style of an element's top border.
border-top-style css reference