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.
    • 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
                                          • rmonsterR
                                            rmonster
                                            last edited by rmonster

                                            Hi Guys,

                                            I've joined to forum just to respond to this thread.

                                            I've gotten everything to work on my older 2011 Mac Mini by doing the following:

                                            1. Download and install the latest stable DVD ISO freebsd 12,2 and installing onto a VM
                                            2. Edit the source file /usr/src/sys/dev/asmc/asmc.c as m_g_s_g mentioned
                                            3. Used his code but added Macini5,1 and 5,2 as well, everything else the same.
                                            4. Compiled the new asmc module by going to the source directory /usr/src/sys/modules/asmc and running make
                                            5. Found where the complier placed the module by running find / -name asmc.ko. Note there are two of them, one already in boot and the other is the one you want with the current date and time, you can check with ls -l
                                            6. Copied the module to my pFsense Mac Mini
                                            7. Loaded the module to test with kldload ./asmc.ko
                                            8. Then ran sysctl -a | grep -I asmc which resulted in sensor data dumped (yippie!)
                                            9. Tested changing the fan speed by running: sysctl dev.asmc.0.fan.0.minspeed=3000
                                            10. Verified that the fan speed had increased and cpu temperature dropped
                                            11. Wrote dev.asmc.0.fan.0.minspeed=3000 to /etc/sysctl.conf for boot changes

                                            CPU Temps dropped from high 60s to low to mid 50s.

                                            I'll probably run this Mac Mini until it dies as a pFsense box now.

                                            Hopefully this helps some of you make use of your older hardware.
                                            P.S. I had an old thunderbolt to ethernet which I used as my second interface.

                                            The box is pretty snapping and works great for gigabit internet and wifi with no slow downs.

                                            Thanks to everyone that posted in this thread and helped me to get it working.

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