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
- mdgm-ntgrNETGEAR Employee RetiredWould be better to start it using systemctl rather than using update-rc.d
- tiff_leeTutorStill can't get it to work with neither command surely there is a guru out there who can help
- yajdamAspirantHi!
Can someone help me to change the scripts found on the first post of this thread to work on a RN204?
I've used find / | grep to locate "pwm1", "fan1_input" and "temp1_input".
I found them and changed the "FANPWMPATH", "FANSPEEDPATH", "CORETEMPPATH" and "$NEWPWM" to the new locations, but no joy. :(
The service starts, is running but there is no change in the fan speed, even with a lower "MAXTEMP".
Can anyone help me?
Thanks for everything! - tiff_leeTutorFinally cracked it! after some googling I found out how to create the files directly via the terminal window rather than using notepad++ and copying them over via STFP, it seems copying the code into notepad++ was causing some unknown errors.
- mdgm-ntgrNETGEAR Employee RetiredWith notepad++ you do need to be using the correct formatting options for copy and paste into that to work well or to open a script that is already formatted correctly.
- tiff_leeTutorYeah that was the problem, I'm not familiar with it at all so kind of stumbled my way through but at least I got there in the end and was a bit of a learning experience.
- darkoneGuide
Thanks your scripts work like a champ :) tested on RN104 and RN102
- AgusterInitiate
Followed the instructions to a T. Installed fine, with only one error shown below.
With the exception of changing "retart" to "restart" and no "+" in "chmod +755 /etc/init.d/fanoveride". Service starts but no change in fan speed. Anyone else having this issue on 6.2.x (i'm running 6.2.4).
Oh, I actually did get one error on: "update-rc.d fanoveride defaults"
LSB issue on leafp2p. Change /etc/init.d/leafp2p
insserv: warning: script 'leafp2p' missing LSB tags and overrides
insserv: There is a loop between service logitechmediaserver and leafp2p if stopped
insserv: loop involving service leafp2p at depth 2
insserv: loop involving service logitechmediaserver at depth 1
insserv: Stopping leafp2p depends on logitechmediaserver and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script headerAlso posted over here: https://community.netgear.com/t5/Using-your-ReadyNAS/LSB-issue-on-leafp2p/td-p/929396
- AgusterInitiate
Got it to work on 6.2.5. There are a few changes that are required. Directory names have changed since the first version of script was created for 6.1.x
For /root/fanoveride:
Change the variable fan speed values as you see fit. The ReadyNAS104 that I am working with is in a Law Office, under a desk so it has a tendency to get warm. I was seeing CPU temps up to 170 and drives at 120. Way to hot for my liking. With this, I now see drives are 96 and the CPU at 130 or lower.
Highly recommend you use Nano for file creation- run this command: "apt-get install nano" As many others have stated, do not copy and paste from notepad.
/root/fanoveride:
-------------------------------------------------------------------------------------------------
#!/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=60 # Max temp -> Fan fastest
NEWSPEED=65 # 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
setFanSpeedsleep 10
done
###################################################################-----------------------------------------------------------------------------------------------------------
For /etc/init.d/fanoveride
-----------------------------------------------------------------------------------------------------------
#!/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 INFOSCRIPT=~/fanoveride
RUNAS=rootPIDFILE=/var/run/fanoveride.pid
LOGFILE=/var/log/fanoveride.logstart() {
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
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|uninstall}"
esac-------------------------------------------------------------------------------------------------
- Ektoplasm63Aspirant
Many thanks for those who done that script !!!
My RN104 goes significally colder !!!
Before :
HDD1 : 48°C
HDD2 : 51°C
HDD3 : 50°C
HDD4 : 47°C
CPU : 75°C !!!
FAN : 750-800 RPM (Not going beyond that !!!)
Now :
HDD1 : 37°C
HDD2 : 40°C
HDD3 : 39°C
HDD4 : 36°C
CPU : 50°C -> I feel much better :D
FAN : 1350RPM
I don't understand why Netgear won't build this in firmware ... The default temperatures are too Hot !!!
Aguster there is a little error in your last script :
case "$1" in start) start ;; stop) stop ;; -> missing -> One empty line excess uninstall) uninstall ;; restart) stop start ;; *) echo "Usage: $0 {start|stop|restart|uninstall}" esac
For my part, I migrated for Qnap, they are more professional ...
- LPCStar
Hello,
Im a longtime NAS user but from Synology, and i have allways liked the fan profiles and performance that was on the cooling part of the NAS.
I have installed yesterday a new NAS from NETGear to replace my aging NAS.I have purchase a 4 bay ReadyNAS 104. Great feel, and sturdy creation from Netgear... Feels very solid and way more solid then Synology all plastic approach.
My question, is why there is no FAN adjustment on the NAS OS? i see from the files here, that the fan can be controlled.
and BTW there should be (on top for exemple), an allways viewed Fan speed (and adjust), and cpu + hdd´s temps...
This should be like the DSM widgets system...
I hope NETGEAR sees this and do this addon to their OS. I would like to free adjust the power of the fan from 500 to 1300 rpms for exemple. Or adjust under load and stop at light load, etc...
Another thing to consider... why not a 120mm instead of a 92mm fan? There was space on the back... price wise is might be the same price the fans...
Thanks in advance and i hope to see these changes on an upcoming version of the OS...
Best Regards,
Lord Paulus Cobris
- SmokeyAAspirant
I Wrote my own simpler way
#!/bin/bash
string=$(sensors *-isa-* | grep T-junction | rev | cut -c 67- | rev | cut -c 16-)
timestamp() {
date +"%Y-%m-%d_%H-%M-%S"
}
( echo "temp was ${string} at $(timestamp)" ; ) >> ~/tempmon.txt
if [ $((${string})) -gt 65 ]; then
echo "210" > /sys/class/hwmon/hwmon1/device/pwm1
else
if [ $((${string})) -lt 50 ]; then
echo "150" > /sys/class/hwmon/hwmon1/device/pwm1
else
echo "170" > /sys/class/hwmon/hwmon1/device/pwm1
fi
fi
Then I just edited a system cron job to include running this every 30 minutes,
/etc/cron.d/frontview-volumeschedule
and added
2,32 * * * * root script/location/name.sh 5 &> /dev/null
It also writes to a log file so you can see how it's performing.
the last few entries read
tail tempmon.txt temp was 56 at 2015-09-28_08-32-01 temp was 56 at 2015-09-28_09-02-01 temp was 55 at 2015-09-28_09-32-01 temp was 56 at 2015-09-28_10-02-02 temp was 55 at 2015-09-28_10-32-01 temp was 56 at 2015-09-28_11-02-01 temp was 56 at 2015-09-28_11-32-01 temp was 57 at 2015-09-28_12-02-02 temp was 57 at 2015-09-28_12-32-02 temp was 56 at 2015-09-28_13-02-02
So the sripts doing its Job and it doesn't need to run as a service as cron takes care of it.
- LPCStar
Hello!
Thanks for your information...
My question here is... why this is not implemented on the OS??
There is some room for improvement of the ReadyNAS OS...I hope netgear get his stuff right...
I did like the ReadyNAS 104, but the OS is behing his competition... Im now using a QNAP, and while QTS is no DSM from Synology, its still ahead of ReadyNAS OS.
For me the best OS experience i had on NAS is from DSM, it really looks and feels great... But the plastic feel of the Synology Casing, the premium that we have to pay for a less powerfull product is a detracting issue.
As a costumer, i see here space for NETGEAR to attack... The units are solid and heavy duty build, that i like very much, the LCD screen is a plus too, but the OS really needs a complete overhault... New Interface, better apps (Cloud SYNC is really needed), the antivirus APP is a joke...
This is my 2 cent... Better your software and i will return to NETGEAR...Best Regards,
LPC
Related Content
NETGEAR Academy

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