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

    Simple fan speed control for the Firebox X750e

    Scheduled Pinned Locked Moved Hardware
    87 Posts 12 Posters 34.1k 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.
    • P
      power_matz
      last edited by

      Hi,

      I am using an Intel(R) Pentium(R) M processor 1.70GHz with PowerD enabled.

      Matthias

      1 Reply Last reply Reply Quote 0
      • S
        Steve Evans
        last edited by

        That explains it then. I'm being power mad again! :D

        An interesting comparison for anybody trying to build a lower power router then. I went for the more powerful option as I wanted to be future proofed should my broadband speed increase again, and also as I didn't know if I'd want to be using squid etc when I started.

        Steve

        1 Reply Last reply Reply Quote 0
        • B
          bmatic586
          last edited by

          @Steve:

          This has been working reliably for some time, so having just updated to 2.1 and re-applied this fix I though I might as well post a complete set of files.

          Rename the attachment to lose the .png suffix and decompress. You'll find the following files. Copy them to the directory shown. Ensure that the sh files and WGXepc are executable.

          | Filename | Target Directory |
          | fanctrl.sh | /usr/local/etc/rc.d |
          | fanctrld.sh | /usr/local/sbin |
          | functions.inc.php | /usr/local/www/includes |
          | system_information.widget.php | /usr/local/www/widgets/widgets |
          | WGXepc | /usr/local/bin |

          Start the fan control thus, or simply reboot:

          # /usr/local/etc/rc.d/fanctrl.sh
          

          You should hear the fans slow considerably. The daemon will try to maintain the set temperature of 64 degC. After some experimentation I found this to work well.

          Credit is due here to stephenw10 for the WGXepc utility. Note that he's produced a couple of versions, and you need this one as it reports temperature.

          The php scripts will read the CPU temperature and display it on the dashboard as the attached image.

          Steve

          For us n00bs… :) can you tell us how to copy these files to the pfSense file system? how do you change the permissions?

          I guess I'm kind of looking for a step by step on how to do this. I just recently got a 1250e and it works great, but I'd like to quiet it down a bit and change the red LED.

          Thanks.

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

            One way of doing it is explained here:
            https://doc.pfsense.org/index.php/PfSense_on_Watchguard_Firebox#Controlling_hardware_with_WGXepc
            I've just noticed though that my Google site still has version 0.8 which doesn't read the temperature. I'll get that updated. (Edit: done)

            You can also use SCP to move files onto the pfSense box. I use WinSCP for that.

            Steve

            1 Reply Last reply Reply Quote 0
            • B
              bmatic586
              last edited by

              @stephenw10:

              One way of doing it is explained here:
              https://doc.pfsense.org/index.php/PfSense_on_Watchguard_Firebox#Controlling_hardware_with_WGXepc
              I've just noticed though that my Google site still has version 0.8 which doesn't read the temperature. I'll get that updated. (Edit: done)

              You can also use SCP to move files onto the pfSense box. I use WinSCP for that.

              Steve

              Got it. I think it's working…  I can see the temperature now being displayed in the status screen.

              When I run WGXepc -f it shows me a value of bb... is that the lowest it'll go?
              Thanks again for your help.

              My temperature shows 45 deg. C.

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

                BB is the lowest speed you can run the fans where the speed sensors work. The fans can run much slower though.  The value is a two digit hexidecimal number so anything between 00 and FF. I wouldn't go below, say, 16 though.
                If you're using the script it should be going lower than bb anyway.

                Steve

                1 Reply Last reply Reply Quote 0
                • B
                  bmatic586
                  last edited by

                  @stephenw10:

                  BB is the lowest speed you can run the fans where the speed sensors work. The fans can run much slower though.  The value is a two digit hexidecimal number so anything between 00 and FF. I wouldn't go below, say, 16 though.
                  If you're using the script it should be going lower than bb anyway.

                  Steve

                  when I ran

                  /usr/local/etc/rc.d/fanctrl.sh
                  

                  it didn't really slow down, and when I checked the fan speed by running WGXepc -f, it just said bb, so I manually set it to 20. Temp is not going above 50 C, but it would be nice to have it automatically control the fan instead of me manually configuring it.

                  Any other thoughts as to why it's not working?

                  Thanks again for your help.

                  1 Reply Last reply Reply Quote 0
                  • chpalmerC
                    chpalmer
                    last edited by

                    Where did you get your files?

                    https://forum.pfsense.org/index.php/topic,66129.msg366219.html#msg366219

                    Triggering snowflakes one by one..
                    Intel(R) Core(TM) i5-4590T CPU @ 2.00GHz on an M400 WG box.

                    1 Reply Last reply Reply Quote 0
                    • B
                      bmatic586
                      last edited by

                      @chpalmer:

                      Where did you get your files?

                      https://forum.pfsense.org/index.php/topic,66129.msg366219.html#msg366219

                      yes… that's where I downloaded them from and put them in the directories as outlined below.

                      Filename                                         Target Directory
                      fanctrl.sh                                         /usr/local/etc/rc.d
                      fanctrld.sh                                   /usr/local/sbin
                      functions.inc.php                         /usr/local/www/includes
                      system_information.widget.php   /usr/local/www/widgets/widgets
                      WGXepc                                         /usr/local/bin

                      I also did a chmod 0755 on fanctrl.sh, fanctrld.sh and WGXepc and then executed```
                      /usr/local/etc/rc.d/fanctrl.sh

                      
                      Also, when I executed the above code, the LED that normally red, didn't turn green like it was supposed to as described in this thread.
                      
                      Thanks guys.
                      1 Reply Last reply Reply Quote 0
                      • B
                        bmatic586
                        last edited by

                        @bmatic586:

                        @chpalmer:

                        Where did you get your files?

                        https://forum.pfsense.org/index.php/topic,66129.msg366219.html#msg366219

                        yes… that's where I downloaded them from and put them in the directories as outlined below.

                        Filename                                         Target Directory
                        fanctrl.sh                                         /usr/local/etc/rc.d
                        fanctrld.sh                                   /usr/local/sbin
                        functions.inc.php                         /usr/local/www/includes
                        system_information.widget.php   /usr/local/www/widgets/widgets
                        WGXepc                                         /usr/local/bin

                        I also did a chmod 0755 on fanctrl.sh, fanctrld.sh and WGXepc and then executed```
                        /usr/local/etc/rc.d/fanctrl.sh

                        
                        Also, when I executed the above code, the LED that normally red, didn't turn green like it was supposed to as described in this thread.
                        
                        Thanks guys.
                        

                        Just an update… I rebooted the FW today and it's working the way it should now.

                        Thanks for all the help.

                        1 Reply Last reply Reply Quote 0
                        • chpalmerC
                          chpalmer
                          last edited by

                          @bmatic586:

                          Just an update… I rebooted the FW today and it's working the way it should now.

                          Thanks for all the help.

                          I was coming here to mention that I had to reboot when I installed, according to my notes.  Glad you got it working!  :)

                          Triggering snowflakes one by one..
                          Intel(R) Core(TM) i5-4590T CPU @ 2.00GHz on an M400 WG box.

                          1 Reply Last reply Reply Quote 0
                          • P
                            power_matz
                            last edited by

                            @Steve:

                            Intel(R) Pentium(R) M processor 2.13GHz

                            I don't have PowerD enabled though. That could well explain it. I should probably enable that as I'm sure the CPU will "wake up" to a higher power state quite quickly on demand.

                            The temperature diode is part of the CPU die, not an external sensor.

                            Steve

                            Hi Steve,

                            have you enabled PowerD?
                            I got an Intel Pentium M with 2.13 GHz and I enabled PowerD. But the display shows max speed of 1592 Mhz.
                            Do you think this is incorrect and the speed is 2.13?

                            Matthias

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

                              Well that's obviously wrong somewhere.  ;)
                              Did you switch both sets of jumpers? It looks like it's running a 400MHz FSB and should be 533MHz.
                              Which model Pentium-M exactly did you fit?
                              The 2.13GHz models are all 533MHz FSB and as such are not hard coded into the est(4) driver. I've not seen powerd work correctly with any 533MHz pentium-m. Usually it just doesn't start because there is no freq controlling driver loaded, there would be something in the logs to that effect.

                              Steve

                              1 Reply Last reply Reply Quote 0
                              • P
                                power_matz
                                last edited by

                                Hi Steve,

                                I set one jumper array: two DIP switches changed like the picture shows. Is there's another DIP array?

                                The speed is changing, so PowerD is doing something…

                                Matthias

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

                                  There are two sets of DIP switches, one set of two and another set of 4(?). The larger set are between the CPU and the PSU. Both must be switched.
                                  Interesting that powerd is working, perhaps it has mistaken the CPU for one that it knows about. Be interesting to find out what happens when you set the second DIP switches.

                                  Steve

                                  1 Reply Last reply Reply Quote 0
                                  • P
                                    power_matz
                                    last edited by

                                    Hi,

                                    after changing the other jumpers accordingly everything runs like expected.  ;D

                                    Damn, I've done this to my X750e some time ago. I couldn't remember….  :-[

                                    Thanks a lot!

                                    Matthias

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      Steve Evans
                                      last edited by

                                      @bmatic586:

                                      @stephenw10:

                                      BB is the lowest speed you can run the fans where the speed sensors work. The fans can run much slower though.  The value is a two digit hexidecimal number so anything between 00 and FF. I wouldn't go below, say, 16 though.
                                      If you're using the script it should be going lower than bb anyway.

                                      Steve

                                      when I ran

                                      /usr/local/etc/rc.d/fanctrl.sh
                                      

                                      it didn't really slow down, and when I checked the fan speed by running WGXepc -f, it just said bb, so I manually set it to 20. Temp is not going above 50 C, but it would be nice to have it automatically control the fan instead of me manually configuring it.

                                      Any other thoughts as to why it's not working?

                                      Thanks again for your help.

                                      The fanctrl.sh script should be passed an argument of either start or stop. Unfortunately I omitted the start in my original instructions. I can no longer edit that post. To save further confusion could a moderator please amend my post, reply #34, to state:

                                      /usr/local/etc/rc.d/fanctrl.sh start
                                      

                                      Thanks,

                                      Steve

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

                                        Hi,

                                        I liked the idea of the script file to monitor the temps.  I think using cron to kick of a script to check the temps and react accordingly is also a good idea.  This will ensure the temps are always checked; default 1 min if you use default cron entries.  If the daemon script fails it may not restart; just my $0.02.  I added this to crontab

                                        
                                        #crontab for root
                                        # Format is
                                        # min hour dayOfMonth month dayOfWeek command2Execute
                                        
                                        # backup home every 3 days starting from the 1st @ 2:05 am
                                        # the first of every 3rd month purge
                                        # min hour dom month dow
                                        # --- ---- --- ----- ---
                                           *   *    *    *    *  /usr/local/bin/adjustFanSpeed.sh
                                        
                                        

                                        use this command to edit the cron entries

                                        crontab -e 
                                        

                                        The script I wrote looks like this

                                        
                                        #! /bin/tcsh
                                        
                                        set currentTemp = `/usr/local/bin/cpuTemp -t | sed '1,2d'`
                                        
                                        if ( $currentTemp > 70 ) then
                                          /usr/local/bin/fanspeed -f ff > /dev/null
                                          /usr/local/bin/setLED -l red_flash > /dev/null
                                          foreach indx (1 1 1 1 1)
                                            /usr/local/bin/beep -p 500 50
                                          end
                                        else if ( $currentTemp > 65 ) then
                                          /usr/local/bin/fanspeed -f ee > /dev/null
                                          /usr/local/bin/setLED -l red_flash > /dev/null
                                          foreach indx (1 1 1 1)
                                            /usr/local/bin/beep -p 500 50
                                          end
                                        else if ( $currentTemp > 60 ) then
                                          /usr/local/bin/fanspeed -f dd > /dev/null
                                          /usr/local/bin/setLED -l red_flash > /dev/null
                                          foreach indx (1 1 1)
                                            /usr/local/bin/beep -p 500 50
                                          end
                                        else if ( $currentTemp > 55 ) then
                                          /usr/local/bin/fanspeed -f bb > /dev/null
                                        else if ( $currentTemp > 50 ) then
                                          /usr/local/bin/fanspeed -f aa > /dev/null
                                        else if ( $currentTemp > 45 ) then
                                          /usr/local/bin/fanspeed -f 90 > /dev/null
                                        else if ( $currentTemp > 40 ) then
                                          /usr/local/bin/fanspeed -f 80 > /dev/null
                                        else
                                          /usr/local/bin/fanspeed -f 50 > /dev/null
                                          /usr/local/bin/setLED -l off  > /dev/null
                                        endif
                                        
                                        

                                        fanspeed and cpuTemp are just links to WGXepc (thanks Stephen).

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          Steve Evans
                                          last edited by

                                          My script hasn't failed yet and it provides proportional response. From a control theory perspective, much better. :)

                                          Steve

                                          1 Reply Last reply Reply Quote 0
                                          • P
                                            power_matz
                                            last edited by

                                            Hi,

                                            after some time the display of the temperate in the dashboard gets corrupted. Please see screen shot.
                                            The fans are running at low speed. But the green LED is blinking. Any idea?

                                            Matthias

                                            ![Bildschirmfoto 2014-04-28 um 16.57.35.jpg_thumb](/public/imported_attachments/1/Bildschirmfoto 2014-04-28 um 16.57.35.jpg_thumb)
                                            ![Bildschirmfoto 2014-04-28 um 16.57.35.jpg](/public/imported_attachments/1/Bildschirmfoto 2014-04-28 um 16.57.35.jpg)

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