Linux – Get the CPU temperature on poky linux

embeddedlinuxtemperature

I'm monitoring the performance of an ARM-based embedded device which runs poky linux distro (from Yocto project) which contains OpenEmbedded build system. I need to get the CPU temperature time and again. Without having to depend on third-party programs, is there a way I can get the CPU temperature? Is there a system file that I can read to get this information?

Best Answer

The old way to get CPU temperature was in /proc through /proc/acpi/thermal_zone/ATF0/temperature, but this has been deprecated.

CPU temperature can now be found here: /sys/class/thermal/thermal_zone0/temp

Note: The units is one thousandths of a degree C. So 33500 = 33.5 C.

Related Question