Search code examples
raspberry-piraspbianbroadcom

How Raspbian can control temperature by setup temp_limit in config.txt


Just got a new Rpi gen #3, which has default /boot/config.txt has

temp_limit=85

I then turn that down to

temp_limit=70

after a reboot, it works. If you don't know how to stress the Pi processor, and how to read the temperature of that, feel free to clone my simple github code (shell script) and run that.

 https://github.com/Fisherworks/raspberry_pi_stress

I thought it's dynamic lowering frequency which can limit the temperature of Rpi - but using the following command, it shows the frequency is still 1200000, which means it's running on full power.

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

Now the question is - How Raspbian control the temperature of BCM processor without reducing the freq?


Solution

  • Try this instead.

    vcgencmd measure_clock arm
    

    And you can check if it is being(has been), throttled, capped, or in under-voltage by this.

    vcgencmd get_throttled
    

    https://retropie.org.uk/forum/topic/2295/runcommand-warning-if-voltage-temperature-throttling

    return code is like 0x50005.

    bit pattern:

    • 0: under-voltage
    • 1: arm frequency capped
    • 2: currently throttled
    • 16: under-voltage has occurred
    • 17: arm frequency capped has occurred
    • 18: throttling has occurred

    update: I know the command you used;

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

    But it seems not used anymore and I found the new one being used;

    sudo cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq
    

    You can use it or vcgencmd.