Temperature Widget
-
The new temperature widget is a nice addition, but it would be great if we could select the temperature source. hw.acpi.thermal.tz0.temperature is always 26.8C on one of the pfSense systems I'm running, but hw.acpi.thermal.tz1.temperature is the correct CPU temperature (currently 34.0C) as reported in the BIOS.
-
Hi - this sounds like a not so complex task which i should be able to take care of. (learning js/jquery atm)
But on my vmware a sysctl hw.acpi.thermal shows no results, so i need asecond machine to test on.
Maybe thats why i have no such widget in the dashboard ? :)Hmm… but even in /usr/local/www/widgets/widgets is no file called temperature widget... is it really called like that ?
(running head from last friday) -
Sorry, it's a new part of the System Information widget, not it's own widget.
-
ah - then i have some point to start :)
Will hav look in the next days! -
okay gotit - the widget fetches the information from functions.inc.php
- i see that you want to query another temperatureZone (1)
when querying the cpu0 themperature gets us an empty string, (so meaning that the query failed)…
pfSense queries tz(0) which should be accessible on all systems that support temperature measuring.
see:
if ($temp_out == "") { exec("/sbin/sysctl hw.acpi.thermal.tz0.temperature | /usr/bin/awk '{ print $2 }' | /usr/bin/cut -d 'C' -f 1", $dfout); $temp_out = trim($dfout[0]); }
- Looking at the code - i have a question to pfSense Devs
There is a reference to get_hw_type, which seems to be planned to sense systemspecific things in the future to use corresponding values… But its currently empty. It might be reasonable to add the oid as a tunable and use dev.cpu0.temperature as a fallback.
Would this be an acceptable solution?
anyway heres an example functions.inc
if (isset($a_config["hw.temperature.oid"])) { $oid_temp = $a_config["hw.temperature.oid"]; } if ($oid_temp == "default" || $oid_temp == "") { $oid_temp = "dev.cpu.0.temperature"; //<- fixme: use this as a fallback and hw.acpi.thermal.tz0.temperature as default ? } $temp_out = ""; if ($oid_temp != "") { $oid_temp = escapeshellcmd($oid_temp); exec("/sbin/sysctl '{ print $oid_temp} ' | /usr/bin/awk '{ print $2 }' | /usr/bin/cut -d 'C' -f 1", $dfout); }
–--------
example config.inc<tunable>hw.temperature.oid</tunable> <value>default</value>
–--------
oh and please dont bash me too much if i got this wrong ;))
- i see that you want to query another temperatureZone (1)
-
I am not familiar with BSD at all, all I know is on my board, tz0 is always 26.8 (that's what's reported in the webgui) and tz1 is the actual CPU temp…
-
Where is the temperature supposed to show up? Can't find it in the system status widget. Or does it show only on certain systems and not on others?
-
It shows up between MBUF Usage and CPU Usage for me. But it always reads 26.8C (which is what tz0 reads, tz1 has the actual CPU temp) for me.
-
Not every system supports temperature mesuaring.
You can try to execute sysctl hw.acpi.thermal as shown by
http://doc.pfsense.org/index.php/What_Hardware_Monitoring_Is_SupportedIf you get an error message, then FreeBSD is not able to fetch the values via acpi and the widget is not shown.
-
Thanks for that link! I'm a total BSD newbie and didn't know I could get all the values like that. Here's the output on my system if it helps any. Again, the 26.8 is meaningless, and the 33 is the real CPU temp:
[2.1-DEVELOPMENT][admin@glacierfire.glaciercamp]/root(1): sysctl hw.acpi.thermal
hw.acpi.thermal.min_runtime: 0
hw.acpi.thermal.polling_rate: 10
hw.acpi.thermal.user_override: 0
hw.acpi.thermal.tz0.temperature: 26.8C
hw.acpi.thermal.tz0.active: 0
hw.acpi.thermal.tz0.passive_cooling: 1
hw.acpi.thermal.tz0.thermal_flags: 0
hw.acpi.thermal.tz0._PSV: 95.0C
hw.acpi.thermal.tz0._HOT: -1
hw.acpi.thermal.tz0._CRT: 100.0C
hw.acpi.thermal.tz0._ACx: 0.0C -1 -1 -1 -1 -1 -1 -1 -1 -1
hw.acpi.thermal.tz0._TC1: 1
hw.acpi.thermal.tz0._TC2: 5
hw.acpi.thermal.tz0._TSP: 10
hw.acpi.thermal.tz1.temperature: 33.0C
hw.acpi.thermal.tz1.active: -1
hw.acpi.thermal.tz1.passive_cooling: 0
hw.acpi.thermal.tz1.thermal_flags: 0
hw.acpi.thermal.tz1._PSV: -1
hw.acpi.thermal.tz1._HOT: -1
hw.acpi.thermal.tz1._CRT: 120.0C
hw.acpi.thermal.tz1._ACx: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
hw.acpi.thermal.tz1._TC1: -1
hw.acpi.thermal.tz1._TC2: -1
hw.acpi.thermal.tz1._TSP: -1
[2.1-DEVELOPMENT][admin@glacierfire.glaciercamp]/root(2): -
Hi, i was curious about the reason why cpu0 temperature mesuaring method wont run on some systems.
I came across
http://os4.org/wiki/freebsd_-_power-management.html
where this matter is discussed in more Detail.Im pretty sure that we really should first try to query acpi.thermal before querying cpu0 and will adapt the code accordingly.
Further on, i think about doing a 'sysctl hw.acpi.thermal | grep 'tz.*temperature' before and just display any value there.
this would also remove the need for the tunable.[2.1-DEVELOPMENT][admin@pfsense.localdomain]/root(4): grep 'tz.*temperature' acpi_thermal hw.acpi.thermal.tz0.temperature: 26.8C hw.acpi.thermal.tz1.temperature: 33.0C
-
That sounds like it'd be a perfect solution, if I understand correctly, it would just show any temperatures that exist - bogus or not, correct?
-
dev.cpu0.temperature is created by coretemp(4).
My box has a Core CPU but the ACPI is broken so I have no thermal zones.Steve
-
According to intel docs, the Atom D510 has an on-die thermal sensor that can be read.
Looks like BSD or some BIOS issue prevents that from happening, because thesysctl hw.acpi.thermal
returns zilch. :(
Hence, of course, no reported temperature. No wonder I can't see it ;) -
According to intel docs, the Atom D510 has an on-die thermal sensor that can be read.
Looks like BSD or some BIOS issue prevents that from happening, because thesysctl hw.acpi.thermal
returns zilch. :(
Hence, of course, no reported temperature. No wonder I can't see it ;)i'm using a atom d510 also, search the forum; there was a write up on how to install coretemp.ko on the system.
-
Hi,
afaik acpi was invented after those processor specific extensions were developed.
by now its available on most platforms and supports more sensors.
pfSense currently relies on dev.cpu.temperature and uses ACPI.tz0 as a fallback.
but only one sensorvalue of them is shown and this might be wrong.For this reason i expanded the code in my tree to ask acpi for all the temp sensors.
This will give us more options in the GUI, including to select coretemp when we want.
Ill post a patch when its ready, so everyone can test it.
-
-
If motherboard manufacturers bothered to code their ACPI tables correctly there wouldn't be a problem! >:(
Steve
Edit: response to a post that vanished. ::)
-
…repost...
Hehe, im running on virtualized hardware, so i need to ask my bank to buy a new system which supports the processor specific module ;))
Anyway, both will be supported bythe widget -
Steve, are you referring to the FireBox X500?
Recently my FB X500 fan/blower died and I had to open my X500, put a cpu fan in place of the blower and leave the cover off while I wait for new replacements I ordered off of eBay (from HK of course…) and was wondering if there was a way of enabling such widget for a Celeron 1200Mhz