Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2448

Raspberry Pi OS • Re: Get max temperature the easy way

$
0
0
Maybe something like:

Code:

#!/bin/bashmax=0while true; do    current=$(cat /sys/devices/virtual/thermal/thermal_zone0/temp)    if (( current > max )); then        max=$current        echo "New max temperature: $(( max / 1000 )).$(( max % 1000 )) °C" | systemd-cat    fi    sleep 3  # Poll every 3 secondsdone
I've switched to using sysfs for temperature (as that's more standard on non-pi devices than vcgencmd).
journalctl will show the output.

Statistics: Posted by dom — Wed Mar 05, 2025 1:56 pm



Viewing all articles
Browse latest Browse all 2448

Trending Articles