WIP Fan Control application

Discussion in 'Sager and Clevo' started by djsubtronic, Mar 29, 2021.

  1. djsubtronic

    djsubtronic Notebook Evangelist

    Reputations:
    107
    Messages:
    367
    Likes Received:
    55
    Trophy Points:
    41
    With Obsidian Fan Control now seemingly no longer being maintained, I ended up having to write my own application inspired by Obsidian's.

    upload_2021-3-29_18-21-16.png

    The icon is borrowed from the Obsidian app.

    Currently the app is very basic. It has 10 preset temperature units. Under 40 C, the fans will automatically be set to 0. Anything 40 through to 85 can be configured at 5 C intervals. It only uses two fans (1 for CPU and 2 for GPU) but I'm sure this can be easily modified.

    Important notes
    • 2 fans supported at the moment
    • Uses ClevoEcInfo.dll for fan control which relies on NTPort 2.8 library (included in release download - the installer might give an error but it should still work. Thanks @philstopford.)
    • Uses OpenHardwareMonitor library for GPU temperature
    • Uses WMI for CPU temperature
    • No average temperatures, the fan speed is simply set immediately depending on CPU or GPU temperature and the configured temperature for that range
    • The "Clevo Default" profile is just a profile I have created within the code that mimics Clevo's default fan curve for my model (exception being that <40 C will still turn the fans off). It is NOT handing control back to the EC, and the fans are still always controlled by the application until you exit.
    • I'm not sure the code to hand over fan control back to the EC upon exit, so as a safety precaution if you exit the app it will automatically set the fans to 100%. You can use Fn+1 to go back to EC controlled fan after the app has closed.
    • If GPU exceed 80 C, both CPU and GPU fans will automatically be set to 100%
    • Needs to be run as Admin for CPU temperature detection to work
    • NTPort library might give you an error message during the installation, but this can be ignored as the driver will still be installed
    Disclaimer
    Please remember that this is very much a work in progress which I just quickly put together in one day for my own use and sharing here so other developers can work with it or users can play around with it. Be careful when using it as a permament fan control solution, I am not responsible for any damage caused by any malfunctioning of the app.

    Download
    The code was written and built in VS2019 and can be found here:
    https://github.com/djsubtronic/ClevoFanControl
     
    Last edited: Apr 11, 2021 at 6:37 AM
    TheLuddite, joluke, t456 and 5 others like this.
  2. BrightSmith

    BrightSmith Notebook Evangelist

    Reputations:
    135
    Messages:
    573
    Likes Received:
    336
    Trophy Points:
    76
    Following this effort!
     
    djsubtronic likes this.
  3. skandal

    skandal Notebook Consultant

    Reputations:
    50
    Messages:
    292
    Likes Received:
    114
    Trophy Points:
    56
    where did you get the ClevoEcInfo.dll?
     
  4. djsubtronic

    djsubtronic Notebook Evangelist

    Reputations:
    107
    Messages:
    367
    Likes Received:
    55
    Trophy Points:
    41
    From RLECViewer, another manual fan control app available.
     
    skandal likes this.
  5. philstopford

    philstopford Notebook Consultant

    Reputations:
    17
    Messages:
    189
    Likes Received:
    69
    Trophy Points:
    41
    I was hoping to make this work against .NET 5.0 (I don't have the Framework SDKs installed). It builds OK, but the loading of the library fails for some reason. I was wondering if there is a pre-built binary that I can check for operation.
     
  6. djsubtronic

    djsubtronic Notebook Evangelist

    Reputations:
    107
    Messages:
    367
    Likes Received:
    55
    Trophy Points:
    41
    Try this
    https://github.com/djsubtronic/ClevoFanControl/releases/tag/v0.1-wip

    Sorry, never really used Github before so let me know if something is wrong. You need to put all the files on that link into the same folder.
     
  7. philstopford

    philstopford Notebook Consultant

    Reputations:
    17
    Messages:
    189
    Likes Received:
    69
    Trophy Points:
    41
    Thanks. So this gives me the same error :

    Code:
    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.
    ************** Exception Text **************
    System.Exception: Can't load ClevoEcInfo.dll
       at ClevoFanControl.ClevoEcInfo.Init()
       at ClevoFanControl.frmMain.Form1_Load(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    ClevoFanControl
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///E:/ClevoFanControl.exe
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4084.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Management
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4084.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.4084.0 built by: NET48REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    OpenHardwareMonitorLib
        Assembly Version: 0.7.1.0
        Win32 Version: 0.7.1.0
        CodeBase: file:///E:/OpenHardwareMonitorLib.DLL
    ----------------------------------------
    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.
    For example:
    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>
    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
    
    
     
  8. djsubtronic

    djsubtronic Notebook Evangelist

    Reputations:
    107
    Messages:
    367
    Likes Received:
    55
    Trophy Points:
    41
    I had that error loading the DLL when running under the AnyCPU or x64 platforms but switching the release to x86 fixed it. Not sure why are you getting the error on the x86 binary, as that is literally the same one I have running at the moment.

    I changed some build settings and clean/rebuilt, try this:
    https://github.com/djsubtronic/ClevoFanControl/releases/tag/WIP
     
    dmanti likes this.
  9. philstopford

    philstopford Notebook Consultant

    Reputations:
    17
    Messages:
    189
    Likes Received:
    69
    Trophy Points:
    41
    That didn't seem to help. Poking around some more.


    My fork is here : https://github.com/philstopford/ClevoFanControl
     
    Last edited: Mar 29, 2021
    Vasudev and dmanti like this.
  10. anytimer

    anytimer Notebook Virtuoso

    Reputations:
    208
    Messages:
    2,060
    Likes Received:
    195
    Trophy Points:
    81
    Do we need to uninstall Obsidian Fan Control?
     
Loading...

Share This Page