KsenijaS / krakenx

Python script to control NZXT cooler Kraken X52/X62 in Linux
GNU General Public License v2.0
181 stars 20 forks source link

Feature: Automatic Fan and Pump speed control using lm_sensors #4

Closed DrNotThatEvil closed 6 years ago

DrNotThatEvil commented 6 years ago

I have been using the software for a few days now. Sadly I miss automatic speed control of the pump and fans so i started work to incorporate it!

The above pull request uses the sensors executable to extract the current CPU temprature. Based on it it calculates appropriate pump and fan speeds. Slowly increasing or decreasing the speed of the Fans and Pump to the max 100 percent or the minimal of 60 for the pump. I wanted to be sure that the fans also had a minimum speed which i set to 40 percent.

Feedback / Comments are appreciated!

P.S. The calculation for getting the fanspeed might be to low or overkill more experimentation is needed before i would call it safe. I have tested my cpu with mprime for 30 minutes and my CPU did not go over 47 degrees C but your mileage may very.

Andeskjerf commented 6 years ago

I tried this out and it didn't work for me. It gave me a KeyError with CPUTIN. I fixed it by changing the return function in _get_cpu_temp from 'CPUTIN' to 'Package id 0'. Seems like the name for the CPU in 'sensors' can differ between CPU/mobos?

The fan curve seems a little aggressive to me as well, it can get awfully loud compared to CAM's fan curve. Other than that, nice work :) Probably a good idea to check if the value temperature returns is valid tho.

DrNotThatEvil commented 6 years ago

Thanks for the input. I wasn't aware of that different packages could have different names. About the fan curve I'm not a expert on what's nesseary for keeping your CPU safe so I might have put it on overkill cause i would feel really bad if my version made a CPU overheat or something.

I'm gonna edit my version with your feedback. Thanks for the input!

jneumaier commented 6 years ago

@DrNotThatEvil Are you still working on this? Would you like update your branch and merge the conflicts? We would also have consider Windows support. We can just add a note that only Linux is supported and check the OS in the source like in https://github.com/KsenijaS/krakenx/commit/ecfd4c4fb705c3b073e197612a033abf9ecd5eab. Maybe automatic control by liquid temperature would be enough though. Please have a look at #11.

DrNotThatEvil commented 6 years ago

@jneumaier Sorry for the late response, Thanks for the feedback. I don't have at this time since school just started but as soon as I have time I will include OS checking and fix the issues. The liquid temprature might be a good idea to make it more OS independent but will take a bit more time.

great feedback sorry for the late response

jneumaier commented 6 years ago

@DrNotThatEvil jonasmalacofilho already implemented the fan and pump profiles based on liquid temperature in his upcoming project https://github.com/jonasmalacofilho/liquidctl. This is basically what CAM also does and is controlled by firmware commands setting the profiles as he futher investigated. He is also willing to contribute a version for this project. So if you like the approach, you might just drop your pull request and help him (e.g. feedback, testing) or contribute something else :-)

jneumaier commented 6 years ago

I will close the pull request because I think we got this feature covered with #24 using the liquid temperature.

DrNotThatEvil commented 6 years ago

Sorry for the inactivity. Good to see the feature has been implemented! I will close my fork of the project due to the implemented pull request.