PID fan controller Perl script

Stux

MVP
Joined
Jun 2, 2016
Messages
4,358
This gets back to why I wrote the hybrid cpu/hd fan controller in the first place. I found that the BMC was fiddling with the HD fan settings when I only wanted it to do the CPU fan. And the only way I could do what I wanted was to go and do it. I think :)

History is in your original thread.

Still, if I hadn’t have found a solution for my case (max with manual scripted control), I might’ve dealt with the need to continually adjust the fans to override the BMC.
 

JRD

Dabbler
Joined
Apr 21, 2018
Messages
42
I'm pretty sure that the BMC will attempt to keep controlling the fan speed in response to CPU and a temp sensor on the mother board, if the mode is Optimal. It is quite probable that the BMC will also attempt to control the fans in other fan modes too. You'll need to do some testing to see.

My notes say that the raw command to set Optimal mode is ipmitool raw 0x30 0x45 0x01 0x02 and the command for Standard mode is ipmitool raw 0x30 0x45 0x01 0x00.

I'm not sure what the command for Heavy I/O mode is. It might be ipmitool raw 0x30 0x45 0x01 0x03 or ipmitool raw 0x30 0x45 0x01 0x04

I first reset the thresholds to remove that variable then checked Optimal mode was set.

I then used a raw command to set Zone 1 to 100% duty cycle. FANA is my header for the fans in that Zone. ipmitool sdr gave a fan speed of 1200 rpm.

After 1 hour and 20 minutes it was still in Optimal and running at 1200 rpm. The BMC has not overidden that state/command.

I then entered the command to re-assert the Optimal mode
ipmitool raw 0x30 0x45 0x01 0x02
checked the fan speeds
Code:
 ipmitool sdr | grep FAN
FAN1			 | 1000 RPM		  | ok
FAN2			 | 400 RPM		   | nc
FAN3			 | 400 RPM		   | nc
FAN4			 | 400 RPM		   | nc
FANA			 | 800 RPM		   | ok


the fan speed had dropped to 800 rpm
 
Joined
Dec 2, 2015
Messages
730
I first reset the thresholds to remove that variable then checked Optimal mode was set.

I then used a raw command to set Zone 1 to 100% duty cycle. FANA is my header for the fans in that Zone. ipmitool sdr gave a fan speed of 1200 rpm.

After 1 hour and 20 minutes it was still in Optimal and running at 1200 rpm. The BMC has not overidden that state/command.

I then entered the command to re-assert the Optimal mode
ipmitool raw 0x30 0x45 0x01 0x02
checked the fan speeds
Code:
 ipmitool sdr | grep FAN
FAN1			 | 1000 RPM		  | ok
FAN2			 | 400 RPM		   | nc
FAN3			 | 400 RPM		   | nc
FAN4			 | 400 RPM		   | nc
FANA			 | 800 RPM		   | ok


the fan speed had dropped to 800 rpm
This is encouraging. This is some hope.

Search in the script for the section titled "## CPU TEMP CONTROL", and set $cpu_temp_control = 0

Search in the script for all the lines "set_fan_mode("full");" and change them to "set_fan_mode("optimal");"

These changes will set the fan mode to Optimal when the script starts up, and whenever the script detects that the BMC is not controlling the fans.

These changes will also prevent the script from controlling the CPU fan, leaving that to the BMC to manage. You'll need to do some testing to confirm that the BMC is setting CPU fan duty cycle appropriatedly.
 

JRD

Dabbler
Joined
Apr 21, 2018
Messages
42
This is encouraging. This is some hope.

Search in the script for the section titled "## CPU TEMP CONTROL", and set $cpu_temp_control = 0

Search in the script for all the lines "set_fan_mode("full");" and change them to "set_fan_mode("optimal");"

These changes will set the fan mode to Optimal when the script starts up, and whenever the script detects that the BMC is not controlling the fans.

These changes will also prevent the script from controlling the CPU fan, leaving that to the BMC to manage. You'll need to do some testing to confirm that the BMC is setting CPU fan duty cycle appropriatedly.

It was going so well.....
Code:
./PID_fan_control.pl
Number found where operator expected at ./PID_fan_control.pl line 40, near "are 1"
		(Do you need to predeclare are?)
Scalar found where operator expected at ./PID_fan_control.pl line 43, near "$high_cpu_temp"
		(Missing semicolon on previous line?)
syntax error at ./PID_fan_control.pl line 40, near "are 1"
syntax error at ./PID_fan_control.pl line 106, near "the last period"
BEGIN not safe after errors--compilation aborted at ./PID_fan_control.pl line 108.
root@NAS:/mnt/Storage/Scripts #


Can you please clarify the way through that? The script ran previously.
Thank you
 
Joined
Dec 2, 2015
Messages
730
It was going so well.....
Code:
./PID_fan_control.pl
Number found where operator expected at ./PID_fan_control.pl line 40, near "are 1"
		(Do you need to predeclare are?)
Scalar found where operator expected at ./PID_fan_control.pl line 43, near "$high_cpu_temp"
		(Missing semicolon on previous line?)
syntax error at ./PID_fan_control.pl line 40, near "are 1"
syntax error at ./PID_fan_control.pl line 106, near "the last period"
BEGIN not safe after errors--compilation aborted at ./PID_fan_control.pl line 108.
root@NAS:/mnt/Storage/Scripts #


Can you please clarify the way through that? The script ran previously.
Thank you
Attach the edited version of your script to this thread and I'll take a look at it.
 

JRD

Dabbler
Joined
Apr 21, 2018
Messages
42
Attach the edited version of your script to this thread and I'll take a look at it.
Thanks for looking at this
[I added the code and got this message:
The following error occurred:
Please enter a message with no more than 30000 characters.
 

JRD

Dabbler
Joined
Apr 21, 2018
Messages
42
I'll try with a zip
 

Attachments

  • new 1.zip
    10.6 KB · Views: 349

JRD

Dabbler
Joined
Apr 21, 2018
Messages
42
Let's try again
 

Attachments

  • new 1.txt
    41.1 KB · Views: 428
Joined
Dec 2, 2015
Messages
730
Something isn't adding up. If I search the file you sent for the text included in the perl errors, all the supposed errors are in comments, and thus shouldn't have been seen by the perl interpreter.

Is it possible that the file on your server differs from the one you attached to this thread? Specifically, I wonder if the file on the server has some extra line breaks that mean that part of the comments no longer have a "#" preceding them on the same line?
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,358
How did you edit the file?
 

JRD

Dabbler
Joined
Apr 21, 2018
Messages
42
Something isn't adding up. If I search the file you sent for the text included in the perl errors, all the supposed errors are in comments, and thus shouldn't have been seen by the perl interpreter.

Is it possible that the file on your server differs from the one you attached to this thread? Specifically, I wonder if the file on the server has some extra line breaks that mean that part of the comments no longer have a "#" preceding them on the same line?

I am not comfortable yet using the default editor so I download a fresh copy of your script each time to Notepad++
https://github.com/khorton/nas_fan_control/blob/master/PID_fan_control_borg.pl
Go to the Raw page and copy that: ctrl A ctrl C and paste into Notepad++
I have changed the default Edit EOL to Unix
I used the Search function to find the lines you suggested above

ctrl A ctrl C and right click into a Nano buffer I had already set up for the script

I have attached the latest copy of the edited script from Notepad++
I have created this 3 times now, just in case I had made a mistake. The results are the same. Perhaps I am consistently making the same mistake!
 

Attachments

  • HD fans only at Optimal.txt
    41.1 KB · Views: 372
Joined
Dec 2, 2015
Messages
730
I am not comfortable yet using the default editor so I download a fresh copy of your script each time to Notepad++
https://github.com/khorton/nas_fan_control/blob/master/PID_fan_control_borg.pl
Go to the Raw page and copy that: ctrl A ctrl C and paste into Notepad++
I have changed the default Edit EOL to Unix
I used the Search function to find the lines you suggested above

ctrl A ctrl C and right click into a Nano buffer I had already set up for the script

I have attached the latest copy of the edited script from Notepad++
I have created this 3 times now, just in case I had made a mistake. The results are the same. Perhaps I am consistently making the same mistake!
The errors you report shouldn't be happening, as they are in comments, and perl shouldn't be parsing comments.

Maybe some of the lines are getting split into two when you copy from NotePad++ and paste into nano. That could put part of a comment on a new line, without the "#" character before it to indicate that it is a comment, causing perl to try to parse it, and choke on the unexpected syntax.

Go through the file on the server, and ensure that none of the lines are split into two.

You may need to use nano with the "-w" option, to prevent it from wrapping long lines.
 
  • Like
Reactions: JRD

Stux

MVP
Joined
Jun 2, 2016
Messages
4,358
Almost always these sort of errors are caused by editing like this.

Either use an editor on this system (I use nano) or sftp the file after editing it locally. You need to ensure you use a line feed safe editor. I think notepad++ should be.
 
  • Like
Reactions: JRD

JRD

Dabbler
Joined
Apr 21, 2018
Messages
42
The errors you report shouldn't be happening, as they are in comments, and perl shouldn't be parsing comments.

Maybe some of the lines are getting split into two when you copy from NotePad++ and paste into nano. That could put part of a comment on a new line, without the "#" character before it to indicate that it is a comment, causing perl to try to parse it, and choke on the unexpected syntax.

Go through the file on the server, and ensure that none of the lines are split into two.

You may need to use nano with the "-w" option, to prevent it from wrapping long lines.

I think I finally got it working and it seems to be doing what it should
Code:
root@NAS:/mnt/Storage/Scripts # ./PID_fan_control.pl
2018-11-11 17:46:15: ada0 ada1 ada2 ada3 ada4 ada5 ada6 ada7 da0 da1
2018-11-11 17:46:15: ada0
2018-11-11 17:46:15: ada1
2018-11-11 17:46:15: ada2
2018-11-11 17:46:15: ada3
2018-11-11 17:46:15: ada4
2018-11-11 17:46:15: ada5
2018-11-11 17:46:15: ada6
2018-11-11 17:46:15: ada7
2018-11-11 17:46:15: da0
2018-11-11 17:46:15: da1
2018-11-11 17:46:15: fanmode: optimal = 2
2018-11-11 17:46:15: Setting fan mode to 2 (optimal)
2018-11-11 17:46:21: ada0 ada1 ada2 ada3 ada4 ada5 ada6 ada7 da0 da1
2018-11-11 17:46:21: ada0
2018-11-11 17:46:21: ada1
2018-11-11 17:46:21: ada2
2018-11-11 17:46:21: ada3
2018-11-11 17:46:21: ada4
2018-11-11 17:46:21: ada5
2018-11-11 17:46:21: ada6
2018-11-11 17:46:21: ada7
2018-11-11 17:46:21: da0
2018-11-11 17:46:21: da1
2018-11-11 17:46:22: temperature error = -7.875
2018-11-11 17:46:22: PID corrections are P = -63, I = 0 and D = 0
2018-11-11 17:46:22: PID control new duty cycle is 20%
2018-11-11 17:46:22: Setting Zone 1 duty cycle to 20%
2018-11-11 17:46:22: core_temps:
32.0
32.0
29.0
29.0
2018-11-11 17:46:22: core_temp = 32.0 C
2018-11-11 17:46:22: core_temp = 32.0 C
2018-11-11 17:46:22: core_temp = 29.0 C
2018-11-11 17:46:22: core_temp = 29.0 C
2018-11-11 17:46:22: CPU Temp: 32.0
2018-11-11 17:46:34: fan_speed = 800
2018-11-11 17:46:34: HD Fan speed: 800 RPM
2018-11-11 17:46:34: Verified fan levels, HD: 800. All good.
2018-11-11 17:47:35: fan_speed = 800
2018-11-11 17:47:35: HD Fan speed: 800 RPM
2018-11-11 17:47:35: Verified fan levels, HD: 800. All good.
2018-11-11 17:48:36: fan_speed = 800
2018-11-11 17:48:36: HD Fan speed: 800 RPM
2018-11-11 17:48:36: Verified fan levels, HD: 800. All good.
2018-11-11 17:49:21: ada0 ada1 ada2 ada3 ada4 ada5 ada6 ada7 da0 da1
2018-11-11 17:49:21: ada0
2018-11-11 17:49:21: ada1
2018-11-11 17:49:21: ada2
2018-11-11 17:49:21: ada3
2018-11-11 17:49:21: ada4
2018-11-11 17:49:21: ada5
2018-11-11 17:49:21: ada6
2018-11-11 17:49:21: ada7
2018-11-11 17:49:21: da0
2018-11-11 17:49:21: da1
2018-11-11 17:49:21: temperature error = -7.875
2018-11-11 17:49:21: PID corrections are P = -63, I = 0 and D = 0
2018-11-11 17:49:21: Setting Zone 1 duty cycle to 20%
2018-11-11 17:49:22: core_temps:
29.0
29.0
28.0
28.0
2018-11-11 17:49:22: core_temp = 29.0 C
2018-11-11 17:49:22: core_temp = 29.0 C
2018-11-11 17:49:22: core_temp = 28.0 C
2018-11-11 17:49:22: core_temp = 28.0 C
2018-11-11 17:49:22: CPU Temp: 29.0
2018-11-11 17:49:33: fan_speed = 800
2018-11-11 17:49:33: HD Fan speed: 800 RPM
2018-11-11 17:49:33: Verified fan levels, HD: 800. All good.

The fans are running nice and slow too
Code:
# ipmitool sdr | grep FAN
FAN1			 | 1000 RPM		  | ok
FAN2			 | 400 RPM		   | nc
FAN3			 | 400 RPM		   | nc
FAN4			 | 400 RPM		   | nc
FANA			 | 800 RPM		   | ok
root@NAS:/mnt/Storage/Scripts #


Presumably the next step is to schedule the script so I can stress the system: get the cpu to run hotter?
 

JRD

Dabbler
Joined
Apr 21, 2018
Messages
42
Almost always these sort of errors are caused by editing like this.

Either use an editor on this system (I use nano) or sftp the file after editing it locally. You need to ensure you use a line feed safe editor. I think notepad++ should be.

I eventually got a version of Notepad ++ with the correct plugin installed and connected to the server via SSH.
I saw the root directory, history and the PID_fan_control.pl log for the first time. I also saw entries I did not recognise.....should I worry? If I knew what I was doing I would delete them.

I was hoping to see and to access the directory I see via SSH: cd /mnt/Storage/Scripts PID_fan_control.pl is saved within Scripts.
I created this as a dataset from the GUI.

So.....back to the script on the server. As the default editor is ee I gave up and downloaded another copy of the script and edited in Nano: it works!
 
Joined
Dec 2, 2015
Messages
730
I think I finally got it working and it seems to be doing what it should
Code:
root@NAS:/mnt/Storage/Scripts # ./PID_fan_control.pl
2018-11-11 17:46:15: ada0 ada1 ada2 ada3 ada4 ada5 ada6 ada7 da0 da1
2018-11-11 17:46:15: ada0
2018-11-11 17:46:15: ada1
2018-11-11 17:46:15: ada2
2018-11-11 17:46:15: ada3
2018-11-11 17:46:15: ada4
2018-11-11 17:46:15: ada5
2018-11-11 17:46:15: ada6
2018-11-11 17:46:15: ada7
2018-11-11 17:46:15: da0
2018-11-11 17:46:15: da1
2018-11-11 17:46:15: fanmode: optimal = 2
2018-11-11 17:46:15: Setting fan mode to 2 (optimal)
2018-11-11 17:46:21: ada0 ada1 ada2 ada3 ada4 ada5 ada6 ada7 da0 da1
2018-11-11 17:46:21: ada0
2018-11-11 17:46:21: ada1
2018-11-11 17:46:21: ada2
2018-11-11 17:46:21: ada3
2018-11-11 17:46:21: ada4
2018-11-11 17:46:21: ada5
2018-11-11 17:46:21: ada6
2018-11-11 17:46:21: ada7
2018-11-11 17:46:21: da0
2018-11-11 17:46:21: da1
2018-11-11 17:46:22: temperature error = -7.875
2018-11-11 17:46:22: PID corrections are P = -63, I = 0 and D = 0
2018-11-11 17:46:22: PID control new duty cycle is 20%
2018-11-11 17:46:22: Setting Zone 1 duty cycle to 20%
2018-11-11 17:46:22: core_temps:
32.0
32.0
29.0
29.0
2018-11-11 17:46:22: core_temp = 32.0 C
2018-11-11 17:46:22: core_temp = 32.0 C
2018-11-11 17:46:22: core_temp = 29.0 C
2018-11-11 17:46:22: core_temp = 29.0 C
2018-11-11 17:46:22: CPU Temp: 32.0
2018-11-11 17:46:34: fan_speed = 800
2018-11-11 17:46:34: HD Fan speed: 800 RPM
2018-11-11 17:46:34: Verified fan levels, HD: 800. All good.
2018-11-11 17:47:35: fan_speed = 800
2018-11-11 17:47:35: HD Fan speed: 800 RPM
2018-11-11 17:47:35: Verified fan levels, HD: 800. All good.
2018-11-11 17:48:36: fan_speed = 800
2018-11-11 17:48:36: HD Fan speed: 800 RPM
2018-11-11 17:48:36: Verified fan levels, HD: 800. All good.
2018-11-11 17:49:21: ada0 ada1 ada2 ada3 ada4 ada5 ada6 ada7 da0 da1
2018-11-11 17:49:21: ada0
2018-11-11 17:49:21: ada1
2018-11-11 17:49:21: ada2
2018-11-11 17:49:21: ada3
2018-11-11 17:49:21: ada4
2018-11-11 17:49:21: ada5
2018-11-11 17:49:21: ada6
2018-11-11 17:49:21: ada7
2018-11-11 17:49:21: da0
2018-11-11 17:49:21: da1
2018-11-11 17:49:21: temperature error = -7.875
2018-11-11 17:49:21: PID corrections are P = -63, I = 0 and D = 0
2018-11-11 17:49:21: Setting Zone 1 duty cycle to 20%
2018-11-11 17:49:22: core_temps:
29.0
29.0
28.0
28.0
2018-11-11 17:49:22: core_temp = 29.0 C
2018-11-11 17:49:22: core_temp = 29.0 C
2018-11-11 17:49:22: core_temp = 28.0 C
2018-11-11 17:49:22: core_temp = 28.0 C
2018-11-11 17:49:22: CPU Temp: 29.0
2018-11-11 17:49:33: fan_speed = 800
2018-11-11 17:49:33: HD Fan speed: 800 RPM
2018-11-11 17:49:33: Verified fan levels, HD: 800. All good.

The fans are running nice and slow too
Code:
# ipmitool sdr | grep FAN
FAN1			 | 1000 RPM		  | ok
FAN2			 | 400 RPM		   | nc
FAN3			 | 400 RPM		   | nc
FAN4			 | 400 RPM		   | nc
FANA			 | 800 RPM		   | ok
root@NAS:/mnt/Storage/Scripts #


Presumably the next step is to schedule the script so I can stress the system: get the cpu to run hotter?
Great! Congrats.

Now you need to confirm that the BMC is controlling the CPU fan, and that it is able to keep CPU temperatures in an acceptable range under heavy load.

You also need to test hard drive cooling under load. There is a high likelihood that you'll need to make adjustments to the PID control gains, stored in variables $Kp and $Kd to get the control loop to be stable.

In the interim, while testing, you can run the script via tmux. That way it will keep running even if you close the ssh session, and you can come back later and kill it and restart it if you need to change the PID gains. Once you have it working the way you want, you can set it as an Init Script, in the Tasks interface on FreeNAS.

I'm testing a newer version of this script that allows the gains to be changed on the fly, as they are stored in a configuration file with the newer script version, and the script checks the config file on every pass. This newer version also can be set up to look at the average temperature of the warmest X disks, rather than averaging the temperatures of all disks. This provides better performance in cases where some disks normally run warmer than the others. I'll update this thread with the newer version once I've finished testing it.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,358
Great! Congrats.

Now you need to confirm that the BMC is controlling the CPU fan, and that it is able to keep CPU temperatures in an acceptable range under heavy load.

You also need to test hard drive cooling under load. There is a high likelihood that you'll need to make adjustments to the PID control gains, stored in variables $Kp and $Kd to get the control loop to be stable.

In the interim, while testing, you can run the script via tmux. That way it will keep running even if you close the ssh session, and you can come back later and kill it and restart it if you need to change the PID gains. Once you have it working the way you want, you can set it as an Init Script, in the Tasks interface on FreeNAS.

I'm testing a newer version of this script that allows the gains to be changed on the fly, as they are stored in a configuration file with the newer script version, and the script checks the config file on every pass. This newer version also can be set up to look at the average temperature of the warmest X disks, rather than averaging the temperatures of all disks. This provides better performance in cases where some disks normally run warmer than the others. I'll update this thread with the newer version once I've finished testing it.

Sounds neat :)
 

appoli

Dabbler
Joined
Mar 22, 2017
Messages
44
Hi all,

I have been having an issue and was wondering if you guys would be able to help... I know it's effectively unpaid work so any/all help is greatly appreciated :)

I had been using Glorious1's script for fan control on my FreeNAS box quite happily, but after some time a few factors put me in a position where I had to leave FreeBSD and thus leave FreeNAS.

I'm currently running Proxmox, which runs on Debian with some custom Ubuntu sourced coding for the zfs stuff. I had originally tried re-tooling Glorious1's script for Debian/Ubuntu, but my coding skills are extremely rusty & the command in FreeBSD to get the list of available drives doesn't exist in Debian/Ubuntu. I had been trying to get an alternative method to work, but I found your perl script which was modified with a pretty simply way of getting the dev IDs of the hard disks: you enter them in the file... (I was considering doing this for Glorious1's code & if I can't get this working I might have to try that)

https://jp-powers.com/2017/07/08/fa...permicro-motherboards-on-ubuntu-server-16-04/
(the file you download from the site doesn't have a semicolon after the log level which I corrected so that's not it, FYI)

my case fans aren't all the same type & I didn't want to use a bunch of splitters so I have my fan zones flipped around (FANA = cpu, FAN1-4 = case/hdd) & have made the appropriate changes in the script to reflect that.
The fans are responding to HDD temps properly, however the CPU fan is not being controlled at all (I have the script set to "1" so that it controls the CPU and HDD temps). I've been trying to debug it and figure out what's wrong, but I can't seem to figure it out.

Which leads me here... I'm including a screen shot of the log created by the script (I have it set to level 4 logging) & a screen grab of the service status.
The script is clearly pulling the temp of the processor correctly, both the individual cores & as a single 'max temp core' value, so I don't think that is the problem.

Again, any help would be greatly appreciated. I would really like to get this sorted out so I can throttle my cpu above 20%....
(I noticed that there have been updates to the script, dunno exactly what they have been, but the one on the site seems to be from about a year ago)
Thank you very much

edit:

so I've been going through the script & I have made a couple changes that I hoped would work, but to no avail:

line 283: change "while()" to "while($cpu_temp_control = 1)"

line 293-ish: added "set_fan_zone_level( $cpu_fan_zone, $cpu_fan_level );" before "$last_fan_level_change_time = time;"
(since that "if" command basically just re-set the fan change time and didn't actually change the fan speed as far as I could tell)

The issues is the CPU temp is being checked when the script is started and never again after that. I'm not sure where the loop goes bad, but at some point the script just sticks to the HDs
 

Attachments

  • Screen Shot 2018-11-11 at 11.56.54 PM.png
    Screen Shot 2018-11-11 at 11.56.54 PM.png
    673.4 KB · Views: 381
  • Screen Shot 2018-11-11 at 11.54.37 PM.png
    Screen Shot 2018-11-11 at 11.54.37 PM.png
    228.4 KB · Views: 356
Last edited:
Joined
Dec 2, 2015
Messages
730
Hi all,

I have been having an issue and was wondering if you guys would be able to help... I know it's effectively unpaid work so any/all help is greatly appreciated :)

I had been using Glorious1's script for fan control on my FreeNAS box quite happily, but after some time a few factors put me in a position where I had to leave FreeBSD and thus leave FreeNAS.

I'm currently running Proxmox, which runs on Debian with some custom Ubuntu sourced coding for the zfs stuff. I had originally tried re-tooling Glorious1's script for Debian/Ubuntu, but my coding skills are extremely rusty & the command in FreeBSD to get the list of available drives doesn't exist in Debian/Ubuntu. I had been trying to get an alternative method to work, but I found your perl script which was modified with a pretty simply way of getting the dev IDs of the hard disks: you enter them in the file... (I was considering doing this for Glorious1's code & if I can't get this working I might have to try that)

https://jp-powers.com/2017/07/08/fa...permicro-motherboards-on-ubuntu-server-16-04/
(the file you download from the site doesn't have a semicolon after the log level which I corrected so that's not it, FYI)

my case fans aren't all the same type & I didn't want to use a bunch of splitters so I have my fan zones flipped around (FANA = cpu, FAN1-4 = case/hdd) & have made the appropriate changes in the script to reflect that.
The fans are responding to HDD temps properly, however the CPU fan is not being controlled at all (I have the script set to "1" so that it controls the CPU and HDD temps). I've been trying to debug it and figure out what's wrong, but I can't seem to figure it out.

Which leads me here... I'm including a screen shot of the log created by the script (I have it set to level 4 logging) & a screen grab of the service status.
The script is clearly pulling the temp of the processor correctly, both the individual cores & as a single 'max temp core' value, so I don't think that is the problem.

Again, any help would be greatly appreciated. I would really like to get this sorted out so I can throttle my cpu above 20%....
(I noticed that there have been updates to the script, dunno exactly what they have been, but the one on the site seems to be from about a year ago)
Thank you very much

edit:

so I've been going through the script & I have made a couple changes that I hoped would work, but to no avail:

line 283: change "while()" to "while($cpu_temp_control = 1)"

line 293-ish: added "set_fan_zone_level( $cpu_fan_zone, $cpu_fan_level );" before "$last_fan_level_change_time = time;"
(since that "if" command basically just re-set the fan change time and didn't actually change the fan speed as far as I could tell)

The issues is the CPU temp is being checked when the script is started and never again after that. I'm not sure where the loop goes bad, but at some point the script just sticks to the HDs
@JRD, a bit earlier in this thread, seemed to find that his X11 board behaved a bit differently than the X10 boards that this script was written for. He was unable to get the script to control his CPU fan. He had some luck adjusting the script to a different fan mode, which allowed the BMC to control the CPU fan, and the script control the HD fans. Note that this would require that you have the CPU fan connected to the fan headers that are intended by SuperMicro for the CPU fan.

If that doesn't solve the problem, we'd need a lot more log data to better understand what is happened. We'd need to get a big chunk of log posted inside CODE tags.
 

appoli

Dabbler
Joined
Mar 22, 2017
Messages
44
@JRD, a bit earlier in this thread, seemed to find that his X11 board behaved a bit differently than the X10 boards that this script was written for. He was unable to get the script to control his CPU fan. He had some luck adjusting the script to a different fan mode, which allowed the BMC to control the CPU fan, and the script control the HD fans. Note that this would require that you have the CPU fan connected to the fan headers that are intended by SuperMicro for the CPU fan.

If that doesn't solve the problem, we'd need a lot more log data to better understand what is happened. We'd need to get a big chunk of log posted inside CODE tags.

Thank you so much for the response - really really appreciate the help!

yea for some reason the script adjusted the CPU fan speed at the beginning & if the HD duty cycle went above the dictated amount, but wouldn't adjust the fan speed at any other time...

I would rather use this script since it runs in the background as a service, put I ended up just going back to the script from glorious1 (I liked his more anyhow since the cpu fan adjusts in increments rather than having 3 set speeds). I edited the location of smartctl/ipmitool & instead of the camcontrol function I have the script reading from a text file (taking a page from the static dev names in the script I linked). I had to edit out the BMC perif fan reset b/c 1 of my fans has pretty different rpms (all are Noctua, but since I have space only for 3 fans the in/out won't be even so I switched one of them with a high pressure fan).

I would like it to run as a script though, rather than a bash shell command so I'll probably work on that. I guess just put everything into a perl file and go? I dunno, but I'm sure I'll figure it out

thanks so much!
 
Top