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
Replies have been turned off for this discussion
- b_lightfootAspirantThis is a different way of dealing with the heat issue. Hope it helps.
I have just purchased a RN104 to upgrade from my older ReadyNAS NV+. I first set it up with four 2TB drives and have now one by one through the past week have upgraded it to four 4TB drives. At first I was dismayed to see that the drive temperatures were 45 to 50 C, and the processor was 65 to 70 C. The fan never spun up over 790 RPM. I checked on line and found that these were pretty much standard temperatures. I have a solution where even after 160+ continuous hours of thrashing to rebuild the array and reshape the data as each drive was replaced, my hard drives are running 32 to 35 C, and the processor runs at 43 to 45 C. Now, at idle, the drive temps are holding at 32~33C, and the processor is at 40~42C.
Here is my "fix": I got a 92mm double ball bearing 12VDC fan that moves 56CFM (70,000 hour MTBF which is what, 8 years?) and mounted it on the back of the case with some 3M indoor outdoor double stick foam mounting tape where the built in fan exhausts, and used an old 12VDC power brick from something long gone. No re-programing, no opening the case, no voiding of my warranty. Now I don't care what the built in fan is doing. Many will say this is an inelegant fix, and it may well be, but for $6.0 7 U.S.D. list price for the fan, I will call it a simple solution. My ReadyNAS is set in an area where the noise of this fan doesn't bother me at all. I use it as my whole home media server, streaming mp4 video and mp3 music to 5 or 6 different places throughout the house, which really isn't a strain on the unit. I think the temperatures I have achieved speak for themselves. I hope this helps other people out there who, like me, think that heat is the enemy and leads to hardware failure sooner rather than later! - StephenBGuru - Experienced Userb_lightfoot - please only post once. There's no need to triple-post.
- drewtttAspirantDoes anybody know where to scrape the HDD temperatures from? I'd like to base the fan control on hard drive temperature rather than CPU temperature.
EDIT: Okay, getting it from smartctrl
I set MINTEMP=28 and MAXTEMP=36 for HDD temp limits. I changed CORETEMP in the getReadings function to : CORETEMP=$(/usr/sbin/smartctl -a /dev/sdb | grep Temper | awk '{print $10}')
sdb is my middle drive, so tends to be hottest. The rest of the loops in the code I left alone. This seems to be keeping my fan around 1500 RPM and HDD at 33 degrees. I don't run any CPU intensive stuff , so I figure this should be safe CPU-wise, since there should be a rise in HDD temp that would increase the fan to cool the CPU as well if anything is going on in there. - CWA_AUSAspiranthey Townsmcp it would be great if you could send me over your working scripts i've been trying for days to get these fan control scripts to work, it's driving me crazy :(
- uuieseTutorThank you dishmagic66 for your code!
Thank you drewttt for your extra line of code to help me to also control my fan on hard drive temperature!
Kind Regards,
uuiese - toolman1AspirantMore thanks to dishmagic66 and Moseleypj!
The fan on my 102 would spin at 750-800rpm regardless of temperature. HD temps have dropped from 44C to 38C and cpu temp from 68C to 54C under load. - toolman1AspirantI also wanted to add that the fan control seems much better in 6.2 beta... it now spins at a much more reasonable speed without using fanoveride.
- analog1AspirantThanks for great info. Just added fanoveride and temps are better now. Fanspeed is around 1500 rpm during rebuild. CPU temp 50 C and drives around 40 C. Temps were before CPU 65 - 70 C and drives near 50 C and fanspped around 800 rpm.
It would make sense for Netgear to add these fan profile adjustments in to readycloud GUI, so that users could select suitable profile for their use based on environment temperature and other factors. - analog1AspirantTemps are getting even lower after rebuild, Disk 1: 38 C, Disk 2: 37 C, Disk 3: 35 C. CPU 50 C. Fan is spinning 1068 RPM. This tip is really great, thanks for initial poster 8)
- jameso1AspirantGreat script and many thanks to the original coder. Works like a charm and has significantly reduced HDD/CPU temperatures to an acceptable level. And I totally agree with analog for the implementation of fan control into the web interface. Perhaps this feature may appear sometime in future firmware? (looking around the room at Netgears' devs). :wink:
Related Content
NETGEAR Academy

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