You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All temp sensors are unavailable, if one of them returns an error.
In my case /sys/class/thermal/thermal_zone0/temp returns /sys/class/thermal/thermal_zone0/temp: No data available this leads to x86 and iwilwfi being unavailable. I changed mainboard and cpu and now do have a wifi card installed, but it is disabled in bios, but it still shows up as zone0 but with no data.
Edit: Edited the post. I confused zone 1 and 0.
The text was updated successfully, but these errors were encountered:
I had a problem where the script would not be able to parse temperatures if one of the sensors were unavailable, instead getting an awk error. I solved by editing the temperature function to this:
temperature() {
# Check if any thermal zones are available
if ! ls /sys/class/thermal/thermal_zone* > /dev/null 2>&1; then
return 1
fi
sep=""
for tz in /sys/class/thermal/thermal_zone*; do
# Verify the type file exists and is readable
if [[ -r "$tz/type" && -r "$tz/temp" ]]; then
sensor_name="temperature_$(sed 's/-/_/' < "$tz/type")_C"
# Check if awk can read the temp file correctly
temp=$(awk '{printf "%.2f", $1 / 1000}' "$tz/temp" 2>/dev/null)
if [[ $? -ne 0 ]]; then
# If awk fails, skip to the next iteration
continue
fi
echo -n "$sep"
sep=","
# Only print if awk was successful
print_key_vals "$sensor_name" "$temp"
fi
done
}
All temp sensors are unavailable, if one of them returns an error.
In my case
/sys/class/thermal/thermal_zone0/temp
returns/sys/class/thermal/thermal_zone0/temp: No data available
this leads to x86 and iwilwfi being unavailable. I changed mainboard and cpu and now do have a wifi card installed, but it is disabled in bios, but it still shows up as zone0 but with no data.Edit: Edited the post. I confused zone 1 and 0.
The text was updated successfully, but these errors were encountered: