Calabrone
Posts: 4
Joined: Sun Aug 18, 2019 9:38 pm

How to get Temperature - [SOLVED]

Mon Aug 19, 2019 1:33 pm

Hi there. I've an Rpi4 using with OMV as a NAS.
I'd like to monitor the temperature and adjust the fan speed: but i don't know how to read the CPU temperature.
I'm using the distro provided by OpenMediaVault and i've seen there's the possibility to get CPU temperature from armbian-config or when i login to Rpi.
Cattura.PNG
Cattura.PNG (17.07 KiB) Viewed 1037 times
How can i get that temperature?
Thank you in advance.
Last edited by Calabrone on Tue Aug 20, 2019 11:01 am, edited 2 times in total.

User avatar
RaTTuS
Posts: 10412
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: How to get Temperature

Mon Aug 19, 2019 1:40 pm

vcgencmd measure_temp

also
possibly
check out
cat .bashrc
[it may work]
Last edited by RaTTuS on Mon Aug 19, 2019 1:41 pm, edited 1 time in total.
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
neilgl
Posts: 784
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: How to get Temperature

Mon Aug 19, 2019 1:41 pm

Does this work from the command line when you are logged in?

Code: Select all

vcgencmd measure_temp

Calabrone
Posts: 4
Joined: Sun Aug 18, 2019 9:38 pm

Re: How to get Temperature

Mon Aug 19, 2019 4:34 pm

I've already tried that command, but the lib vcgencmd seems not available.

Code: Select all

vcgencmd: command not found

User avatar
B.Goode
Posts: 8255
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: How to get Temperature

Mon Aug 19, 2019 4:39 pm

Calabrone wrote:
Mon Aug 19, 2019 4:34 pm
I've already tried that command, but the lib vcgencmd seems not available.

Code: Select all

vcgencmd: command not found


I'm using the distro provided by OpenMediaVault


Perhaps you should be seeking advice from whoever builds/maintains/distributes that third-party Operating System?

danjperron
Posts: 3391
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: How to get Temperature

Mon Aug 19, 2019 5:25 pm

The welcome scripts are in /etc/update-motd.d

Check the script "30-sysinfo".

Code: Select all

function getboardtemp() {
        if [ -f /etc/armbianmonitor/datasources/soctemp ]; then
                read raw_temp </etc/armbianmonitor/datasources/soctemp 2>/dev/null
                if [ ! -z $(echo "$raw_temp" | grep -o "^[1-9][0-9]*\.\?[0-9]*$") ] && (( $(echo "${raw_temp} < 200" |bc -l) )); then
                        # Allwinner legacy kernels output degree C
                        board_temp=${raw_temp}
                else
                        # Marvell gets special treatment for whatever reasons
                        grep -qi Marvell /proc/cpuinfo && \
                                board_temp=$(( $(awk '{printf("%d",$1/1000)}' <<<${raw_temp}) - 20 )) || \
                                board_temp=$(awk '{printf("%d",$1/1000)}' <<<${raw_temp})
                fi
        elif [ -f /etc/armbianmonitor/datasources/pmictemp ]; then
                # fallback to PMIC temperature
                board_temp=$(awk '{printf("%d",$1/1000)}' </etc/armbianmonitor/datasources/pmictemp)
        fi
} # getboardtemp
Try manually to figure out which line hold the correct temperature.

Calabrone
Posts: 4
Joined: Sun Aug 18, 2019 9:38 pm

Re: How to get Temperature

Mon Aug 19, 2019 9:40 pm

danjperron wrote:
Mon Aug 19, 2019 5:25 pm
The welcome scripts are in /etc/update-motd.d

Check the script "30-sysinfo".

Try manually to figure out which line hold the correct temperature.
Thank you very much! The temperature is stored in /etc/armbianmonitor/datasources/soctemp file.

Return to “Other”