Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Apple smc fan control

    Scheduled Pinned Locked Moved Hardware
    29 Posts 7 Posters 3.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hg_gts_350
      last edited by

      Hi

      I have setup an older macmini (5,1) as a gateway using pfsense, one ethernet port using the onboard broadcom the other a thunderbolt to ethernet adapter.

      This setup is working really well apart from one issue, the os doesn't appear to have the kernal module for apple's smc fan control. e.g. the following yields no results.

      sysctl dev.asmc -a | grep -i asmc
      

      This does appear to be available in the pfsense freeBSD src -> https://github.com/pfsense/FreeBSD-src/tree/devel-12/sys/modules/asmc. However, this does not appear in the release build. Will I have to compile my own kernal/kernal module to use this functionality?

      Thanks in advance!

      DaddyGoD NollipfSenseN 2 Replies Last reply Reply Quote 0
      • DaddyGoD
        DaddyGo @hg_gts_350
        last edited by

        @hg_gts_350

        Hi,

        there is a guy on the forum who has a similar configuration
        it is conceivable that he can help @NollipfSense

        Cats bury it so they can't see it!
        (You know what I mean if you have a cat)

        1 Reply Last reply Reply Quote 0
        • H
          hg_gts_350
          last edited by

          No worries, I'll see if I can find anything out.

          Thanks!

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Yeah, import the kernel module from an equivalent FreeBSD iso. kldload it to test initially.

            Steve

            1 Reply Last reply Reply Quote 0
            • H
              hg_gts_350
              last edited by

              Ah, never thought of that; ill give that a go. Thanks!

              1 Reply Last reply Reply Quote 0
              • NollipfSenseN
                NollipfSense @hg_gts_350
                last edited by

                @hg_gts_350 said in Apple smc fan control:

                Hi

                I have setup an older macmini (5,1) as a gateway using pfsense, one ethernet port using the onboard broadcom the other a thunderbolt to ethernet adapter.

                This setup is working really well apart from one issue, the os doesn't appear to have the kernal module for apple's smc fan control. e.g. the following yields no results.

                sysctl dev.asmc -a | grep -i asmc
                

                This does appear to be available in the pfsense freeBSD src -> https://github.com/pfsense/FreeBSD-src/tree/devel-12/sys/modules/asmc. However, this does not appear in the release build. Will I have to compile my own kernal/kernal module to use this functionality?

                Thanks in advance!

                I also ran the command and I got the same:
                [2.5.0-DEVELOPMENT][admin@NollipfSense.nollipfsense.lan]/root: sysctl dev.asmc -a | grep -i asmc
                sysctl: unknown oid 'dev.asmc'
                sysctl: unknown oid '-a'
                [2.5.0-DEVELOPMENT][admin@NollipfSense.nollipfsense.lan]/root:

                @stephenw10 said in Apple smc fan control:

                Yeah, import the kernel module from an equivalent FreeBSD iso. kldload it to test initially.

                Steve

                I am interested in this ... can you share more like a link to how to?

                pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                1 Reply Last reply Reply Quote 0
                • H
                  hg_gts_350
                  last edited by hg_gts_350

                  Noticed my grep was wrong above, (shotty cut and paste job), should be the following for reference.

                  sysctl -a | grep -i asmc
                  

                  As @stephenw10 said, you should be able to download the iso and extract the asmc.ko module from the image.

                  Then we can test it with :

                  kldload asmc.ko
                  

                  The above grep should then return results, if it does we can make the change permanent by placing the file in the /boot/modules path. Possiblly add asmc_load="YES" to the /boot/loader.conf file if it doesn't get picked automatically on boot.

                  The only problem will come when kernel updates are pushed, we'd have to do the same procedure for each release.

                  (I'm only guessing with the above, I have more experience with arch/RHEL/debian based Linux distros rather than freebsd)

                  NollipfSenseN 2 Replies Last reply Reply Quote 0
                  • NollipfSenseN
                    NollipfSense @hg_gts_350
                    last edited by NollipfSense

                    @hg_gts_350 Okay, understand what you're saying ...while researching, I found this:

                    Code:

                    grep ipmi /etc/rc.conf

                    ipmi_load="YES"

                    kldstat | grep ipmi

                    4 1 0xffffffff81cc1000 113b0 ipmi.ko

                    pkg info | grep ipmi

                    ipmitool-1.8.17_1 CLI to manage IPMI systems

                    ipmitool sensor | grep -i fan | cut -f1-4 -d'|'

                    FAN MOD 1A RPM | 4440.000 | RPM | ok
                    FAN MOD 2A RPM | 4560.000 | RPM | ok
                    FAN MOD 3A RPM | 4440.000 | RPM | ok
                    FAN MOD 4A RPM | 4440.000 | RPM | ok
                    FAN MOD 5A RPM | 4560.000 | RPM | ok
                    FAN MOD 6A RPM | 4440.000 | RPM | ok
                    FAN MOD 1B RPM | 3000.000 | RPM | ok
                    FAN MOD 2B RPM | 3120.000 | RPM | ok
                    FAN MOD 3B RPM | 3120.000 | RPM | ok
                    FAN MOD 4B RPM | 3000.000 | RPM | ok
                    FAN MOD 5B RPM | 3120.000 | RPM | ok
                    FAN MOD 6B RPM | 3000.000 | RPM | ok
                    Fan Redundancy | 0x0 | discrete | 0x0180

                    So, since I have the 2011 Mac Mini server, I was thinking I should have a motherboard or logic board management controller and checked whether I have the ipmi-tool ... I have the tool.

                    [2.5.0-DEVELOPMENT][admin@NollipfSense.nollipfsense.lan]/root: sysctl -a | grep -i asmc
                    [2.5.0-DEVELOPMENT][admin@NollipfSense.nollipfsense.lan]/root: pkg info | grep ipmi
                    ipmitool-1.8.18_2 CLI to manage IPMI systems
                    [2.5.0-DEVELOPMENT][admin@NollipfSense.nollipfsense.lan]/root: kldstat | grep ipmi
                    [2.5.0-DEVELOPMENT][admin@NollipfSense.nollipfsense.lan]/root:

                    But it looks like I am missing the ipmi.ko module.

                    pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                    pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                    1 Reply Last reply Reply Quote 0
                    • NollipfSenseN
                      NollipfSense @hg_gts_350
                      last edited by

                      @hg_gts_350 said in Apple smc fan control:

                      The above grep should then return results, if it does we can make the change permanent by placing the file in the /boot/modules path. Possiblly add asmc_load="YES" to the /boot/loader.conf file if it doesn't get picked automatically on boot.
                      The only problem will come when kernel updates are pushed, we'd have to do the same procedure for each release.

                      Don't know whether the OP is still here; however, I have added the asmc.ko module, rebooted, and update with daily snapshot without any issue. The hardware management tool that comes with FreeBSD - IPMI ... somehow I could not get it to work with the asmc.ko module nor with the ipmi.ko modules. It seems that it was expecting the ipmi.ko modules to be in /usr/src/sys/modules/ ... Src is intentionally left empty which suggest one of the changes made to FreeBSD 12.1. So, I'll download the Apple smc fan controller and give that a try over the weekend.

                      Screen Shot 2020-07-07 at 6.26.06 PM.png

                      Screen Shot 2020-07-07 at 6.25.29 PM.png

                      Screen Shot 2020-07-07 at 6.58.51 PM.png

                      Screen Shot 2020-07-08 at 4.28.19 PM.png

                      pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                      pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                      1 Reply Last reply Reply Quote 0
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by stephenw10

                        With asmc loaded you should see some sysctls that relate to the settings available. sysctl dev.asmc

                        Also check the boot log to see if it attached to anything. Or load it after boot with kldload and then check the system log.

                        Also you should put custom loader variables in /boot/loader.conf.local otherwise they may all be overwritten.

                        Steve

                        NollipfSenseN 1 Reply Last reply Reply Quote 0
                        • NollipfSenseN
                          NollipfSense @stephenw10
                          last edited by

                          @stephenw10 said in Apple smc fan control:

                          With asmc loaded you should see some sysctls that relate to the settings available. sysctl dev.asmc

                          Also check the boot log to see if it attached to anything. Or load it after boot with kldload and then check the system log.

                          Also you should put custom loader variables in /boot/loader.conf.local otherwise they may all be overwritten.

                          Steve

                          Well Steve, it seems that I didn't carry out your instructions carefully ... I had downloaded and extracted from FreeBSD 12.1 RELEASE instead of FreeBSD 12.1 stable. I gathered that from the following images below. I will redo later. I didn't fine the file /boot/loader.conf.local

                          Screen Shot 2020-07-09 at 12.11.22 PM.png

                          Screen Shot 2020-07-09 at 12.51.24 PM.png

                          Screen Shot 2020-07-09 at 12.55.24 PM.png

                          pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                          pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                          1 Reply Last reply Reply Quote 0
                          • H
                            hg_gts_350
                            last edited by

                            Ok, I thought I'd let you guys know where I got to,

                            I went downloaded free BSD 11.3, (@NollipfSense, that's the version of free BSD iso you need to download as the current stable version of pfsense uses that kernel, hence your error above). Extracted the asmc.ko file from the iso, and ran kldload.

                            kldload asmc
                            asmc0: model not recognized
                            

                            Unfortunately I found that my version of the Mac Mini is not supported by the kernel module, and I'd have to update the C header and class files (asmc.c and asmc.h) and build my own version of the 11.3 kernel just to get the kernal module to function. https://forums.freebsd.org/threads/asmc-on-macbook-pro-5-1.36722/

                            Although it does seem according to this that the asmc module does support my mac mini here, https://wiki.freebsd.org/IntelMacMini but it is in a later version of the kernel, so I could back port the asmc.h and asmc.c changes, build the kernel and it should work. But this was kind of defeating the purpose of using pfsense for me, since I was trying to move away from arch Linux for the sake of stability.

                            1 Reply Last reply Reply Quote 0
                            • stephenw10S
                              stephenw10 Netgate Administrator
                              last edited by

                              @NollipfSense is running a 2.5 snapshot which is built on 12.1-stable. Though kernel modules for 12.1-rel usually work there.

                              Maybe it's a much older snapshot built on 12.0-rel?

                              Steve

                              1 Reply Last reply Reply Quote 0
                              • H
                                hg_gts_350
                                last edited by

                                My mistake, apologies

                                1 Reply Last reply Reply Quote 0
                                • H
                                  hg_gts_350
                                  last edited by

                                  This might be useful to anyone looking to try and get the asmc module working, you can pretty much check what version of mac is supported here:

                                  https://svnweb.freebsd.org/base/stable/11/sys/dev/asmc/asmc.c?view=markup&pathrev=344889

                                  and

                                  https://svnweb.freebsd.org/base/stable/12/sys/dev/asmc/asmc.c?view=markup&pathrev=344888

                                  1 Reply Last reply Reply Quote 0
                                  • stephenw10S
                                    stephenw10 Netgate Administrator
                                    last edited by stephenw10

                                    Hmm, nothing that recent then. Driver needs some love upstream....

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      m_g_s_g
                                      last edited by

                                      Sorry to nectropost. But I searched for "Mac Mini smc fan control" and this thread came up as one of the first ones.

                                      This is just to document that I was able to compile and load an asmc.ko module for a Mac Mini 6,1.

                                      This specific Mac Mini version is theoretically not supported, but just copying and adding to asmc.c the config for the last supported model (5,2) did the trick.

                                      So I added this to /usr/src/sys/dev/asmc/asmc.c:

                                      	/* Line ~304 : Patch for Macmini 6,1 */
                                      	{ 
                                      	  "Macmini6,1", "Apple SMC Mac Mini 6,1 (Late 2012)",
                                      	  NULL, NULL, NULL,
                                      	  ASMC_FAN_FUNCS2,
                                      	  NULL, NULL, NULL,
                                      	  ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS
                                      	},
                                      
                                      	/* Patch for Macmini 6,2 */
                                      	{ 
                                      	  "Macmini6,2", "Apple SMC Mac Mini 6,2 (Late 2012)",
                                      	  NULL, NULL, NULL,
                                      	  ASMC_FAN_FUNCS2,
                                      	  NULL, NULL, NULL,
                                      	  ASMC_MM52_TEMPS, ASMC_MM52_TEMPNAMES, ASMC_MM52_TEMPDESCS
                                      	}, 
                                      

                                      NOTE that even if pfSense 2.5.2 is supposed to use a STABLE FreeBSD version, I was able to compile it with this source tree:

                                      $ fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/11.2-RELEASE/src.txz
                                      $ freebsd $ tar -C / -xvf ./src.txz
                                      

                                      DISCLAIMER: Some temperature/fan sensors are reported to fail with messages shown in dmesg (expected, probably they don't exist in a Mac Mini 6,2). Only try to modify the existing ones as reported with:

                                      $ kldload asmc.ko
                                      $ sysctl -a | grep -i asmc
                                      
                                      F 1 Reply Last reply Reply Quote 1
                                      • NollipfSenseN
                                        NollipfSense
                                        last edited by

                                        Thanks to @bmeeks I finally saw the light in that I realized that Apple hardware, such as the Mac Mini, are made specifically for Apple's operation system. So, I have moved away from the platform in terms of my pfSense implementation and is now sporting a Lenovo Thinkcentre M93p SFF 120GB SSD 32GB RAM. Thank you Bill, I was stubborn as hell.

                                        pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                                        pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                                        1 Reply Last reply Reply Quote 0
                                        • F
                                          firemanwall @m_g_s_g
                                          last edited by

                                          @m_g_s_g - To add to your nectropost, I'm sill searching for a way to regain fan control on my Mac mini 5,1 after updating from 2.4 >> 2.5. This thread is really the only source of relevant info I've been able to find.

                                          At 2.4, I was able to simply download a VMDK of the corresponding FreeBSD version, extract the asmc.ko file and transfer it to my mini, but I'm struggling with this process in 2.5. I've tried following the same process I used before at 2.4, in this case using 12.2 RELEASE and 12.2 STABLE, but both fail.

                                          Any chance you could help point me in the right direction to regain fan speed control on my 5,1 mini running 2.5? I'm not overly familiar with compiling, other than basic WLED and Tasmota projects which had easy-to-follow guides. If that is my only option, I too may have to repurpose one of my m93p's that's just collecting dust; I'm not a fan of running 70 degree idle temps where I was previously in the 40-50 range at 2.4 with manual fan control.

                                          Thanks!

                                          NollipfSenseN 1 Reply Last reply Reply Quote 0
                                          • NollipfSenseN
                                            NollipfSense @firemanwall
                                            last edited by

                                            @firemanwall said in Apple smc fan control:

                                            If that is my only option, I too may have to repurpose one of my m93p's that's just collecting dust; I'm not a fan of running 70 degree idle temps where I was previously in the 40-50 range at 2.4 with manual fan control

                                            That's why I gave up... couldn't stand seeing my mini heats up.

                                            pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                                            pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.