Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Temperature Widget

    Scheduled Pinned Locked Moved 2.1 Snapshot Feedback and Problems - RETIRED
    95 Posts 15 Posters 44.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      Guest
      last edited by

      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_Supported

      If you get an error message, then FreeBSD is not able to fetch the values via acpi and the widget is not shown.

      1 Reply Last reply Reply Quote 0
      • M
        markuhde
        last edited by

        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):

        1 Reply Last reply Reply Quote 0
        • ?
          Guest
          last edited by

          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
          
          
          1 Reply Last reply Reply Quote 0
          • M
            markuhde
            last edited by

            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?

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • rcfaR
                rcfa
                last edited by

                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 the

                sysctl hw.acpi.thermal

                returns zilch. :(
                Hence, of course, no reported temperature. No wonder I can't see it ;)

                1 Reply Last reply Reply Quote 0
                • C
                  Cino
                  last edited by

                  @rcfa:

                  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 the

                  sysctl 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.

                  1 Reply Last reply Reply Quote 0
                  • ?
                    Guest
                    last edited by

                    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.

                    pfsense_ajax.png_thumb
                    pfsense_ajax.png

                    1 Reply Last reply Reply Quote 0
                    • stephenw10S
                      stephenw10 Netgate Administrator
                      last edited by

                      For 2.0.1 (FreeBSD 8.1 base).
                      Copy coretemp.ko (32bit or 64bit) into /boot/modules
                      Add```
                      coretemp_load="YES"

                      
                      I thought these were already in 2.1?  :-\ Hence referencing them in the widget.
                      
                      Steve
                      1 Reply Last reply Reply Quote 0
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by

                        If motherboard manufacturers bothered to code their ACPI tables correctly there wouldn't be a problem!  >:(

                        Steve

                        Edit: response to a post that vanished.  ::)

                        1 Reply Last reply Reply Quote 0
                        • ?
                          Guest
                          last edited by

                          …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

                          1 Reply Last reply Reply Quote 0
                          • M
                            m4f1050
                            last edited by

                            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

                            1 Reply Last reply Reply Quote 0
                            • stephenw10S
                              stephenw10 Netgate Administrator
                              last edited by

                              Nope I was talking about the XTM5.
                              You can use the output of mbmon to drive the dashboard widget. We had a long thread up on this for 2.0.X, I'm sure a lot of it would be relevent here.
                              http://forum.pfsense.org/index.php/topic,39595.0.html

                              And here was my specific post:
                              http://forum.pfsense.org/index.php/topic,39595.msg204643.html#msg204643

                              Steve

                              1 Reply Last reply Reply Quote 0
                              • ?
                                Guest
                                last edited by

                                ah, informative - ill read that in a minute.

                                decided to just post what i got till now:
                                The code defaults to dev.cpu0 [as is] but is able to handle multiple acpi temperatures too if that module is used instead.

                                
                                function get_temp() {
                                //  queries thermal sensors via sysctl. 
                                // returns array of sensors and their corresponding values
                                
                                        $arr_parsed ="";
                                        $arr_temp = array();
                                
                                        $filter_acpi = "tz[0-1].temperature";
                                
                                     // escaping for possible inclusion in config.xml
                                
                                        $oid_cpu = escapeshellcmd("dev.cpu0.temperature");
                                        $oid_acpi = escapeshellcmd("hw.acpi.thermal");
                                
                                     // First, query for a processor specific sensor on the die
                                         exec("/sbin/sysctl '". $oid_cpu ."' | grep -E 'cpu.*temperature'" , $arr_cpu);
                                        // exec ("cat /root/temp_cpu | grep -E 'cpu.0.temperature'" , $arr_cpu);
                                
                                         if (arr_cpu != "") {
                                              $arr_temp = array_merge($arr_temp,$arr_cpu);
                                          }
                                
                                     // Alternative: query all acpi thermal zones.
                                
                                           exec ("sysctl ". $oid_temp ." | grep -E '". $filter_acpi ."'" , $arr_acpi);
                                          // exec ("cat /root/temp_acpi | grep -E '".$filter_acpi."'" , $arr_acpi);
                                
                                          if (arr_acpi != "") {
                                              $arr_temp = array_merge($arr_temp,$arr_acpi);
                                             }
                                
                                           foreach (($arr_temp) as $value) {
                                             preg_match("/tz[0-9]|cpu/i", $value, $sens_id); // get sensor id 
                                             preg_match("/[0-9]{1,2}.[0-9]/", $value, $sens_val);   // get temperature value
                                             $arr_parsed[] =  array ($sens_id, $sens_val);
                                           }
                                
                                           return($arr_parsed);
                                        }
                                
                                

                                is nearly finished now but well see. Anyway, its main purpose is to train me some pfSense gui customisation skills, so no problem for me.
                                Heres what its look like by now:

                                pfsense_ajax.png
                                pfsense_ajax.png_thumb

                                1 Reply Last reply Reply Quote 0
                                • rcfaR
                                  rcfa
                                  last edited by

                                  So where do we get the coretemp.ko that's compatible with pfSense 2.1 short of building a BSD 8.3 kernel?
                                  Is this going to end up in the regular distribution at some point or will this remain in the everyone interested hacks it in on their own territory?

                                  1 Reply Last reply Reply Quote 0
                                  • ?
                                    Guest
                                    last edited by

                                    Oh, its written Source independent (see discussion above) to let the users choose what they want to use.
                                    Edit:
                                    Im currently banned from the highspeed World and have to use gprs till eoM.  (:grm:)
                                    ill sync wt current git and do the commit as soon as my highpriced provider is able to…

                                    till then here are the other changed functions:

                                    
                                    function updateTemp(obj_json) {
                                    /*  modify the red / grey bar gifs according to the temperature
                                        ratio is one pixel per degree.
                                    */
                                    
                                            jQuery.map(obj_json,function(value,index){
                                            tempmeter = "#tempmeter" + value
                                            tempwidtha = "#tempwidtha" + value
                                            tempwidthb = "#tempwidthb" + value
                                            console.log(tempmeter);
                                    
                                            jQuery(tempwidthb).css('width',(100 - value[1]) + 'px');
                                    
                                            if(jQuery(tempmeter))
                                                    jQuery(tempmeter).html(value[1] + '\u00B0' + 'C');
                                            if(jQuery(tempwidtha))
                                                    jQuery(tempwidtha).css('width',value[1] + 'px');
                                            if(jQuery(tempwidthb))
                                            jQuery(tempwidthb).css('width',(100 - value[1]) + 'px');
                                    
                                    });
                                    
                                    

                                    and in system_information.widget.php

                                    
                                                            Temperature 
                                    
                                                                    ![left bar](./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif)![red bar](./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif)![gray bar](./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif)![right bar](./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif)
                                    
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • stephenw10S
                                      stephenw10 Netgate Administrator
                                      last edited by

                                      I don't have 2.1 running on anything right now so I can't check but is it not included in the image? If not it just needs copying from a FreeBSD 8.3 install.

                                      Steve

                                      1 Reply Last reply Reply Quote 0
                                      • D
                                        daplumber
                                        last edited by

                                        Any chance of an option for Deg F ? Large numbers of people just never grokked the metric system sadly.  :-\

                                        –--------
                                        This user has been carbon dated to the 8-bit era...

                                        1 Reply Last reply Reply Quote 0
                                        • ?
                                          Guest
                                          last edited by

                                          Hi, when the code gets accepted in main, then it will be in the image.
                                          sorry, for the first run it will stay with degree ;(

                                          But this patch is just the first of two. A further one, which i plan to be more dynamic and more configurable in the gui will follow.
                                          By now we have migration phase, where the view is generated by a mix of php and js output)
                                          In that second patch i plan to seperate them and use php only for the backend and js for the complete system_information.widget
                                          Edit - no lets keep it easy, just for the temps :)

                                          But for now - Ill note down a todo for an Option to switch output between Fahrenheit / Degrees ;)

                                          If you need it faster, you can add code to check for the timezone after the patch has been accepted.

                                          hanD !

                                          1 Reply Last reply Reply Quote 0
                                          • rcfaR
                                            rcfa
                                            last edited by

                                            Is there any chance to convert this into a package that also installs the coretemp.ko and loads it, because without this won't work on my system, and it being a fanless design, I'd love to know if things go badly in terms of temperature for some reason…

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.