NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
dishmagic66
Apr 26, 2014Guide
How to control fanspeed on a RN104
On special request, here is a workaround for controling the fanspeed of the RN104 ( most likely the same on a 102).
For this you will have to SSH in to the NAS.
Thanks to Moseleypj for doing the work.
First you create a file in /root with the name fanoveride. Put the following lines in to the file.
Now chmod 755 /root/fanoveride
===================
Now create a file in /etc/init.d with the name fanoveride.
Put the following lines in to this script
Now make sure it is executable and starts on boot:
To control it manually:
In my case i have the min and max temp in the script set to 35 and 75 degrees to create a nice fan response wich is not to nervous.
If you set it between 40 and 65 the regulating becomes more agressive.
Just play with the values for your needs.
For this you will have to SSH in to the NAS.
Thanks to Moseleypj for doing the work.
First you create a file in /root with the name fanoveride. Put the following lines in to the file.
#!/bin/bash
## Variables ##
FANPWMPATH=/sys/devices/platform/mv64xxx_i2c.0/i2c-0/0-003e/pwm1
FANSPEEDPATH=/sys/devices/platform/mv64xxx_i2c.0/i2c-0/0-003e/fan1_input
CORETEMPPATH=/sys/devices/platform/axp-temp.0/temp1_input
MAXFAN=100 # Maximum operable speed
MINFAN=0 # Minimum operable speed
MINPWM=75 # PWM Limit
MAXPWM=255 # PWM Limit
MINTEMP=35 # Min temp -> Fan slowest
MAXTEMP=75 # Max temp -> Fan fastest
NEWSPEED=50 # Initial fan speed (%)
## Functions ##
function getReadings {
FANPWM=$(cat $FANPWMPATH)
FANSPEED=$(cat $FANSPEEDPATH)
CORETEMP=$(cat $CORETEMPPATH)
}
function setFanSpeed {
if [ $NEWSPEED -lt $MINFAN ]; then
NEWSPEED=$MINFAN
fi
if [ $NEWSPEED -gt $MAXFAN ]; then
NEWSPEED=$MAXFAN
fi
NEWPWM=$(expr $MAXPWM - $MINPWM)
NEWPWM=$(expr $NEWPWM \* $NEWSPEED)
NEWPWM=$(expr $NEWPWM / 100)
NEWPWM=$(expr $NEWPWM + $MINPWM)
echo $NEWPWM > /sys/devices/platform/mv64xxx_i2c.0/i2c-0/0-003e/pwm1
}
function calcFanPercent {
TEMPRAN=$(expr $MAXTEMP - $MINTEMP)
TEMPREL=$(expr $CORETEMP - $MINTEMP)
TEMPREL=$(expr $TEMPREL \* 100)
TEMPPER=$(expr $TEMPREL / $TEMPRAN)
NEWSPEED=$TEMPPER
}
###################################################################
echo "Automatically controlling fan speed..."
while true
do
getReadings
echo "Temp: $CORETEMP C FAN: $NEWSPEED% [$FANSPEED RPM] [$FANPWM]"
calcFanPercent
setFanSpeed
sleep 10
done
###################################################################
Now chmod 755 /root/fanoveride
===================
Now create a file in /etc/init.d with the name fanoveride.
Put the following lines in to this script
#!/bin/sh
### BEGIN INIT INFO
# Provides: FanOveride
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: FanOveride overides the default ReadyNAS fan control
### END INIT INFO
SCRIPT=~/fanoveride
RUNAS=root
PIDFILE=/var/run/fanoveride.pid
LOGFILE=/var/log/fanoveride.log
start() {
if [ -f /var/run/$PIDNAME ] && kill -0 $(cat /var/run/$PIDNAME); then
echo 'Service already running' >&2
return 1
fi
echo 'Starting service.' >&2
local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
su -c "$CMD" $RUNAS > "$PIDFILE"
echo 'Service started' >&2
}
stop() {
if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then
echo 'Service not running' >&2
return 1
fi
echo 'Stopping service.' >&2
kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
echo 'Service stopped' >&2
}
uninstall() {
echo -n "Are you really sure you want to uninstall this service? That cannot be undone. [yes|No] "
local SURE
read SURE
if [ "$SURE" = "yes" ]; then
stop
rm -f "$PIDFILE"
echo "Notice: log file is not be removed: '$LOGFILE'" >&2
update-rc.d -f <NAME> remove
rm -fv "$0"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
uninstall)
uninstall
;;
retart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|uninstall}"
esac
Now make sure it is executable and starts on boot:
chmod +755 /etc/init.d/fanoveride
update-rc.d fanoveride defaults
To control it manually:
service fanoveride start
service fanoveride stop
In my case i have the min and max temp in the script set to 35 and 75 degrees to create a nice fan response wich is not to nervous.
If you set it between 40 and 65 the regulating becomes more agressive.
Just play with the values for your needs.
90 Replies
- gareth_iowcAspirant:P you sir are a legend! my fan speed would never jump above 800rpm before. cpu used to sit around 70oc and lost 2 drives due to heat.
installed your script and the fan is actually doing some work.
can't thank you enough - Just curious....
What is your environment temperature and at what are your new average values for disc temp, cpu temp and at what revs is the fan running now? - gareth_iowcAspirantI've set the range 35-65oc room temperature is around 17oc. Fan speed sits around 1300-1500 and I've seen a drop from 55oc on the drives to 37-39 and 70 to 50 on the cpu.
- saketbAspirantHi,
This is a great way to control the fan speed of the NAS 104 and to bring down the temps which is always high.
I would like to ask, whether does it effect the FAN in anyway, I mean is the FAN meant to run above the current spinning speeds. Or what is the maximum RPM the FAN can spin on RN104?
My fan spins at 700-850 RPM with CPU Temp @ 65-70 C & HDD's @ 45-50 C.
I have already exchanged (under warranty) my NAS in which the FAN was dead after 6 months of purchase. So, was worried if anything goes wrong.
Kindly reply to this as, I am very much eager to get the temps of cpu and hdd's down from those levels. - gareth_iowcAspirantThe fan is easily within it's limits. They are capable of doing high 4k rpm safely.
I very much recommend getting the drive temps down.
I also think net gear should rethink their thermal management - townsmcpAspirantHi all
Looking for a bit of help. I have an RN104 NAS, have created the 2 files listed in the first post, set them to 775, done the update-rc.d and when I try running fanoveride I get the following:
root@JTS104:~# service fanoveride start
env: /etc/init.d/fanoveride: No such file or directory
Any suggestions?
Thanks in advance - enter the full path:
/etc/init.d/fanoveride start - townsmcpAspirantThanks - just tried that and now getting:
root@JTS104:/etc/init.d# service /etc/init.d/fanoveride start
/etc/init.d/fanoveride: unrecognized service
root@JTS104:/etc/init.d#
I am running OS 6.1.8
Just to confirm, does it matter that I created the above files in Windows Notepad (win 7) and then SFTP the files in place (hehe and I did remove the .txt extension before copying over)?
Also, when I do the update-rc bit I see the following:root@JTS104:/etc/init.d# update-rc.d fanoveride defaults
update-rc.d: using dependency based boot sequencing
insserv: warning: script 'istat' missing LSB tags and overrides
That shouldnt be a problem should it?
thanks - Most likely that Notepad is the cause. You should use a Linux compatible editor, like ultraedit or something like that, or edit on the nas self using "vi"
Option 2:
I am not shure if dos2unix is present on the nas, if so then you can try: dos2unix fanoveride. Do this for both files. Or make new files :) - I agree that the mismatch between linux and windows end-of-line conventions is the likely cause.
notepad++ is a free PC download which also is compatible with linux (http://notepad-plus-plus.org/)
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!