How to interact with temperature sensors#

The i.MX8 SOCs and the Intel SOCs have temperature sensors and their values can be read.

The internal temperature sensors of sm2s-imx8plus is split into two thermal zones. But for the other i.MX8 SOCs and for the Intel SOCs there is just one thermal zone. These zones are accessible through /sys/devices/virtual/thermal/thermal_zoneX.

For example, on the sm2s-imx8plus, there are two zones: thermal_zone0 and thermal_zone1.

root@sm2s-imx8plus:/sys/devices/virtual/thermal# ls
cooling_device0  thermal_zone0    thermal_zone1

But on the sm2s-al, there is only one zone: thermal_zone0.

root@sm2s-intel-all:/sys/devices/virtual/thermal# ls
cooling_device0  cooling_device1  thermal_zone0

The temperature of each zone can be read in their temp file. The temperature values are reported in millidegrees Celsius (m°C), which is the standard for Linux thermal zones.

For example, on the sm2s-imx8plus, the temperatures of each zone can be read using these commands:

root@sm2s-imx8plus:/sys/devices/virtual/thermal# cat thermal_zone0/temp
42000
root@sm2s-imx8plus:/sys/devices/virtual/thermal# cat thermal_zone1/temp
43000

So the temperature in the thermal_zone0 is 42°C and the temperature in the thermal_zone1 is 43°C.

And on the sm2s-al, the temperature of the thermal zone can be read using this command:

root@sm2s-intel-all:/sys/devices/virtual/thermal# cat thermal_zone0/temp
41000

So the temperature in the thermal_zone0 is 41°C.