Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Raspberry Pi 4 CPU temperature #1960

Open
1 task
juanca1944 opened this issue Nov 17, 2021 · 2 comments
Open
1 task

Raspberry Pi 4 CPU temperature #1960

juanca1944 opened this issue Nov 17, 2021 · 2 comments

Comments

@juanca1944
Copy link

Description

As it was not possible to get the CPU temperature on Raspberry Pi 4 I added the following code in the section
"# Select the right temperature file."

    if [ "$kernel_machine" == "armv7l" ]; then
           temp_dir=/sys/class/thermal/thermal_zone0/temp
        fi

It works for me
Sorry, but I'm not proficient on Github

If you're suggesting a new feature then just a description will suffice.

  • Does this issue still occur in the master branch? (Required if issue)

Neofetch version 7.1.0

Screenshot

Config file

Verbose log

  1. Run neofetch -vv 2> neofetchlog
  2. Upload the contents of neofetchlog to pastebin, gist or equivalent.
@satmandu
Copy link

This doesn't cover 64-bit mode.
However, this will give CPU & GPU temp for an RPI in both 32-bit and 64-bit mode:

CPU=$(</sys/class/thermal/thermal_zone0/temp)
CPU="temp=$(echo "scale=1; $CPU/1000" | bc)'C"
VCGENCMD="${VCGENCMD:-/opt/vc/bin/vcgencmd}"
GPU=$(sudo $VCGENCMD measure_temp)

@juanca1944
Copy link
Author

Thanks Satmandu, just add an -o "$kernel_machine" == "aarch64"
The intention of my code is to be used within neoftech.
I use the following alias:
alias temp='echo -e "CPU => $(echo "scale=1; $(< /sys/class/thermal/thermal_zone0/temp)/1000" | bc)°C\nGPU => $(/opt/vc/bin/vcgencmd measure_temp | cut -d = -f2)"'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants