Jump to content
Slice

Dell monitoring by SMM and fan control

14 posts in this topic

Recommended Posts

Dell laptops and desktop can be monitored by SMM methods as mentioned is the old topic

 

I made a plugin SMIMonitor for FakeSMC in 2014 but it was 32bits and was not working. Only now I made it to be 64bits (as darkvoid did with kozleks branch) and got positive results

Снимок экрана 2019-08-08 в 5.49.04.png  

and after heating Снимок экрана 2019-08-05 в 18.44.29.png

So I have monitoring of 4 additional temperature sensors (CPU Proximity, GPU, DIMM, and Motherboard) and a CPU fan which initially stay at 0 rpm and start rotating after heating with 2882rpm.

 

Moreover I implemented a function for brave people to control fans

sudo SMC_util3 -kF0As -w2

The last digit 2 is a FAN speed you want to set

0 = Off

1 = Low

2 = High

If you have more then 1 fan then you can manage other one by choosing next key F1As, F2As etc.

 

Precaution! Writing the fan speed is dangerous and may cause a computer damage. Do this at your own risk!

Note. SMIMonitor.kext will work only with FakeSMC v3 provided with HWSensors3 in my signature.

Official release at sf.net contains SMIMonitor without write possibility.

 

Please test and report your successes and fails.

 

 

SMIMonitor.kext-110.zip

SMC_util3.zip

smcwrite.zip

Share this post


Link to post
Share on other sites
Advertisement

Big news!

I added an ability to manually set Fan speed.

See how it works:

1. The computer is cool and the fan is stopped

Снимок экрана 2019-08-12 в 18.52.21.png

2. I set Manual Drive

sudo smcwrite F0Md 0100

and then set the fan 0 to low speed

sudo smcwrite F0As 0100

Снимок экрана 2019-08-12 в 19.01.36.png

3. Then I forced the fan to HIGH speed

sudo smcwrite F0As 0200

Снимок экрана 2019-08-12 в 19.01.57.png

OK, I need no more the high speed so I stopped the fan

sudo smcwrite F0As 0000

Or I want to give the computer automatic control on fans

sudo smcwrite F0Md 0000

 

@vector sigma

Can we add this function to HWMonitorSMC2? I see there is a template for FAN control.

What I need is to set in preferences

Temp01 - a temperature to switch fan from OFF to LOW. (default 50)

Temp12 - from LOW to HIGH (default 70)

Temp21 - from HIGH to LOW (default 60)

Temp10 - from LOW to OFF (default 40)

and a switch manual/auto.

When the Monitor checks CPU Temp it will write SMC keys as shown above.

Share this post


Link to post
Share on other sites
Posted (edited)
4 hours ago, Slice said:

I added an ability to manually set Fan speed.

Good!

 

4 hours ago, Slice said:

Can we add this function to HWMonitorSMC2? I see there is a template for FAN control.

Fan control is already there, only that is probably missing the "F0Tg" key(s) to know where the Fan should target the speed?

(HWMonitorSMC2 already watching for FS! and/or F0Md)

 

4 hours ago, Slice said:

What I need is to set in preferences

To store somethings in the Preferences there's a big problem, we cannot use sudo without the user to type the password, in this case when the HWMonitorSMC2 will be started... will ask for a password... for each Fans, very unpleasant. More will be for one user only as the preferences are for the current account

 

Or, write an helper tool (a brain trip.... but I can), and do what we want as root user (helper tool = a program blessed by the user admin, always running. Near to be a daemon). To do that a certificate from the key-chain must be created with private and public keys. This will break the ability for anyone to compile the project since only you (or me or both) will have the certificate to sign the binary. (A certificate is a identity of the developer, so a malicius person can make trojans and viruses using your/our identity... so why this certificate must never be shared) 

 

Or, use the NVRAM as I already done in the development branch:

 

 /*
   NVRAM Fan control, 44 bytes in total
   First 2 bytes to store 16 bits for 16 fans enabled or disabled (FS! keeping this two bytes, be aware with the endianess, or use the new F%dTg format and use the bit index),
   then 16 pair of bytes, to store target fan value in rpm.
   From index 16, other 16 pair of bytes, to store min fan value in rpm.
   From index 30, other 16 pair of bytes, to store max fan value in rpm.
   
   NVRAM is persistent.. and it is a good way to remember user settings for all the users.
   */
  UInt8 nvFanControls[44] = {
    0x00, 0x00, /* 16 bits, bit at index x enable fan at index x, if set. (data for FS! key, or any way the bit index says if fan at index x is enabled or not so you can translate the bit index to the new key F%dMd)*/
    0x00, 0x00, /* UInt16 value, fan at index 0 target speed (F0Ac) */
    0x00, 0x00, /* UInt16 value, fan at index 1 target speed (F1Ac) */
    0x00, 0x00, /* UInt16 value, fan at index 2 target speed (F2Ac) */
    0x00, 0x00, /* UInt16 value, fan at index 3 target speed (F3Ac) */
    0x00, 0x00, /* UInt16 value, fan at index 4 target speed (F4Ac) */
    0x00, 0x00, /* UInt16 value, fan at index 5 target speed (F5Ac) */
    0x00, 0x00, /* UInt16 value, fan at index 6 target speed (F6Ac) */
    0x00, 0x00, /* UInt16 value, fan at index 0 min speed (F0Mn) */
    0x00, 0x00, /* UInt16 value, fan at index 1 min speed (F1Mn) */
    0x00, 0x00, /* UInt16 value, fan at index 2 min speed (F2Mn) */
    0x00, 0x00, /* UInt16 value, fan at index 3 min speed (F3Mn) */
    0x00, 0x00, /* UInt16 value, fan at index 4 min speed (F4Mn) */
    0x00, 0x00, /* UInt16 value, fan at index 5 min speed (F5Mn) */
    0x00, 0x00, /* UInt16 value, fan at index 6 min speed (F6Mn) */
    0x00, 0x00, /* UInt16 value, fan at index 0 max speed (F0Mx) */
    0x00, 0x00, /* UInt16 value, fan at index 1 max speed (F1Mx) */
    0x00, 0x00, /* UInt16 value, fan at index 2 max speed (F2Mx) */
    0x00, 0x00, /* UInt16 value, fan at index 3 max speed (F3Mx) */
    0x00, 0x00, /* UInt16 value, fan at index 4 max speed (F4Mx) */
    0x00, 0x00, /* UInt16 value, fan at index 5 max speed (F5Mx) */
    0x00, 0x00  /* UInt16 value, fan at index 6 max speed (F6Mx) */
  }

and be Mac like.

4 hours ago, Slice said:

Temp01 - a temperature to switch fan from OFF to LOW. (default 50)

Temp12 - from LOW to HIGH (default 70)

Temp21 - from HIGH to LOW (default 60)

Temp10 - from LOW to OFF (default 40)

and a switch manual/auto.

Ok for the CPU temperature to set a limit, I can make it conditional if the user set a temperature... so just disable the bit at index x in FS! key (or write F0Tg = 0000 if that keys are used) is what the driver should understand but again HWMonitorSMC2 should do require for a password at the time a need be. Instead shouldn't be the driver itself to understand the temperature limit, by reading this limit some where (e.g. the NVRAM?)?)

Edited by vector sigma

Share this post


Link to post
Share on other sites

Let it be NVRAM if you want. Can the Monitor ask for a password once saving preferences?

My Dell plugin can't use F0Mn, F0Mx, F0Tg because it is not deal with real speed. It deals with status={OFF, LOW, HIGH} which we set.

And yes it uses FS!. Bit N set mean Fan N will be controlled manually. Zero means automatic.

Anyway switch auto/manual require password?

Share this post


Link to post
Share on other sites
6 hours ago, Slice said:

Anyway switch auto/manual require password?

Preferences can be saved, but then you have to write FS! to the SMC.

6 hours ago, Slice said:

Can the Monitor ask for a password once saving preferences?

Sure, but this is ok until the next reboot I guess, is the driver making this setting permanent?

 

Next week I'll try to made an helper tool (the only way) and be free in doing what ever we need.

Share this post


Link to post
Share on other sites
46 minutes ago, vector sigma said:

, is the driver making this setting permanent?

No. At start the driver force automatic control. I think it is safe.

Other preferences may remain as is.

Share this post


Link to post
Share on other sites
54 minutes ago, vector sigma said:

Preferences can be saved, but then you have to write FS! to the SMC.

 

Already done. The FS! key is RW.

And keys F0Mn, F0Mx are RO.

Share this post


Link to post
Share on other sites

Strange I found HighSierra tends to set F0Mx as UINT16 to be 26000. None of my kexts do this so it is from OS by own.

I have to rewrite plugins to use F0Mm instead of F0Mx to not interfere with OS.

Share this post


Link to post
Share on other sites
6 hours ago, Slice said:

Strange I found HighSierra tends to set F0Mx as UINT16 to be 26000. None of my kexts do this so it is from OS by own.

I have to rewrite plugins to use F0Mm instead of F0Mx to not interfere with OS.

The development branch set both keys for nuvoton/windbond chips and keep values stored in nvram. Was your own test?

F0Mx and F0Mn are max/min rpm, so why in my opinion you have to write F0Tg (target) and let the others to be read-only. 

Share this post


Link to post
Share on other sites
Posted (edited)
On 8/13/2019 at 6:03 AM, Slice said:

My Dell plugin can't use F0Mn, F0Mx, F0Tg because it is not deal with real speed. It deals with status={OFF, LOW, HIGH} which we set.

Some how this should be 0% = OFF, 30% = LOW (or something similar), 100% = HIGH, as the PWM.

In this project the way to monitor a lot of laptops through SMI.

 

Edited by vector sigma

Share this post


Link to post
Share on other sites
59 minutes ago, vector sigma said:

Some how this should be 0% = OFF, 30% = LOW (or something similar), 100% = HIGH, as the PWM.

In this project the way to monitor a lot of laptops through SMI.

 

It is not a driver, it is an application to drive FANs but I see no list of laptops where it is possible.

Share this post


Link to post
Share on other sites
1 hour ago, vector sigma said:

The development branch set both keys for nuvoton/windbond chips and keep values stored in nvram. Was your own test?

F0Mx and F0Mn are max/min rpm, so why in my opinion you have to write F0Tg (target) and let the others to be read-only. 

See the list

  F0Ac  [fpe2]  0.00  (bytes 00 00)
  F0ID  [{fds]  (bytes 00 01 00 00 43 50 55 20 46 61 6e 00 00 00 00 00)
  F0Mn  [fpe2]  2500.00  (bytes 27 10)
  F0Mm  [fpe2]  4900.00  (bytes 4c 90)
  F0As  [ui8 ]  0  (bytes 00)
  F0Md  [ui8 ]  0  (bytes 00)
  FS!   [ui16]  0  (bytes 00 00)
  TC0P  [sp78]  56.00  (bytes 38 00)
  TA0P  [sp78]  45.00  (bytes 2d 00)
  Tm0P  [sp78]  40.00  (bytes 28 00)
  TG0P  [sp78]  44.00  (bytes 2c 00)
  B0AV  [ui16]  59183  (bytes e7 2f)
  B0AC  [ui16]  256  (bytes 01 00)
  B0St  [ui16]  41024  (bytes a0 40)
  B0RM  [ui16]  12305  (bytes 30 11)
  BATP  [flag]  TRUE  (bytes 01)
  BNum  [ui8 ]  1  (bytes 01)
  BBIN  [ui8 ]  1  (bytes 01)
  CHLC  [ui8 ]  2  (bytes 02)
  AC-N  [ui8 ]  1  (bytes 01)
  AC-W  [ui8 ]  1  (bytes 01)
  ACIC  [ui16]  8192  (bytes 20 00)
  MSLD  [ui8 ]  0  (bytes 00)
  F0Mx  [ui16]  26000  (bytes 65 90)
  HI0N  [ui8 ]  18  (bytes 12)

Some SMC keys set by my kexts, by plugins of FakeSMC.

But other SMC keys are not mine:

F0Mx, HI0N are not registered by any of my kexts.

Share this post


Link to post
Share on other sites
17 hours ago, Slice said:

It is not a driver, it is an application to drive FANs but I see no list of laptops where it is possible.

it has a kernel module. Here the list: https://github.com/hirschmann/nbfc/tree/master/Configs. Not sure how to read them, but looks like there are registers to work on, some Dell are there. 

 

18 hours ago, Slice said:

F0Mx, HI0N are not registered by any of my kexts.

I have no idea, but may be the DSDT induce a driver to publish these keys?

Share this post


Link to post
Share on other sites

DSDT has nothing to do with SMC. We just have to take into account that key F0Mx can’t be used as maximum speed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By DerNuntius
      Hi,
       
      Finally I finished the installation of 10.14.6 on my Dell E5440. Everything works just fine, but HDMI will not work. Every time I plug it in, it causes a grey screen on my laptop monitor. Also on boot up. I attached my EFI Folder, maybe someone can help me. I searched a bit and read something about Azul Framebuffer Kext.
       
      Thank you for helping.
      Greedings,
      Hugo
       
       
      CLOVER.zip
    • By spec3
      hi,
       
      Is someone using ultrawide monitor 75hz whit hackintosh?
       
      I would like to buy LG 34UC99 (resolution 3440x1440 and freq: 75hz)
       
      will it work for you?
       
       
    • By spec3
      ciao, 
       
      ho un problema con un monitor Dell p2715q 4k, funziona bene a prima vista, ma quando lavoro su programmi piu' pesanti, ho qualche problemino , del tipo che su certe azioni risulta rallentato a livello grafico. Invece se ridimensionato il monitor alla risoluzione nativa (3840x2160), sembra che questo problema sparisca. In pratica ho problemi solo nelle dimensioni intermedie. sapete se si puo' fare qualcosa? Il problema credo sia dovuto al monitor e non alla scheda video, perche' su un monitor full hd non ho problemi di rallentamento. 
       
      Per ora sto usando solo Lilu e wahtervergreen , senza questi il monitor nemmeno si accende.
       
      Se avete idee sono bene accette, 
       
      Grazie!
       
    • By bojarek8
      Hello Gentlemens
       
      I am asking you with a great request for help with a problem I can not deal with. 
      I hope I have chosen a good section on this topic
       
      I have been using my Hackintosh for some time now 
      it does not cause me any more problems except for the one that irritates me
       
      My problem: 
       
      the system does not recognize my monitor and detects it as a 
      monitor monitor VGA
      13,9'' (800 x 600)
      Gigabyte GeForce 9600 GT 512  MB
       
       
      My monitor model: LG Flatron W2243S 
       

       
       
      As you can see in the attached picture, the system does not recognize the monitor as a built-in screen
       
      My main problem is that when the screen resolution is set to 1920x1080, black bars appear on the sides of the screen
      It is not very comfortable, that's why I would like to change it and make the image look the whole width of the monitor
      The monitor is connected to the graphics card with an adapter from the VGA connector to the DVI connector
       
      this is my conifig.plist 
      https://drive.google.com/open?id=1kBoGpfR8ooGAm-Y9C8Qu7rZetDWI8t6w
       
       
       
      I hope that I described my problem in a comprehensible way, thank you very much for your help  
       
       
    • By LarryKu
      Hi everyone,
      I am new, I hope I am posting in the correct forum.
      My specs:
      Processor: Core i5 6500 Skylake 3.2ghz
      Mobo: Gigabyte h170-d3h
      M2SSD: WD Black 256gb PCIe (Mac OSx)
      SSD: Samsung 860 Evo (WIndows 10)
      HDD: WD Blue 1TB
      GPU: Radeon RX 480
      Monitor: BenQ RL2460 24"


      I was able to install High Sierra on a new m2 drive, that I added to the above configuration with windows 10 already installed.
      I had a few issues during install, including the monitor turning off at boot screen.

      Unfortunately, this persists even now. It turns off at about 60% of the progress bar, and to turn it on again I have to unplug/plug back my hdmi.
      Additionally, while all of the usb ports worked during install and while running it out of the clover I had on the usb stick, only the rear ones appear to work now.
      The audio doesn't work either, though I added the correct patch according to my mobo

      Lastly, my other drives are not recognized in the bios anymore. They run fine from boot override but they don't show up in the boot priority (while multiple entries of mac OS do, and they seem to increase in number at every reboot)

      Thanks in advance for the help
×