Changeset 5335
- Timestamp:
- 09/10/08 09:33:05 (2 months ago)
- Files:
-
- lm-sensors/trunk/prog/pwm/fancontrol (modified) (8 diffs)
- lm-sensors/trunk/prog/pwm/fancontrol.8 (modified) (2 diffs)
- lm-sensors/trunk/prog/pwm/fancontrol.pl (modified) (7 diffs)
- lm-sensors/trunk/prog/pwm/pwmconfig (modified) (11 diffs)
- lm-sensors/trunk/prog/pwm/pwmconfig.8 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/prog/pwm/fancontrol
r5272 r5335 61 61 MINPWM=`egrep '^MINPWM=.*$' $1 | sed -e 's/MINPWM=//g'` 62 62 MAXPWM=`egrep '^MAXPWM=.*$' $1 | sed -e 's/MAXPWM=//g'` 63 63 64 64 # Check whether all mandatory settings are set 65 65 if [[ -z ${INTERVAL} || -z ${FCTEMPS} || -z ${MINTEMP} || -z ${MAXTEMP} || -z ${MINSTART} || -z ${MINSTOP} ]] … … 76 76 77 77 # write settings to arrays for easier use and print them 78 echo78 echo 79 79 echo "Common settings:" 80 80 echo " INTERVAL=$INTERVAL" 81 81 82 82 let fcvcount=0 83 83 for fcv in $FCTEMPS … … 150 150 151 151 if [ -f "$1" ] 152 then 152 then 153 153 LoadConfig $1 154 154 else … … 174 174 SYSFS=1 175 175 DIR=$SDIR 176 fi 176 fi 177 177 fi 178 178 cd $DIR … … 269 269 minpwm=${AFCMINPWM[$fcvcount]} 270 270 maxpwm=${AFCMAXPWM[$fcvcount]} 271 271 272 272 read tval < ${tsens} 273 273 if [ $? -ne 0 ] … … 293 293 pwmpval=`echo ${pwmpval} | cut -d' ' -f1` 294 294 fi 295 295 296 296 # If fanspeed-sensor output shall be used, do it 297 297 if [[ -n ${fan} ]] … … 310 310 fanval=1 # set it to a non zero value, so the rest of the script still works 311 311 fi 312 312 313 313 # debug info 314 314 if [ "$DEBUG" != "" ] … … 327 327 echo "fanval=$fanval" 328 328 fi 329 329 330 330 if (( $tval <= $mint )) 331 331 then pwmval=$minpwm # below min temp, use defined min pwm 332 332 elif (( $tval >= $maxt )) 333 333 then pwmval=$maxpwm # over max temp, use defined max pwm 334 else 334 else 335 335 # calculate the new value from temperature and settings 336 336 pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}" lm-sensors/trunk/prog/pwm/fancontrol.8
r4438 r5335 26 26 .SH CONFIGURATION 27 27 For easy configuration, there's a script 28 named \fBpwmconfig\fP(8) which lets you interactively write your 29 configuration file for \fBfancontrol\fP. Alternatively you can write this 28 named \fBpwmconfig\fP(8) which lets you interactively write your 29 configuration file for \fBfancontrol\fP. Alternatively you can write this 30 30 file yourself using the information from this manpage. 31 31 … … 105 105 .SH CONFORMING TO 106 106 lm_sensors-2.x 107 107 108 108 .SH SEE ALSO 109 109 pwmconfig(8), sensors(1). lm-sensors/trunk/prog/pwm/fancontrol.pl
r4588 r5335 128 128 129 129 if (!(-d $dir)) 130 { die("No sensors found! (are the necessary modules loaded?) : 130 { die("No sensors found! (are the necessary modules loaded?) : 131 131 $!\n"); } 132 132 else … … 163 163 1; 164 164 165 ################################################################ 165 ################################################################ 166 166 sub loadconfig($) 167 167 { … … 175 175 open(F, $file); 176 176 177 our ($interval, $fctemps, $fcfans, $mintemp, $maxtemp, $minstart, 177 our ($interval, $fctemps, $fcfans, $mintemp, $maxtemp, $minstart, 178 178 $minstop); 179 179 while($_ = <F>) … … 220 220 221 221 222 ################################################################ 222 ################################################################ 223 223 sub pwmdisable($) 224 224 { … … 261 261 262 262 263 ################################################################# 263 ################################################################# 264 264 sub pwmenable($) 265 265 { … … 294 294 295 295 296 ################################################################ 296 ################################################################ 297 297 sub restorefans() 298 298 { … … 316 316 317 317 318 ############################################################ 318 ############################################################ 319 319 sub UpdateFanSpeeds() 320 320 { lm-sensors/trunk/prog/pwm/pwmconfig
r5319 r5335 56 56 echo $0: 'No sensors found! (modprobe sensor modules?)' 57 57 exit 1 58 fi 58 fi 59 59 fi 60 60 … … 316 316 if [ "$X" = "y" -o "$X" = "Y" -o "$X" = "" ] 317 317 then 318 PLOT=y 318 PLOT=y 319 319 fi 320 320 fi … … 337 337 while [ $pwm -ge 0 ] 338 338 do 339 pwmset $P $pwm 339 pwmset $P $pwm 340 340 sleep $PDELAY 341 341 if [ $? -ne 0 ] 342 342 then 343 pwmdisable $P 343 pwmdisable $P 344 344 echo '^C received, aborting...' 345 345 rm -f $TMP1 $TMP2 346 346 exit 1 347 fi 347 fi 348 348 # this will return the first field if there's only one (sysfs) 349 349 S=`cat $F | cut -d' ' -f2` … … 355 355 if [ "$S" = "0" -o "$S" = "-1" ] 356 356 then 357 pwmdisable $P 357 pwmdisable $P 358 358 echo " Fan Stopped at PWM = $pwm" 359 359 if [ $pwm -eq $MAX ] … … 376 376 fi 377 377 done 378 pwmdisable $P 378 pwmdisable $P 379 379 if [ "$PLOT" = "y" ] 380 380 then … … 401 401 echo '^C received, restoring PWM and aborting...' 402 402 exit 1 403 fi 403 fi 404 404 let pwmactivecount=0 405 405 let count=1 … … 432 432 echo '^C received, aborting...' 433 433 exit 1 434 fi 434 fi 435 435 # this will return the first field if there's only one (sysfs) 436 436 S=`cat $j | cut -d' ' -f2` … … 587 587 588 588 function TestMinStop { 589 echo590 echo 'Now we decrease the PWM value in 10-unit-steps.'589 echo 590 echo 'Now we decrease the PWM value in 10-unit-steps.' 591 591 echo 'Let the fan reach full speed, then press return until the' 592 592 echo "fan stops spinning. Then enter 'y'." 593 593 echo 'We will use this value +20 as the minimum speed.' 594 let fanok=0595 let fanval=$MAX594 let fanok=0 595 let fanval=$MAX 596 596 597 597 pwmenable $pwms 598 until [ "$fanok" = "1" ]599 do600 let fanval=fanval-10598 until [ "$fanok" = "1" ] 599 do 600 let fanval=fanval-10 601 601 if [ $fanval -lt 0 ] ; then let fanval=0 ; let fanok=1 ; fi 602 echo -n "Setting $pwms to $fanval..."602 echo -n "Setting $pwms to $fanval..." 603 603 pwmset $pwms $fanval 604 read FANTEST604 read FANTEST 605 605 if [ "$FANTEST" != "" ] ; then let fanok=1 ; fi 606 done606 done 607 607 pwmdisable $pwms 608 608 609 let fanval=fanval+20610 if [ $fanval -gt $MAX ] ; then let fanval=$MAX ; fi611 echo "OK, using $fanval"609 let fanval=fanval+20 610 if [ $fanval -gt $MAX ] ; then let fanval=$MAX ; fi 611 echo "OK, using $fanval" 612 612 } 613 613 … … 696 696 if [ "$tempss" = "None (Do not affect this PWM output)" ] 697 697 then 698 698 699 699 break; 700 700 else … … 731 731 then 732 732 MAXTEMP="${pwms}=${XMT}" 733 else733 else 734 734 MAXTEMP="`echo $MAXTEMP | sed -e \"s/${pwmsed}[^ ]* *//g\"` ${pwms}=${XMT}" 735 735 fi … … 801 801 break; 802 802 done ;; 803 803 804 804 *) 805 805 grep $pwm lm-sensors/trunk/prog/pwm/pwmconfig.8
r2873 r5335 15 15 It attempts to briefly stop each fan using the PWM controls. It then 16 16 attempts to restore each fan to full speed after testing. However, it 17 is \fBvery important\fP that you physically verify that the fans have 17 is \fBvery important\fP that you physically verify that the fans have 18 18 been returned to full speed after the program has completed. 19 19 20 20 .SH WARNING 21 21 This program will stop your fans, one at a time, for approximately 5 seconds each. 22 This may cause your processor temperature to rise. Verify that all fans are running 22 This may cause your processor temperature to rise. Verify that all fans are running 23 23 at normal speed after this program has exited. 24 24
