Orbi WiFi 7 RBE973
Reply

Re: How to control fanspeed on a RN104

uuiese
Tutor

Re: How to control fanspeed on a RN104

Thank 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
Message 26 of 91
toolman1
Aspirant

Re: How to control fanspeed on a RN104

More 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.
Message 27 of 91
toolman1
Aspirant

Re: How to control fanspeed on a RN104

I 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.
Message 28 of 91
analog1
Aspirant

Re: How to control fanspeed on a RN104

Thanks 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.
Message 29 of 91
analog1
Aspirant

Re: How to control fanspeed on a RN104

Temps 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 😎
Message 30 of 91
jameso1
Aspirant

Re: How to control fanspeed on a RN104

Great 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:
Message 31 of 91
AndreasKa
Tutor

Re: How to control fanspeed on a RN104

Hi all,

I recently setup my new 314 and attempted to use this script but it doesn't seem to be working. The fan stays 730-780 rpm with temps as follows:

Fan - 750RPM
CPU - 53
system - 39
Disk 1 - 43
Disk 2 - 41
Disk 3 - 45
Disk 4 - 48

This is without any activity at all, just the disks spinning, not in a volume.

I'm wondering if anyone has implemented this successfully on a 314 because i'm not getting any errors and the service seems to be starting.
I've also tried changing the min and max temp to 40 and 60 respectively but still no change.

any help much appreciated
Message 32 of 91
AndreasKa
Tutor

Re: How to control fanspeed on a RN104

Hi All,

Not sure if anyone is interested but I had a look at the logs for this from my 314 and it's now obvious to me why it's not working but not so obvious as to the fix. If anyone is interested in getting more info, reply to the thread.

Automatically controlling fan speed...
cat: /sys/devices/platform/mv64xxx_i2c.0/i2c-0/0-003e/pwm1: No such file or directory
cat: /sys/devices/platform/mv64xxx_i2c.0/i2c-0/0-003e/fan1_input: No such file or directory
cat: /sys/devices/platform/axp-temp.0/temp1_input: No such file or directory
Temp: C FAN: 50% [ RPM] []
expr: syntax error
expr: syntax error
expr: syntax error
/root/fanoveride: line 21: [: -lt: unary operator expected
/root/fanoveride: line 24: [: -gt: unary operator expected
expr: syntax error
expr: syntax error
Message 33 of 91
hawke84
Tutor

Re: How to control fanspeed on a RN104

how possible is it to build this into an app with GUI?
Message 34 of 91
AndreasKa
Tutor

Re: How to control fanspeed on a RN104

I don't know what permissions you can run the ReadyNAS apps under, whether they would be sufficient for this sort of thing.
I'm a total linux newbie so I really don't know. I just got this to work through trial and error and my limited programming knowledge.
Message 35 of 91
ARay
Aspirant

Re: How to control fanspeed on a RN104

I've been going around on the second script, and can't quite get this working. If I see this, what am I doing wrong now..?

insserv: Script fanoveride is broken: incomplete LSB comment.
insserv: missing `Provides:' entry: please add.
insserv: missing `Required-Start:' entry: please add even if empty.
insserv: missing `Required-Stop:' entry: please add even if empty.
insserv: missing `Default-Start:' entry: please add even if empty.
insserv: missing `Default-Stop:' entry: please add even if empty.
insserv: warning: script 'leafp2p' missing LSB tags and overrides
Message 36 of 91
ARay
Aspirant

Re: How to control fanspeed on a RN104

I figured out that when I copied the script into notepad++ or vi, it was giving extra spaces at the beginning of each line. After I took those out, I now get no errors, and it says the service is started, but fan still shows as hanging out at 800 RPM. Any suggestions on where to look when it looks like it should be "on"?

I had been on 6.3.3-T153 beta, so I went back to 6.2.2 to see if the beta was an issue and that put my fan speeds in the 680s range...
Message 37 of 91
tiff_lee
Tutor

Re: How to control fanspeed on a RN104

Hi all hopefully someone can help me out here, trying to use this guide in order to get some 'better' fan control on my RN104 but struggling a little bit, SSH and linux commands are all new to me.

Created the two files as per the first post (using notepad++ but what file format am I supposed to save them in, .sh? or are they not meant to have a file extension at all) and put them in the appropriate location using Bitvise SFTP.

Once i've changed the properties value to 755 and run the "update-rc.d fanoveride defaults" I receive an error "insserv: warning: script 'leafp2p' missing LSB tags and overrides" ?

I appear to be missing something here and it will probably be obvious to the more experienced people out there, pointers appreciated.

Lee
Message 38 of 91
booboo59
Apprentice

Re: How to control fanspeed on a RN104

Thank you note to the OP, the scripts work well on my RN104. Only change would be that the +755 needs to be just 755. Other than that, the instructions are spot on!
Message 39 of 91
tiff_lee
Tutor

Re: How to control fanspeed on a RN104

No one can explain this error?

root@Lee-NAS:/etc/init.d# chmod 755 /etc/init.d/fanoveride
root@Lee-NAS:/etc/init.d# update-rc.d fanoveride defaults
update-rc.d: using dependency based boot sequencing
insserv: warning: script 'leafp2p' missing LSB tags and overrides
Message 40 of 91
corinbishop
Guide

Re: How to control fanspeed on a RN104

Thanks for this! I got this running in less than 2 minutes and my cpu is down to 50 and the disk to 39 (deg c). Not sure if the startup option is working and I've heard a few reports that it's not but to be honest I'm running this machine all the time... thanks again
Message 41 of 91
mdgm-ntgr
NETGEAR Employee Retired

Re: How to control fanspeed on a RN104

Would be better to start it using systemctl rather than using update-rc.d
Message 42 of 91
tiff_lee
Tutor

Re: How to control fanspeed on a RN104

Still can't get it to work with neither command surely there is a guru out there who can help
Message 43 of 91
yajdam
Aspirant

Re: How to control fanspeed on a RN104

Hi!
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!
Message 44 of 91
tiff_lee
Tutor

Re: How to control fanspeed on a RN104

Finally 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.
Message 45 of 91
mdgm-ntgr
NETGEAR Employee Retired

Re: How to control fanspeed on a RN104

With 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.
Message 46 of 91
tiff_lee
Tutor

Re: How to control fanspeed on a RN104

Yeah 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.
Message 47 of 91
darkone
Guide

Re: How to control fanspeed on a RN104

Thanks your scripts work like a champ 🙂 tested on RN104 and RN102

Message 48 of 91
Aguster
Initiate

Re: How to control fanspeed on a RN104

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 header

 

Also posted over here: https://community.netgear.com/t5/Using-your-ReadyNAS/LSB-issue-on-leafp2p/td-p/929396

Message 49 of 91
Aguster
Initiate

Re: How to control fanspeed on a RN104

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
    setFanSpeed

    sleep 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 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
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|uninstall}"
esac

-------------------------------------------------------------------------------------------------

Message 50 of 91
Top Contributors
Discussion stats
Announcements