Jun 30, 2012

2010 Mac-mini Broken Fan Sensor Fix

Posted by Knick

I upgraded my 2010 Mac-mini HDD to an SSD and in doing so I broke the HDD temperature control sensor off the motherboard. When it first happened I thought I had ruined my Mac but after finishing the project and powering it back up all that it had done was make the fans run at a full 5500 RPM 100% of the time. I did some research and found some helpful information on how to fix this problem.

Read More for details.


I found most of the information I needed here:

https://github.com/ilTofa/BrokenFanControl


I also had some help from JP White


The guide on this website was left vague and had a few steps that did not work for me so I am reposting with my notes so I can refer back to this if I have to reinstall the OS on this computer later and have to redo this work.

You will need to download a few files and install a few apps for this project.

First you need Text Wrangler, this will let you create the python script and plist files you will install.

Second you need smcFanControl, this will be what actually controls the fan speed.

Third you need SleepWatcher, this will run the python script every time your computer wakes up.

Fourth you will need the python script, this script will check the temperature of the processor and set the fan speed according to the temperature. You can save the file or view the file and copy and paste it into a new file with text wrangler, this is what I did since when I tried to download it Safari added some code and saved it as an HTML file and it wouldn't run correctly.

Finally you need the plist file that will allow your script to run when the computer wakes up from sleep. You can save the file or view the file and copy and paste it into a new file with text wrangler, this is what I did since when I tried to download it Safari added some code and saved it as an HTML file and it wouldn't run correctly.


Here are the install instructions:

  • Download smcFanControl and install it in /Application
  • Copy BrokenFanControl.py in /usr/local/bin
  • Make it an executable with this command: chmod +x BrokenFanControl.py
  • Download SleepWatcher and install it with the following commands (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
  • create the cron file (thanks JP):
  • sudo crontab -e
  • you will now be entering text with the VI editor to the file so you will need to use VI commands:
  • pres "i"
  • copy the following into the file
  • */1 * * * * python /usr/local/sbin/BrokenFanControl.py
  • press the "esc" key
  • type ":wq"
Wait 1 min and the fan should spin down to the appropriate speed based on the temperature of the computer. The script will run every minute to check your processor temperature and adjust the fan speed accordingly. I suggest you leave smcFanControl running in the toolbar so you can monitor your temperature and fan speed easily.

8 comments:

Richard Williams said...

Thanks for posting this information. There is a 'typo' in the crontab. The executed script should be /usr/local/bin/BrokenFanControl.py, not /usr/local/sbin/BrokenFanControl.py

I think it might also be worth mentioning that the Python script requires Python 2.7. Python 2.6 is installed on SnowLeopard and there is a very good page with instructions for installing 2.7 at http://wolfpaulus.com/jounal/mac/installing_python_osx (yes, it is 'jounal').

Richard Williams said...

The other comment I have is that it's very difficult to post a Comment because the comment form doesn't allow scrolling down to the 'captcha' input box. It needs scrolling='no' to be changed to scrolling='yes' on the iframe with id='comment-editor'.

Knick said...

Thanks for the comments, i will look into fixing that if i can.

Mowd said...

Thanks for the instruction, this help me very much.
As the Richard said, the path is wrong in crontab.

Ivan Morelli said...

Hi Thank you for share, but just a remark after last update of the smcFanControl, the output is changed you need to update the way you take the temperature for me this worked:

temp1S =subprocess.check_output(readsensorscall + "TC0D", shell=True, stderr=subprocess.PIPE)
temp2S =subprocess.check_output(readsensorscall + "TC0D", shell=True, stderr=subprocess.PIPE)
actualfanspeedS =subprocess.check_output(readsensorscall + "TC0D", shell=True, stderr=subprocess.PIPE)
print "temp1S:",temp1S,"temp2S:",temp2S,"actualfanspeedS:",actualfanspeedS
temp1 =int(temp1S[16:18])
temp2 =int(temp2S[16:18])
actualfanspeed =int(actualfanspeedS[16:18])

Bye, Ivan

psv said...
This comment has been removed by the author.
Anonymous said...

Hi everyone,
thank you for this tuto. Even if I had precisely follow the instruction, my Mac-mini fan continue to run a marathon and make me crazy.
The fan problem just appeared when I swap the original hdd by a brand new SSD (larger).
Any idea how I may proceed to find the blocking step?
- SMCfancontrol is v2.4
- I wrote the plist file in Textwrangler
- I had an error "dubious ownership" when I tried to launch the daemons (I fixed it with "sudo chown root" command)
Thank you in advance for your help (this noise will drive me crazy)!

Seb sebrousseau(a)gmail.com

Anonymous said...

Thanks a lot for this tutorial!!!!

Had to change the folder as mentioned above. Had also to find a way to get the executable file... as your way was not working

Followed this link
http://stackoverflow.com/questions/29584270/how-do-you-make-a-python-executable-file-on-mac

thanks a lot again!

Post a Comment