Mbpfan: Difference between revisions

From wikinotes
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Control cpufans on a macbook pro from linux.
Uses information from [[lm_sensors]] to control macbook fans on a T2-cpu macbook from linux.
 
{{ TODO |
I'm not convinced this is working, I'm hitting CPU temps of 81 C with no real workload.
Look deeper into configuration. }}


= Documentation =
= Documentation =
Line 13: Line 9:
|}
|}
</blockquote><!-- Documentation -->
</blockquote><!-- Documentation -->
= Locations =
<blockquote>
{| class="wikitable"
|-
| <code>/etc/mbpfan.conf</code> || config
|-
|}
</blockquote><!-- Locations -->


= Install =
= Install =
<blockquote>
<blockquote>
{{ WARNING |
{{ WARNING |
The AUR package for mbpfan refers to a fork that is out of date and does not work.
The AUR package for mbpfan refers to the original mbpfan, which won't work on a mac with a T2 chip.
 
* (supports T2) https://github.com/networkException/mbpfan
* (good) https://github.com/networkException/mbpfan
* (supports ~2012 macs) https://github.com/dgraziotin/mbpfan
* (bad) https://github.com/dgraziotin/mbpfan
}}
}}


== Build/Install ==
<blockquote>
Build
Build
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 40: Line 46:
</syntaxhighlight>
</syntaxhighlight>


Confirm it's working
Detect sensors '''important!!'''
<syntaxhighlight lang="bash">
yes | sensors-detect  # dumps a config with sensor info
</syntaxhighlight>
</blockquote><!-- Build/Install -->
 
== Verify ==
<blockquote>
I found I needed to tweak the config
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo systemctl status mbpfan.service
sudo systemctl status mbpfan.service # ensure running
sensors # see CPU temps
watch sensors                         # monitor cpu temp every 2s
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Verify -->
</blockquote><!-- Install -->
</blockquote><!-- Install -->
= Configuration =
<blockquote>
I found the default thresholds a bit hot for my liking, but it's easy to tweak.
<syntaxhighlight lang="conf">
[general]
low_temp = 48
high_temp = 58
max_temp = 86
</syntaxhighlight>
</blockquote><!-- Configuration -->


= Troubleshooting =
= Troubleshooting =

Latest revision as of 23:47, 6 March 2022

Uses information from lm_sensors to control macbook fans on a T2-cpu macbook from linux.

Documentation

https://github.com/networkException/mbpfan

Locations

/etc/mbpfan.conf config

Install

WARNING:

The AUR package for mbpfan refers to the original mbpfan, which won't work on a mac with a T2 chip.

Build/Install

Build

git clone https://github.com/networkException/mbpfan
cd mbpfan
make
sudo make install
sudo make tests

Enable

sudo cp mbpfan.service /etc/systemd/system
sudo systemctl enable mbpfan.service
sudo systemctl daemon-reload
sudo systemctl start mbpfan.service

Detect sensors important!!

yes | sensors-detect  # dumps a config with sensor info

Verify

I found I needed to tweak the config

sudo systemctl status mbpfan.service  # ensure running
watch sensors                         # monitor cpu temp every 2s

Configuration

I found the default thresholds a bit hot for my liking, but it's easy to tweak.

[general]
low_temp = 48
high_temp = 58
max_temp = 86

Troubleshooting

# watch it run
mbpfan -f # run in foreground
mbpfan -v # verbose

Some background info for debugging:

  • applesmc is builtin to the linux kernel.
  • mbpfan uses applesmc exposed info from files in /sys/devices/platform/* (ex: APP, applesmc.768