-
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!
-
Hi,
there is a guy on the forum who has a similar configuration
it is conceivable that he can help @NollipfSense -
No worries, I'll see if I can find anything out.
Thanks!
-
Yeah, import the kernel module from an equivalent FreeBSD iso. kldload it to test initially.
Steve
-
Ah, never thought of that; ill give that a go. Thanks!
-
@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?
-
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)
-
@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 | 0x0180So, 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.
-
@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.
-
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
-
@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
-
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.
-
@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
-
My mistake, apologies
-
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
-
Hmm, nothing that recent then. Driver needs some love upstream....
-
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
-
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.
-
@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!
-
@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.
Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.