Fan-Control Script for Upgraded MacPro1,1 or 2,1

Discussion in 'Mac Pro' started by ProfDrLuigi, Feb 13, 2014.

  1. ProfDrLuigi, Feb 13, 2014
    Last edited: Feb 13, 2014

    ProfDrLuigi macrumors member

    Joined:
    Jun 19, 2010
    #1
    I upgraded my CPU´s of my 1,1 to 5355 in 2011. I wrote a little bash-script which controls the fans automatic (max and min values can be defined)

    Code:
    #!/bin/bash
    #  HEX   U/Min
    # 0D48 =  850
    # 0ED8 =  950
    # 1068 = 1050
    # 11F8 = 1150
    # 1388 = 1250
    # 1518 = 1350
    # 16A8 = 1450
    # 1838 = 1550
    #
    # If you want higher values you can calculate it this way (Hex-Calculator needed). 
    # For example you want 1650 upm.
    #
    # 1650 x 4 = 6600 --> switch Calculator in HEX-Mode --> 19C8 is the result
    #
    # F0 = CPU Fan
    # F2 = Exhaust Fan
    
    while [ true ]  
    do
    /bin/sleep 10
    
    hwm="/Applications/HardwareMonitor.app/Contents/MacOS/hwmonitor"
    smc="/Applications/smcFanControl.app/Contents/Resources/smc"
    
    cpu=`"$hwm" -ds | head -n 1 | cut -c 13-14`
    
    if [[ "$cpu" -gt "20" && "$cpu" -lt "35" ]]; then  # - Between 21 and 34 Degrees
        "$smc" -k F0Mn -w 0ED8    
        "$smc" -k F2Mn -w 1068
    
    elif [[ "$cpu" -gt "34" && "$cpu" -lt "51" ]]; then  # - Between 35 and 50 Degrees
        "$smc" -k F0Mn -w 1068    
        "$smc" -k F2Mn -w 11F8
    
    elif [[ "$cpu" -gt "50" && "$cpu" -lt "60" ]]; then  # - Between 51 and 59 Degrees
        "$smc" -k F0Mn -w 11F8    
        "$smc" -k F2Mn -w 1388
    
    elif [[ "$cpu" -gt "59" && "$cpu" -lt "99" ]]; then  # - Between 60 and 99 Grad
        "$smc" -k F0Mn -w 1518   
        "$smc" -k F2Mn -w 1388
    fi
    done 
    
    Works like a charme on my mac since than (3 Years now). You need Hardwaremonitor and smc fan control in Applications. I started the script at boot via a User-Daemon (use Lingon to create one). The script checks the temps every 10 Seconds and if necessary it changed the RPM of the Fan´s.
     
  2. sarthak macrumors 6502

    Joined:
    Nov 19, 2012
    Location:
    Canada
    #2
    Modified the script a little bit to read from Temperature Monitor (freeware).

    Regardless of the app, the fan ramp seems to be adjusting to CPU cooler reported temps and not the CORE temps. Ex. The cores can heat up to 80-90c on full load and the fans still stay around 800rpm as it responds to the rise in temperature for the cooler and not the cores.

    Here's the code in case anyone else is interested in creating a fan ramp for their Mac Pro 1,1 / 2,1 and can figure out how to read from core temps. For now, I'll revert back to using iStatMenus or SMCFanControl and manually changing to different speed profiles.

    Code:
    #!/bin/bash
    #  HEX   U/Min
    # 0D48 =  850
    # 0ED8 =  950
    # 1068 = 1050
    # 11F8 = 1150
    # 1388 = 1250
    # 1518 = 1350
    # 16A8 = 1450
    # 1838 = 1550
    #
    # If you want higher values you can calculate it this way (Hex-Calculator needed). 
    # For example you want 1650 upm.
    #
    # 1650 x 4 = 6600 --> switch Calculator in HEX-Mode --> 19C8 is the result
    #
    # F0 = CPU Fan
    # F2 = Exhaust Fan
    
    while [ true ]  
    do
    /bin/sleep 10
    
    hwm="/Applications/TemperatureMonitor.app/Contents/MacOS/TemperatureMonitor"
    smc="/Applications/smcFanControl.app/Contents/Resources/smc"
    
    cpu=`"$hwm" -ds | head -n 1 | cut -c 13-14`
    
    if [[ "$cpu" -gt "20" && "$cpu" -lt "51" ]]; then  # - Between 20 and 50 Degrees
        "$smc" -k F0Mn -w 7D0		#CPU Fan min 500rpm
        "$smc" -k F2Mn -w 960		#Exhaust Fan min 600rpm
    
    elif [[ "$cpu" -gt "50" && "$cpu" -lt "61" ]]; then  # - Between 50 and 60 Degrees
        "$smc" -k F0Mn -w 1068    	#CPU Fan min 1050rpm
        "$smc" -k F2Mn -w 11F8		#Exhaust Fan min 1150rpm
    
    elif [[ "$cpu" -gt "60" && "$cpu" -lt "71" ]]; then  # - Between 60 and 70 Degrees
        "$smc" -k F0Mn -w 1B58    	#CPU Fan min 1750rpm
        "$smc" -k F2Mn -w 1CE8		#Exhaust Fan min 1850rpm
    
    elif [[ "$cpu" -gt "70" && "$cpu" -lt "81" ]]; then  # - Between 70 and 80 Degrees
        "$smc" -k F0Mn -w 2580   	#CPU Fan min 2400rpm
        "$smc" -k F2Mn -w 2648		#Exhaust Fan min 2450rpm
        
    elif [[ "$cpu" -gt "80" && "$cpu" -lt "99" ]]; then  # - Between 80 and 99 Grad
        "$smc" -k F0Mn -w 2BC0   	#CPU Fan min 2800rpm
        "$smc" -k F2Mn -w 2C88		#Exhaust Fan min 2850rpm
    fi
    done
     

Share This Page