audiohacked / OpenCorsairLink

Linux and Mac OS support for the CorsairLink Devices
GNU General Public License v2.0
705 stars 125 forks source link

Bash script to control OpenCorsairLink via CPU temperature #236

Closed klandrith closed 4 years ago

klandrith commented 4 years ago

I have a working bash script that can control OpenCorsairLink via CPU temperature, and I may add load % as well. Is there any danger to calling OpenCorsairLink every 2 seconds to update it with new settings (pump mode and fan PWM or just fan PWM)?

Thank you for developing the app!

[EDIT] I have the script setup to use linear interpolation with a hysteresis value of 5 degrees where it won't poll the OpeCorsairLink app unless the absolute value of degree change exceeds the hysteresis value. It also won't poll it if the temp stays below or above the min and max set points. Currently I have it setup using 4 set points, but I may expand that to 5 or 6. Pump speed is also set to stay constant (I always have mine set to extreme - not sure if that's detrimental to the pump or not...AIO responds too slow to temp changes and takes too long to cool down unless its on extreme I've found and can cause temp spikes - I have an overclocked 9900k so that's a concern). Update interval for logic loop is currently set at 1 second.

As I don't know the intricacies of these AIO's and there software and likewise the actual OpenCorsairLink software (I have the source downloaded to review - I just haven't had the time) I'm hesitant to actually use the script to control my AIO as I don't want to cause the internal software in the AIO to freeze up, or OpenCorsairLink, from too much polling and not work correctly until a reboot or powerdown event. During normal use this wouldn't be a problem since I have a conky setup and keep a close eye on my system stats, but I run distributed computing at nighttime and I don't want it to fail during the course of that CPU load and cause my CPU to bounce off of the thermal limits or cause a shutdown. Right now I just have had it running with echo statements to the terminal so I can keep an eye on what its doing under various conditions and how often it's trying to actually update the AIO settings.

Thoughts? Thanks again!

audiohacked commented 4 years ago

@klandrith I don't think anything can go wrong, but polling too fast might break OpenCorsairLink, the hardware might need a USB reset if anything breaks with the hardware.