Rasberry PI4 CPI temp/speed read

How do I read the CPu temperature with the Yocto ELK OS build please?
The usual methods like;



cat /sys/class/thermal/thermal_zone0/temp

don’t work.

Would also be handy to see actual cpu frequency is, again vgencmd doesn’t work as it’s seemingly not part of this yocto build.

many thanks in advance

HI @Paula,
we will release soon this week a 0.7.1 bugfix and we’ll include there the packages for vcgencmd.

If you want to try a preview in the meanwhile, get the attached .tar.gz here, unpack it on the board and run the install.sh script as root to install it on your Pi.

For the CPU speed, it was already possible to read the CPU frequency using:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

but since we can’t support adaptive frequency governors with Xenomai, the output here should always be either 600 MHz or 1.5 GHz depending on how you set your CPU speed (you can easily change the value with elk_system_utils).

Hi @Paula,
You got any luck with that? I’m using ELK OS 0.7.1 with vcgencmd already installed, but when I run vcgencmd measure_temp I get VCHI initialization failed. @Stefano

Sadly not, I’ve had to stop working on that for a while.
hopefully @Stefano can help.

@Stefano, any suggestion about how to measure CPU temperature? :slight_smile:

HI @frederic,
sorry we are a little slower than usual these days.

sudo vcgencmd measure_temp works fine in our RPi4s. Ah, now I see: you get that error if you don’t runvcgencmd as sudo, simply try that.

sorry we are a little slower than usual these days.

no worries, I perfectly understand that, I just like to insist from time to time :wink:

I feel ashamed though, that of all things I tried, I did not try simply running vcgencmd as sudo. Works perfect.

Because I want to run this from inside my plugin so I can report temperature in my GUI easily, I added mind ALL = (ALL) NOPASSWD: ALL at the end of /etc/sudoers so mind user can run sudo vcgencmd measure_temp and is not required a password. Works great!