Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU Temperature not working with 2.13-beta6 #374

Open
SabineTobi opened this issue Aug 3, 2021 · 10 comments
Open

CPU Temperature not working with 2.13-beta6 #374

SabineTobi opened this issue Aug 3, 2021 · 10 comments

Comments

@SabineTobi
Copy link

Hi!
With version 2.13-beta6 I can not monitor the CPU Temperature with the template temerature.conf. RPi-Monitor is showing only NULL as temperature!
With version 2.12-r0 it does as expected.

Regards,
Sabine

@Lusbueb69
Copy link

Same Problem and my Workaround is this, with all digits:

Change Line 14 in the temperature.conf from:

dynamic.1.postprocess=sprintf("%.2f", $1/1000)

to

dynamic.1.postprocess=$1/1000

@hackslikeus
Copy link

hackslikeus commented Nov 27, 2021

for those of us still using ye ol fair in height: (not sure why $1001 is italicized below, but use the example above-same formula)
dynamic.1.name=soc_temp
dynamic.1.source=/sys/devices/virtual/thermal/thermal_zone0/temp
dynamic.1.regexp=(.
)
dynamic.1.postprocess=($1*.001)
dynamic.1.rrd=GAUGE

dynamic.20.name=sof_temp
dynamic.20.source=/sys/devices/virtual/thermal/thermal_zone0/temp
dynamic.20.regexp=(.*)
dynamic.20.postprocess=((($1/1000)*1.8)+32)
dynamic.20.rrd=GAUGE

@beohna
Copy link

beohna commented Dec 8, 2021

Same problem with the CPU Temperature (2.13-beta6 ).

Why is there no new beta?

@beohna
Copy link

beohna commented Dec 8, 2021

The workarounds above didn't work on my raspi 4B.

@JappeHallunken
Copy link

JappeHallunken commented Feb 2, 2022

Another workaround, shows no decimal places at all:
dynamic.1.postprocess=floor($1/1000)

Tested on a RPi 4B

@JappeHallunken
Copy link

Or maybe ceil() would be the better choice for temperatures, because it's rounds the value up.

@MichaIng
Copy link

MichaIng commented Feb 2, 2022

The problem is the "new" ability to define multiple postprocess steps comma-separated: 56ba6e9#diff-ba4b03131626dc7d144ab66856ad8f9306bad3c958e5a20cda2a0a9e655208d4R777

Since sprintf("%.2f", $1/1000) contains a comma, it is broken and evaluated in two parts 😄. So yeah, we need a function/method which does not contain any comma. Instead of lower(), I suggest int($1/1000 + 0.5) to have correct rounding instead of always rounding down. But better would be something with decimal support, of course. I'm no perl coder, but will have a look into possibilities.

@wsegatto
Copy link

wsegatto commented Aug 1, 2022

Better yet, @MichaIng, if you want decimal places with the 'int' function:

int($1/1000) --> No decimal places
int($1/100)/10 --> 1 decimal place
int($1/10)/100 --> 2 decimal places

Why do you mean when you said "'new' ability"? What's changed? RPIMonitor? There hasn't been a commit for so long now. I wonder what you meant by that. Just curious.

@MichaIng
Copy link

MichaIng commented Aug 1, 2022

@wsegatto
Thanks for your suggestion. But this will always round down, isn't it? The + 0.5 assures it is mathematically correctly rounded, so up from .5 on. Would this work?

int($1/10 + 0.5)/100

Why do you mean when you said "'new' ability"?

Yeah, the commit is from 2018, hence the quotation marks 😉. Interesting that the bug was reported 3 years later the first time 🤔.

@MichaIng
Copy link

MichaIng commented Aug 1, 2022

Ah lol, we went that way already. Too long ago so I forgot about the details: https://github.com/MichaIng/DietPi/pull/5232/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants