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
- saketbAspirantAs per the details given here I created the files at their respective places. The update was successful and the FAN speed increased from 800 to 990, temperature reduced marginally by just 2 deg C.
But when I manually use the commands to stop and start the service by using the following command...
root@ReadyNAS_RN104:~# service /etc/init.d/fanoveride stop
I get an error...
/etc/init.d/fanoveride: unrecognized service
The files were created with Notepad++ as suggested by Stephen.
Request for help on this matter. - saketbAspirantFinally got the error rectified. It was due to an extra character in the file.
I have changed the MAXTEMP=65 instead 75, so that the FAN spins a bit faster.
Now, the issue is when I issue the command...
service fanoveride start
I get the message...
root@ReadyNAS_RN104:/etc/init.d# service fanoveride start
Starting service.
Service started
Everything looks fine, but the FAN speed is yet 990, the temps remain same and not decreasing.
Surprising thing is that when I issue a command...
service fanoveride stop
I get the message...
root@ReadyNAS_RN104:/etc/init.d# service fanoveride stop
/etc/init.d/fanoveride: 29: kill: No such process
Service not running
This says that the Service is not running...
Request some guidance here.
Current temps...
CPU: 67 degC
HDD: 48-51 degC
FAN RPM: 990 - townsmcpAspirantWoohoo - thanks guys - its now working for me :D
I tried Note++ and still got the same error message (saved the file as a *.* type) so went into Vi on a terminal (using the GateOne app) and as you guys said, the carriage return was being a problem - each line had ^M at the end so I deleted those and tried the steps again and all now working great - the fan spun up to 2500RPM within seconds using a max temp of 75. The service can be loaded and unloaded with no problems
Seriously thinking about changing max temp to 65 though (anyone have any thoughts on dropping the max temp that low?) - my NAS is tucked away in a room where the noise is of no bother to anyone - it now seems to be idling at the following rate:
Fan - 1241RPM
CPU - 53
Disk 1 - 37
Disk 2 - 39
Disk 3 - 40
Disk 4 - 37
(these are 2Tb WD Red drives)
Saketb - if you want I can email you over the 2 files that are working for me? That might help you
thanks all
Townsmcp - saketbAspirant
townsmcp wrote: Woohoo - thanks guys - its now working for me :D
I tried Note++ and still got the same error message (saved the file as a *.* type) so went into Vi on a terminal (using the GateOne app) and as you guys said, the carriage return was being a problem - each line had ^M at the end so I deleted those and tried the steps again and all now working great - the fan spun up to 2500RPM within seconds using a max temp of 75. The service can be loaded and unloaded with no problems
Seriously thinking about changing max temp to 65 though (anyone have any thoughts on dropping the max temp that low?) - my NAS is tucked away in a room where the noise is of no bother to anyone - it now seems to be idling at the following rate:
Fan - 1241RPM
CPU - 53
Disk 1 - 37
Disk 2 - 39
Disk 3 - 40
Disk 4 - 37
(these are 2Tb WD Red drives)
Saketb - if you want I can email you over the 2 files that are working for me? That might help you
thanks all
Townsmcp
Its great to hear that its working for you and that the temps have come down considerably.
Mine, seems to not work and temps have risen to 70+ on the CPU. The service does not work.
Request you to email me the files so that I can copy them to the respective folders and start the service. (sent you a PM with my email)
One thing, I would like to ask... the files I created was with notepad++ and then deleted the ^M and saved them again in Vi.
When listed with ls -l it shows...
-rwxr-xr-x+ 1 guest guest 1799 May 31 19:20 fanoveride (root folder)
-rwxr-xr-x+ 1 guest guest 1317 May 31 20:02 fanoveride (/etc/init.d folder)
Are these correct? Is the guest guest correct? Is this why it is not running?
Request you to help me here, as I'm really worried about the temps and the device.
Thanks. - townsmcpAspirant
saketb wrote: townsmcp wrote: Woohoo - thanks guys - its now working for me :D
I tried Note++ and still got the same error message (saved the file as a *.* type) so went into Vi on a terminal (using the GateOne app) and as you guys said, the carriage return was being a problem - each line had ^M at the end so I deleted those and tried the steps again and all now working great - the fan spun up to 2500RPM within seconds using a max temp of 75. The service can be loaded and unloaded with no problems
Seriously thinking about changing max temp to 65 though (anyone have any thoughts on dropping the max temp that low?) - my NAS is tucked away in a room where the noise is of no bother to anyone - it now seems to be idling at the following rate:
Fan - 1241RPM
CPU - 53
Disk 1 - 37
Disk 2 - 39
Disk 3 - 40
Disk 4 - 37
(these are 2Tb WD Red drives)
Saketb - if you want I can email you over the 2 files that are working for me? That might help you
thanks all
Townsmcp
Its great to hear that its working for you and that the temps have come down considerably.
Mine, seems to not work and temps have risen to 70+ on the CPU. The service does not work.
Request you to email me the files so that I can copy them to the respective folders and start the service. (sent you a PM with my email)
One thing, I would like to ask... the files I created was with notepad++ and then deleted the ^M and saved them again in Vi.
When listed with ls -l it shows...
-rwxr-xr-x+ 1 guest guest 1799 May 31 19:20 fanoveride (root folder)
-rwxr-xr-x+ 1 guest guest 1317 May 31 20:02 fanoveride (/etc/init.d folder)
Are these correct? Is the guest guest correct? Is this why it is not running?
Request you to help me here, as I'm really worried about the temps and the device.
Thanks.
Will send the files in a few minutes.
That guest guest thing is probably the issue. My files are there by root root. I would suggest the following:
1. Install Bitvise SSH Client (from http://www.bitvise.com/download-area).
2. Load SSH Client and log into the NAS with the Root account (using root as the username and your NAS password as the password)
3. Drag and drop the files I send you to correct directories.
4. Right click the files and change permissions to 755
5. Run the update-rc.d fanoveride defaults command
6. Start the service
7. Check the admin page to see if the page has changed speed
8. Try stopping the service to make sure it unloads ok (remember to restart it too though ;) )
Let us know if that works for you.
Townsmcp - saketbAspirant
townsmcp wrote: saketb wrote: townsmcp wrote: Woohoo - thanks guys - its now working for me :D
I tried Note++ and still got the same error message (saved the file as a *.* type) so went into Vi on a terminal (using the GateOne app) and as you guys said, the carriage return was being a problem - each line had ^M at the end so I deleted those and tried the steps again and all now working great - the fan spun up to 2500RPM within seconds using a max temp of 75. The service can be loaded and unloaded with no problems
Seriously thinking about changing max temp to 65 though (anyone have any thoughts on dropping the max temp that low?) - my NAS is tucked away in a room where the noise is of no bother to anyone - it now seems to be idling at the following rate:
Fan - 1241RPM
CPU - 53
Disk 1 - 37
Disk 2 - 39
Disk 3 - 40
Disk 4 - 37
(these are 2Tb WD Red drives)
Saketb - if you want I can email you over the 2 files that are working for me? That might help you
thanks all
Townsmcp
Its great to hear that its working for you and that the temps have come down considerably.
Mine, seems to not work and temps have risen to 70+ on the CPU. The service does not work.
Request you to email me the files so that I can copy them to the respective folders and start the service. (sent you a PM with my email)
One thing, I would like to ask... the files I created was with notepad++ and then deleted the ^M and saved them again in Vi.
When listed with ls -l it shows...
-rwxr-xr-x+ 1 guest guest 1799 May 31 19:20 fanoveride (root folder)
-rwxr-xr-x+ 1 guest guest 1317 May 31 20:02 fanoveride (/etc/init.d folder)
Are these correct? Is the guest guest correct? Is this why it is not running?
Request you to help me here, as I'm really worried about the temps and the device.
Thanks.
Will send the files in a few minutes.
That guest guest thing is probably the issue. My files are there by root root. I would suggest the following:
1. Install Bitvise SSH Client (from http://www.bitvise.com/download-area).
2. Load SSH Client and log into the NAS with the Root account (using root as the username and your NAS password as the password)
3. Drag and drop the files I send you to correct directories.
4. Right click the files and change permissions to 755
5. Run the update-rc.d fanoveride defaults command
6. Start the service
7. Check the admin page to see if the page has changed speed
8. Try stopping the service to make sure it unloads ok (remember to restart it too though ;) )
Let us know if that works for you.
Townsmcp
Thanks a million. Finally, got it working.
Used Putty for ssh access and transferred the files. Changed the MAXTEMP to 65 and now the temps have come down drastically.
FAN RPM 1706
CPU 53-56C
HDD1 42C
HDD2 43C
HDD3 41C
Though, the files yet show guest, guest. Thats surprising....
Thanks again for the help. - townsmcpAspirant
saketb wrote: townsmcp wrote: saketb wrote: townsmcp wrote: Woohoo - thanks guys - its now working for me :D
I tried Note++ and still got the same error message (saved the file as a *.* type) so went into Vi on a terminal (using the GateOne app) and as you guys said, the carriage return was being a problem - each line had ^M at the end so I deleted those and tried the steps again and all now working great - the fan spun up to 2500RPM within seconds using a max temp of 75. The service can be loaded and unloaded with no problems
Seriously thinking about changing max temp to 65 though (anyone have any thoughts on dropping the max temp that low?) - my NAS is tucked away in a room where the noise is of no bother to anyone - it now seems to be idling at the following rate:
Fan - 1241RPM
CPU - 53
Disk 1 - 37
Disk 2 - 39
Disk 3 - 40
Disk 4 - 37
(these are 2Tb WD Red drives)
Saketb - if you want I can email you over the 2 files that are working for me? That might help you
thanks all
Townsmcp
Its great to hear that its working for you and that the temps have come down considerably.
Mine, seems to not work and temps have risen to 70+ on the CPU. The service does not work.
Request you to email me the files so that I can copy them to the respective folders and start the service. (sent you a PM with my email)
One thing, I would like to ask... the files I created was with notepad++ and then deleted the ^M and saved them again in Vi.
When listed with ls -l it shows...
-rwxr-xr-x+ 1 guest guest 1799 May 31 19:20 fanoveride (root folder)
-rwxr-xr-x+ 1 guest guest 1317 May 31 20:02 fanoveride (/etc/init.d folder)
Are these correct? Is the guest guest correct? Is this why it is not running?
Request you to help me here, as I'm really worried about the temps and the device.
Thanks.
Will send the files in a few minutes.
That guest guest thing is probably the issue. My files are there by root root. I would suggest the following:
1. Install Bitvise SSH Client (from http://www.bitvise.com/download-area).
2. Load SSH Client and log into the NAS with the Root account (using root as the username and your NAS password as the password)
3. Drag and drop the files I send you to correct directories.
4. Right click the files and change permissions to 755
5. Run the update-rc.d fanoveride defaults command
6. Start the service
7. Check the admin page to see if the page has changed speed
8. Try stopping the service to make sure it unloads ok (remember to restart it too though ;) )
Let us know if that works for you.
Townsmcp
Thanks a million. Finally, got it working.
Used Putty for ssh access and transferred the files. Changed the MAXTEMP to 65 and now the temps have come down drastically.
FAN RPM 1706
CPU 53-56C
HDD1 42C
HDD2 43C
HDD3 41C
Though, the files yet show guest, guest. Thats surprising....
Thanks again for the help.
Your welcome
Wow - thats great that it worked. I thought the guest guest permissions would have done it but oh well I changed the MAXTEMP to 70 in the end and now im seeing the following:
CPU: 50
Fan: 1365 RPM
Disk 1: 35
Disk 2: 36
Disk 3: 37
Disk 4: 34
Townsmcp - gareth_iowcAspirant
saketb wrote: townsmcp wrote: Woohoo - thanks guys - its now working for me :D
I tried Note++ and still got the same error message (saved the file as a *.* type) so went into Vi on a terminal (using the GateOne app) and as you guys said, the carriage return was being a problem - each line had ^M at the end so I deleted those and tried the steps again and all now working great - the fan spun up to 2500RPM within seconds using a max temp of 75. The service can be loaded and unloaded with no problems
Seriously thinking about changing max temp to 65 though (anyone have any thoughts on dropping the max temp that low?) - my NAS is tucked away in a room where the noise is of no bother to anyone - it now seems to be idling at the following rate:
Fan - 1241RPM
CPU - 53
Disk 1 - 37
Disk 2 - 39
Disk 3 - 40
Disk 4 - 37
(these are 2Tb WD Red drives)
Saketb - if you want I can email you over the 2 files that are working for me? That might help you
thanks all
Townsmcp
Its great to hear that its working for you and that the temps have come down considerably.
Mine, seems to not work and temps have risen to 70+ on the CPU. The service does not work.
Request you to email me the files so that I can copy them to the respective folders and start the service. (sent you a PM with my email)
One thing, I would like to ask... the files I created was with notepad++ and then deleted the ^M and saved them again in Vi.
When listed with ls -l it shows...
-rwxr-xr-x+ 1 guest guest 1799 May 31 19:20 fanoveride (root folder)
-rwxr-xr-x+ 1 guest guest 1317 May 31 20:02 fanoveride (/etc/init.d folder)
Are these correct? Is the guest guest correct? Is this why it is not running?
Request you to help me here, as I'm really worried about the temps and the device.
Thanks.
apt-get install nano
create the files on the nas in terminal. thats how i did it and it worked fine. - uuieseTutorThank you for this great scripts :D
- Could this script be used on a RN314?
Related Content
NETGEAR Academy

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