Temperature sensors


#1

After I got my TO router in November 2016 and started to play little bit with it, I noticed peculiar line in crontab:

 */5 * * * * /sbin/fan_ctrl.sh

I wondered for what there is a script for fan in fanless router, but after some time I forget about it… (maybe it was some relict from Turris 1x?)

Recently, following some discussion on the Turris forum, I remembered this peculiarity and started investigate it.

As far as I understand it, this script is checking some temperature sensors, and, if such temperature exceeds given limit, starts fan to cool protected device.

Sensors in question are hwmon[12]

 CPU_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon2/temp1_input`
 DDR_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon1/temp1_input`
 WIFI_TEMP=`cut -c1-2 /sys/class/hwmon/hwmon1/temp2_input`

Unfortunately, looking in /sys/class/hwmon/ one sees hwmon0 only, no hwmon[12].

Following above mentioned logic using hwmon0, ie. asking value of

 TEMP_CPU=`cut -c1-2 /sys/class/hwmon/hwmon0/temp1_input`

it passes value which corresponds to value of /etc/thermometer, thus I wonder whether there are another two thermal sensors hwmon[12] :wink:

Could anybody enlighten me? TIA.


#2

Neither Turris 1.0 nor 1.1 had a fan (by default at least).


#3

Maybe it originates from an earlier design stage.

I don’t know if it helps you. I’m running Domoticz on the TO and added the motherboard sensors. Domoticz finds the following exposed “sensors”:


#4

This script is part of mvebu target specific base-files. This is of course not Omnia specific but rather CPU specific. Meaning there are boards with fan with same mvebu CPU out there that are supported by OpenWRT. In this sense OpenWRT is mess and some of the files/scripts/hacks added for some router are added to all routers in the end even if they do not work there.


#5

Thanks to all for hints. If I understand it well, there are no other thermal sensors on TO than CPU. Cron fan script somehow got propagated to TO even though not needed and functional. (Anyhow, it could serve as template if somebody wants to add fan to TO :wink: )