Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jan 2025 13:25:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 284338] x11/sfwbar: cpu-temp.widget shows wrong temperature in FreeBSD
Message-ID:  <bug-284338-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D284338

            Bug ID: 284338
           Summary: x11/sfwbar: cpu-temp.widget shows wrong temperature in
                    FreeBSD
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: fabio.comolli@gmail.com
                CC: tino.engel@mail.de
                CC: tino.engel@mail.de
             Flags: maintainer-feedback?(tino.engel@mail.de)

x11/sfwbar cpu-temp.widget uses cpu-temp.source to assign a value to
BsdCpuTemp, using BSDCtl("dev.cpu.0.temperature"). This function gets the v=
aule
in HEX and then converts it in DEC. The widget assumes that this value is i=
n =C2=B0C
and expressed with four digits without decimals, therefore it prints:

  value =3D Str(XCpuTemp/1000,0)+"C"

This is wrong as the sysctl HEX value is expressed in deciKelvin and thus to
convert it to Celsius you need to divide the value by 10 and subtract 273.1=
5 .
Something like:

  value =3D Str(XCpuTemp/10-273.15)+"C"

I think that there's also another bug, this time in cpu-temp.source : the l=
ine=20

  set XCpuTemp =3D If(!Ident(BSDCtl),CPUTemp,Val(BsdCPUTemp))

should read as:

  set XCpuTemp =3D If(!Ident(BSDCtl),CPUTemp,BsdCPUTemp)

otherwise the temperature value will always be reported as zero.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-284338-7788>