meuter / argon-one-case-ubuntu-20.04

port of the argon one case power button and fan script for Ubuntu 20.04 on rpi 4
255 stars 49 forks source link

Temp reading #2

Closed vojimen closed 3 years ago

vojimen commented 3 years ago

I tested this on Ubuntu 20.10 (Desktop) on the Pi 4, and when I run the argonone-tempmon command I am getting reading in the 36000 range ( 36024, 35537 ) etc. Are the numbers supposed to show up like that?

mrgfisher commented 3 years ago

Hi @vojimen ,

From a quick review of the script it does appear to: echo ' val = float(int(temp)/1000)' >> $powerbuttonscript

meuter commented 3 years ago

Hi,

The argonone-tempmon simply displays the output read from an entry in the sysfs:

while true; do clear; date; cat /sys/class/thermal/thermal_zone0/temp; sleep 1; done (line 568 in argon1.sh)

The linux kernel does indeed report the temperature using a finer scale that °C (1000 = 1°C). So on your RPI4, you are running effectively at around 36°C.

You can adapt the script as follows if you prefer degrees °C to be printed out directly:

while true; do clear; date; echo "$(( $(cat /sys/class/thermal/thermal_zone0/temp) / 1000 ))°C"; sleep 1 ; done

@mrgfisher the line you refer is used in the fan control script which I had to patch to comply with python 3.

meuter commented 3 years ago

As of this commit 6593850bcf1554bd7b8ae75aa7e22721473dd3f5 the script argonone-tempmon will display the temps in C°.