- Saved searches
- Use saved searches to filter your results more quickly
- License
- JuampiCarosi/fan-control
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Imac with Ubuntu (Lubuntu 20.04) — Controlling fan speed
- What I tried so far
- What I think could work but not sure how
- PPA Install macfanctld, Fan control daemon for MacBook
- Install macfanctld via PPA:
- Ji m
- How do I control the fan on a Apple Mac Mini?
- 1 Answer 1
- Saved searches
- Use saved searches to filter your results more quickly
- nwam/mac_fan_controller
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Simple shell script to control hdd and cpu fans of macs in linux
License
JuampiCarosi/fan-control
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Note: This script has been primary coded for my iMac 12,1 (2011, 21.5 inch) and was later updated to work as well on the following macs: MacBook 5,1 and 5,2 running Ubuntu 20.04 and Macmini 3,1 (2009 Macmini), if you have problems with this script on other Macs please open an issue
(here you don’t create the actual command, just an alias, but it’s more updatable, just git pull will get the job done)
cd ~/ && git clone https://github.com/juampapo546/fan-control/
echo 'alias fan="sudo sh /home/$USER/fan-control/fan.sh"' >> ~/.bashrc
echo 'alias fan="sudo sh /home/$USER/fan-control/fan.sh"' >> ~/.zshrc
If you have doubts you probably use bash, to be sure check if you have in your /home .bashrc or .zshrc
(here you create the command but you’ll have to repeat the whole process every time you want to update)
cd ~/ && git clone https://github.com/juampapo546/fan-control/
sudo mv ~/fan-control/fan.sh /bin/fan && sudo chmod +x /bin/fan
First check what fans are available for your mac
Then choose one one of the output fans and run:
sudo fan [ SELECT FAN TO CONTROL ] [SELECT THE PERCENTAGE YOU WANT THE FAN TO RUN ] -hdd (an example) -value (nummber from 1 to 100) -auto -auto
For example if you want cpu fan to run at it’s 65% the input should be:
About
Simple shell script to control hdd and cpu fans of macs in linux
Imac with Ubuntu (Lubuntu 20.04) — Controlling fan speed
I switched an old Imac (2008) to Lubuntu. While it runs smoothly for all I need to do, 20 minutes after starting the CPU fan starts to get super loud. Here is a screenshot of psensor: psensor screenshot psensor screenshot Basically, 2 sensors, TD0D and temp1 see an increase in temperature until reaching 105°C, which triggers the increase of the CPU fan speed. This fan gradually accelerate until its max, 3600 RPM, which makes the imac very loud. This do lower the temp of these 2 sensors, until aournd 80°C, but this is not cool enough to reduce the fan speed. This is annoying because I think with a fix speed set to 2000 RPM for example, the temp would stabilise at an acceptable temperature, hopefully below 90°C, while the noise would still be acceptable.
What I tried so far
I tried to follow the steps described here: How to control fan speed?, so basically set up lm-sensors, then set up fancontrol with the help of pwmconfig But pwmconfig answers: There are no pwm-capable sensor modules installed Even after adding the module applesmc to /etc/modules and rebooting, no chance. I also tried to install mbpfan: https://github.com/linux-on-mac/mbpfan But it is meant for macbooks and not for imacs, with the result that only one sensor seems to be taken into account, then all fan speed are raised simultaneously, which is not helping in my case (see https://github.com/linux-on-mac/mbpfan/issues/211)
What I think could work but not sure how
pwmconfig is «just» a helper to create the fancontrol settings file. So I could simply make this settings file myself and set up a min speed of 200 RPM for the CPU fan. But I am not sure this can work, because maybe fancontrol can only control PWM fans and somehow imac fans are not PWM. Also, if it can work, I am unsure what should be the path of each fan to put in that file and whre I could find an example of settings file. So: can fancontrol work? if not, do you have any other ideas? Actually, I realise the problem seem to come from the GPU, since temp1 seems to be in the Radeon PCI section. My imac has a Radeon RV630 Graphic Card. Could it be that there is a better driver somewhere that would lead to it heating less? This is happening while browsing internet or even not doing anything, so it’s not linked to complex graphics calculations. here is the output of sensors if that helps
applesmc-isa-0300 Adapter: ISA adapter ODD : 698 RPM (min = 700 RPM, max = 4800 RPM) HDD : 1229 RPM (min = 1200 RPM, max = 5900 RPM) CPU : 3602 RPM (min = 1200 RPM, max = 3600 RPM) TA0P: +27.8°C TC0D: +50.5°C TC0H: +49.8°C TC0P: +50.0°C TG0D: +78.8°C TG0H: +66.2°C TG0P: +71.0°C TH0P: +57.8°C TL0P: +58.0°C TO0P: +49.8°C ERROR: Can't get value of subfeature temp11_input: I/O error TW0P: N/A Tm0P: +53.2°C Tp0P: +82.8°C radeon-pci-0100 Adapter: PCI adapter temp1: +80.0°C coretemp-isa-0000 Adapter: ISA adapter Core 0: +49.0°C (high = +105.0°C, crit = +105.0°C) Core 1: +59.0°C (high = +105.0°C, crit = +105.0°C)
PPA Install macfanctld, Fan control daemon for MacBook
Running Ubuntu on Apple MacBook / MacBook Pro computers?
Well, you may already know that there’s a fan control daemon which reads the temperature sensors in an Apple Macbook (or Macbook Pro) computer and throttles the fans accordingly to keep the temperature within configurable limits.
I don’t have an Apple MacBook. But I think this daemon will work good on Ubuntu because Ubuntu 14.04 Trusty has made this into its universe repository.
Install macfanctld via PPA:
You can easily get this daemon from the developer’s PPA. So far, it supports Ubuntu 13.04 Raring, Ubuntu 12.10 Quantal, Ubuntu 12.04 Precise, and Ubuntu 10.04 Lucid.
Press Ctrl+Alt+T on your keyboard to open terminal. When it opens, run commands below one by one:
sudo add-apt-repository ppa:mactel-support/ppa sudo apt-get update sudo apt-get install macfanctld
For Ubuntu 13.10 Saucy, install it from an unofficial repository:
sudo add-apt-repository ppa:detly/mactel-utils sudo apt-get update sudo apt-get install macfanctld
For Ubuntu 14.04 Trusty, search for and install macfanctld package in Ubuntu Software Center after checking for updates.
Ji m
I’m a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1
How do I control the fan on a Apple Mac Mini?
I am running 12.04 LTS on Apple mini hardware (about 4 years old). The fan seems to run non-stop. «ThinkFan» is installed but I do not know how to use it in order to modulate fan speed. The software says that it can be used with systems other than ThinkPads through sysfs hwmon interface. I have no idea what that is.
1 Answer 1
Try to use fancontrol . It might help.
You could then edit your config file /etc/fancontrol or run pwmconfig ( sudo su — -c /usr/sbin/pwmconfig ). You can also edit the config file like this one, but bear in mind that you have different hardware:
Taken from https://wiki.archlinux.org/index.php/Fan_speed_control
INTERVAL=10 DEVPATH=hwmon0=devices/platform/coretemp.0 hwmon2=devices/platform/w83627ehf.656 DEVNAME=hwmon0=coretemp hwmon2=w83627dhg FCTEMPS=hwmon0/device/pwm1=hwmon0/device/temp1_input FCFANS= hwmon0/device/pwm1=hwmon0/device/fan1_input MINTEMP=hwmon0/device/pwm1=20 MAXTEMP=hwmon0/device/pwm1=55 MINSTART=hwmon0/device/pwm1=150 MINSTOP=hwmon0/device/pwm1=105 INTERVAL: how often the daemon should poll CPU temps and adjust fan speeds. INTERVAL is in seconds.
The rest of the configuration file is split into (at least) two values per configuration option. Each configuration option first points to a PWM device which is written to which sets the fan speed. The second «field» is the actual value to set. This allows monitoring and controlling multiple fans and temperatures.
FCTEMPS: The temperature input device to read for CPU temperature. The above example corresponds to /sys/class/hwmon/hwmon0/device/temp1_input. FCFANS: The current fan speed, which can be read (like the temperature) in /sys/class/hwmon/hwmon0/device/fan1_input MINTEMP: The temperature (°C) at which to SHUT OFF the CPU fan. Efficient CPUs often will not need a fan while idling. Be sure to set this to a temperature that you know is safe. Setting this to 0 is not recommended and may ruin your hardware! MAXTEMP: The temperature (°C) at which to spin the fan at its MAXIMUM speed. This should be probably be set to perhaps 10 or 20 degrees (°C) below your CPU's critical/shutdown temperature. Setting it closer to MINTEMP will result in higher fan speeds overall. MINSTOP: The PWM value at which your fan stops spinning. Each fan is a little different. Power tweakers can echo different values (between 0 and 255) to /sys/class/hwmon/hwmon0/device/pwm1 and then watch the CPU fan. When the CPU fan stops, use this value. MINSTART: The PWM value at which your fan starts to spin again. This is often a higher value than MINSTOP as more voltage is required to overcome inertia.
There are also two settings fancontrol needs to verify the configuration file is still up to date. The lines start with the setting name and a equality sign, followed by groups of hwmon-class-device=setting, seperated by spaces. You need to specify each setting for each hwmon class device you use anywhere in the config, or fancontrol will not work.
DEVPATH: Sets the physical device. You can determine this by executing the command
You should have these values set accordingly to the values of the the command sensors .
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Control Macbook fans on Linux.
nwam/mac_fan_controller
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Control a Mac’s fan speeds on Linux
This script sets your Macbook’s fan speed based on the highest CPU temperature. It currently only supports one fan, but can easily be generalized to work with n fans. This script was made to avoid an expensive hardware fix on a Macbook with a broken motherboard temperature sensor.
Run sudo setup.sh then run sudo crontab -e and append the following line to the file that opens:
* * * * * /usr/local/bin/run_every_x_seconds 10 /usr/local/bin/fan_control
This will make fan_control run every 10 seconds.
You Macbook might store its SMC files under a different path. If the directory /sys/devices/platform/applesmc.768/ does not exist, you should change the line
APPLE_SMC = '/sys/devices/platform/applesmc.768/'
in fan_control to point the proper directory (hopfully it is as simple as a different number after applesmc ) then re-run sudo setup.sh .
About
Control Macbook fans on Linux.