Openwrt One: Thermal Settings

You can force the OpenWRT One hardware to dial back at a lower-than-stock temperature. I’m playing with this to determine what each setting does.

This all goes in System >> Startup >> Local Startup (the /etc/rc.local file):

# ==============================

# SET CPU THERMAL LIMITS:
echo 90000 > /sys/class/thermal/thermal_zone0/trip_point_0_temp # Hard Critical shutdown threshold
echo 85000 > /sys/class/thermal/thermal_zone0/trip_point_1_temp # Extreme throttle threshold
echo 75000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp # Aggressive throttle threshold
echo 65000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp # Maximum safe optimal operating temperature
echo 55000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp # The baseline operating threshold

# PROPERLY STAGED THERMAL LIMITS FOR WIFI CHIPS
sleep 10

for hwmon_dir in $(ls -d /sys/class/ieee80211/phy*/hwmon* 2>/dev/null); do
    MAX_FILE="${hwmon_dir}/temp1_max"
    CRIT_FILE="${hwmon_dir}/temp1_crit"

    if [ -f "$MAX_FILE" ] && [ -f "$CRIT_FILE" ]; then
        # Step 1: Push max out of the way of the original 110C critical ceiling
        echo "130000" > "$MAX_FILE"

        # Step 2: Now that max is 130C, we can safely bring critical down to 75C
        echo "75000" > "$CRIT_FILE"

        # Step 3: Finally, safely lower max to 85C
        echo "85000" > "$MAX_FILE"
    fi
done

# ==============================

Issue the command:

ps | grep rc.local

You’ll see something like this:

ps | grep rc.local
 3598 root      1332 S    grep rc.local
21369 root      1352 S    sh /etc/rc.local

So you’d issue:

kill 21369

Then you can restart /etc/rc.local to load the changes without having to reboot:

sh /etc/rc.local

I know /sys/class/thermal/thermal_zone0/trip_point_0_temp shuts down the router, and I know /sys/class/ieee80211/phy*/hwmon*/temp1_max shuts off the WiFi chip. The rest of them, I assume, are logging warnings and throttling the hardware to reduce heat generation.

You can ascertain that the settings took by issuing:

for file in /sys/class/ieee80211/phy*/hwmon*/temp1_*; do echo "$file: $(cat $file)"; done

… which should return:

/sys/class/ieee80211/phy0/hwmon1/temp1_crit: 75000
/sys/class/ieee80211/phy0/hwmon1/temp1_input: 50000
/sys/class/ieee80211/phy0/hwmon1/temp1_max: 85000
/sys/class/ieee80211/phy1/hwmon2/temp1_crit: 75000
/sys/class/ieee80211/phy1/hwmon2/temp1_input: 50000
/sys/class/ieee80211/phy1/hwmon2/temp1_max: 85000

… and by issuing:

grep . /sys/class/thermal/thermal_zone0/trip_point_*_temp

… which should return:

/sys/class/thermal/thermal_zone0/trip_point_0_temp:90000
/sys/class/thermal/thermal_zone0/trip_point_1_temp:85000
/sys/class/thermal/thermal_zone0/trip_point_2_temp:75000
/sys/class/thermal/thermal_zone0/trip_point_3_temp:65000
/sys/class/thermal/thermal_zone0/trip_point_4_temp:55000

Why for when you can grep?

grep ^ /sys/class/ieee80211/phy*/hwmon*/temp1_*

(EDIT: I saw you did use grep for the trip_points)