Jump to content

Measuring CPU temperature


Recommended Posts

Today, I set up SSH public key authentication on my RPI5B running Armbian-unofficial 24.8.0-trunk Bookworm. During the test, I noticed that the initial SSH session message displayed the CPU temperature and other details. Unfortunately, the vcgencmd utility provided by the Raspberry Pi Foundation doesn't work on Armbian. I'm looking to understand how the temperature, CPU clock, and GPU clock are measured, and if possible, I'd like to receive some code to do so.

Link to comment
Share on other sites

I searched the github.com looking for possible answers to my problem. WendySanarwanto published a few scripts under the title arm-cpu-temp.  I just looked for the one dedicated to Banana Pi M3 and it turned out that the folders are about the same as for the RPI5B. For anyone interested, I have included a sample bash script below:

#!/bin/bash
echo 'Temperature: '$((`cat /sys/class/thermal/thermal_zone0/temp` /1000)) ' °C'
echo "CPU-0 Frequency: "$((`sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq` /1000)) ' Mhz'
echo "CPU-1 Frequency: "$((`sudo cat /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq` /1000)) ' Mhz'
echo "CPU-2 Frequency: "$((`sudo cat /sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_cur_freq` /1000)) ' Mhz'
echo "CPU-3 Frequency: "$((`sudo cat /sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_cur_freq` /1000)) ' Mhz'

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines