GithubHelp home page GithubHelp logo

edk / brokenfancontrol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iltofa/brokenfancontrol

1.0 2.0 0.0 98 KB

Control max speed of Mac Mini fan on OS X (useful for broken sensors)

Python 100.00%

brokenfancontrol's Introduction

BrokenFanControl is a simple program to set the maximum fan speed in a Mac Mini.

Introduction

It's not useful for everyone and can be dangerous for your computer. I needed it because I broke a temperature sensor in my Mac Mini Server (Mid-2010) changing one of the internal drive for a Crucial m4 (a great drive, btw). Therefore the fan was always starting at full speed and this was really annoying.

All fan control programs are designed to raise the minimum fan speed to cool more while my problem is the opposite: lower fan speed (allowing the computer to raise its temp). So I decided to run my own (working on what have been already done by others).

WARNINGS

This program is not for end-users. It is for hackers, people that know their Mac and are not afraid of it, people that know how to start up and use the terminal (and, again, are not afraid of it).

BrokenFanControl is dangerous. Setting the maximum fan speed effectively inhibit the cooling of the computer. This is dangerous, can broke your computer or set it to fire!

I wrote it because I have problems (broken HD sensor, as said before) it should not be run on a working system!

The program has been tested only on a Mid-2010 Mac Mini (server edition, the one with 2 disk drives). Should work on any Mac Mini intel but I'm not sure of that. Please make your tests before install!

The code

Is very simple: it simply reads, via smcFanControl command line program, the values of TC0D (the processor temperature) and set the maximum speed of the fan (F0Mx) also via smcFanControl. The fan speed goes from 1800 when the CPU temp is 50°C or less to the maximum speed when the temp is over 75°C.

The commented print statement are for debug and use also TC0P (probably the CPU heatsink) and F0Ac (the current fan speed).

How to test it without burning your Mac

My code is a simple python script that wraps some call to the command line component of smcFanControl.

Before installing it, test it uncommenting the print statements and commenting the last subprocess.call call (the one that sets the maximum speed). If fans behave strangely: stop the computer, wait a little and wake it. All should be normal.

Installation

The script is installed so that it's called by cron every minute and by SleepWatcher at wake up time (so you don't have to hear full speed fans for a full minute when the mini wakes up).

Follow the instructions. The instructions are not very easy to follow. This is intentional. If you don't understand them, well, you should not use this script. As said before: it's dangerous. :)

  • download smcFanControl and install it in /Application
  • copy BrokenFanControl.py in /usr/local/bin and make it executable
  • download SleepWatcher and install it
    • Assuming you've downloaded it in Desktop
    • sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8
    • sudo cp ~/Desktop/sleepwatcher_2.2/sleepwatcher /usr/local/sbin
    • sudo cp ~/Desktop/sleepwatcher_2.2/sleepwatcher.8 /usr/local/share/man/man8
  • copy de.bernhard-baehr.sleepwatcher-BrokenFan.plist to /Library/LaunchDaemons
  • sudo launchctl load /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher-BrokenFan.plist
  • sudo crontab -e
    • insert the line below (from */1 to end of line)
    • */1 * * * * /usr/local/sbin/smcFanReset
  • Enjoy the silence.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.