DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#51 2007-06-07 03:35:36

DNS-323 Talker
Member
Registered: 2007-05-21
Posts: 245

Re: Fan does run all the time :-(

Thanks...so you can enter celcius values using the "c2f" function, or simply enter:

T1=100

If I wanted T1 to be 100 degrees farenheit?


DNS-323 w/two Seagate 500 GB RAID1
Fonz's Fun_Plug- Don't DNS-323 without it!

Offline

 

#52 2007-06-07 10:10:01

vthinsel
Member
Registered: 2007-05-24
Posts: 41

Re: Fan does run all the time :-(

Yes, you are correct.

BTW, my script was using 'expr' from the busybox on the HD, preventing it from standby. I updated the PATH in the script, and now they are able to sleep.
I'll post my updated script, once I improve it.

Vincent.

Offline

 

#53 2007-06-10 11:06:43

ultrabrutal
Member
Registered: 2007-06-10
Posts: 22

Re: Fan does run all the time :-(

vthinsel, maybe you can help me. I'm getting errors when running the script. I did the fonz's fun plug and uploaded the script via ftp after having set chmod to 777 on start folder. Here are the errors returned (06.06 version):

/mnt/HD_a2/fun_plug.d/start # sh myfan.sh
: not foundine 1:
expr: syntax error

: not foundine 5: }
: not foundine 6:
expr: syntax error

: not foundine 10: }
: not foundine 11:
myfan.sh: kill: line 13: Illegal number:
: not foundine 14:
: not foundine 15:
: not foundine 17: {
: not foundine 17:
: not foundine 18: {
: not foundine 19:
: not foundine 20:
: not foundine 21:
: not foundine 23:
myfan.sh: line 67: syntax error: word unexpected (expecting "fi")


I hope you can figure it out. tnx

Offline

 

#54 2007-06-10 22:04:09

vthinsel
Member
Registered: 2007-05-24
Posts: 41

Re: Fan does run all the time :-(

Hi !

Well, I don't really see why you get those errors....
Have you transferred the file using FTP in ASCII mode ?

I attach my latest running version, just in case it can help.

Offline

 

#55 2007-06-10 22:27:54

ultrabrutal
Member
Registered: 2007-06-10
Posts: 22

Re: Fan does run all the time :-(

From FlashFXP (binary mode it appears):
[R] TYPE I
[R] 200 Type set to I.
[R] PASV
[R] 227 Entering Passive Mode (192,168,0,2,37,22)
[R] Opening data connection IP: 192.168.0.2 PORT: 9494
[R] STOR myfan.sh
[R] 150 Opening BINARY mode data connection for myfan.sh.
[R] 226 Transfer complete.
Transferred: myfan.sh 3 KB in 0,13 seconds (26,3 KB/s)

New version gives another output (less errors it appears):

/mnt/HD_a2/fun_plug.d/start # sh myfan.sh
: not foundine 2:
: not foundine 4:
expr: syntax error

: not foundine 8: }
: not foundine 9:
expr: syntax error

: not foundine 13: }
: not foundine 14:
: not foundine 17:
myfan.sh: line 21: syntax error: "fi" unexpected (expecting "then")

Btw, running latest 1.03 firmware

Hope someone has a clue. Tnx wink

Offline

 

#56 2007-06-10 23:00:14

vthinsel
Member
Registered: 2007-05-24
Posts: 41

Re: Fan does run all the time :-(

switch to ASCII, and it should be OK.

Offline

 

#57 2007-06-10 23:12:45

leper
Member
From: sweden
Registered: 2007-05-17
Posts: 25
Website

Re: Fan does run all the time :-(

ultrabrutal wrote:

From FlashFXP (binary mode it appears):
[R] TYPE I
[R] 200 Type set to I.
[R] PASV
[R] 227 Entering Passive Mode (192,168,0,2,37,22)
[R] Opening data connection IP: 192.168.0.2 PORT: 9494
[R] STOR myfan.sh
[R] 150 Opening BINARY mode data connection for myfan.sh.
[R] 226 Transfer complete.
Transferred: myfan.sh 3 KB in 0,13 seconds (26,3 KB/s)

Hope someone has a clue. Tnx ;)

start flashfxp. under options -> preferences (can be reached via F6) -> transfer, make sure that 'transfer mode' is set to 'auto', or if it already is, switch it to ascii. i'm using an old version of flashfxp (2.0), so the exact path might vary.

Offline

 

#58 2007-06-11 00:32:05

ultrabrutal
Member
Registered: 2007-06-10
Posts: 22

Re: Fan does run all the time :-(

was at auto, but even when forced to ascii it still uses binary. tried turning passive mode off also but no luck. this is the lastest flashfxp version.  wtf

Offline

 

#59 2007-06-11 00:53:16

ultrabrutal
Member
Registered: 2007-06-10
Posts: 22

Re: Fan does run all the time :-(

ok I tried with the dos ftp command where I was more succesful:

ftp> put d:\myfan.sh
200 PORT command successful.
150 Opening ASCII mode data connection for myfan.sh.
226 Transfer complete.
ftp: 3371 bytes sent in 0,00Seconds 3371000,00Kbytes/sec.

(btw I had to chmod 777 on start folder to be able to upload or I got permission denied)

Now when I start the script manually I get no errors anymore. So when I reboot the DNS it should start per default?

I tried to locate the log file
(
LOGFILE=/tmp/fan.txt
STATFILE=/tmp/fan_stats.txt
)
but had no tmp folder?

fun_plug.log shows this:
...
start
start/dropbear.sh
start/inetd.sh
start/lighttpd.sh
start/rsyncd.sh
start/telnetd.sh
start/unfsd.sh
* Deleting /mnt/HD_a2/fun_plug.tar...
* /mnt/HD_a2/fun_plug.d/start/dropbear.sh not executable...
* /mnt/HD_a2/fun_plug.d/start/inetd.sh not executable...
* /mnt/HD_a2/fun_plug.d/start/lighttpd.sh not executable...
* /mnt/HD_a2/fun_plug.d/start/rsyncd.sh not executable...
* Running /mnt/HD_a2/fun_plug.d/start/telnetd.sh...
Starting telnetd...
* /mnt/HD_a2/fun_plug.d/start/unfsd.sh not executable...
* Done
**** fun_plug script for DNS-323 (2007.04.03 tp@fonz.de) ****
Sun Jun 10 23:51:33 GMT 2007
* /mnt/HD_a2/fun_plug.d/start/dropbear.sh not executable...
* /mnt/HD_a2/fun_plug.d/start/inetd.sh not executable...
* /mnt/HD_a2/fun_plug.d/start/lighttpd.sh not executable...
* Running /mnt/HD_a2/fun_plug.d/start/myfan.sh...

Does this mean it hangs/endless loops or what?

Tnx guys

Offline

 

#60 2007-06-11 01:30:02

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Fan does run all the time :-(

ultrabrutal wrote:

Does this mean it hangs/endless loops or what?

Yes, and that's what it's supposed to do. Move the fan script to another directory (e.g. fun_plug.d/bin/) and create in start/ a script that starts the fan script in the background.
See http://dns323.kood.org/forum/p3037-2007 … html#p3037

Offline

 

#61 2007-06-11 01:52:04

DNS-323 Talker
Member
Registered: 2007-05-21
Posts: 245

Re: Fan does run all the time :-(

Has anyone verified that important things like shut-down at high temp works w/this modified script?


DNS-323 w/two Seagate 500 GB RAID1
Fonz's Fun_Plug- Don't DNS-323 without it!

Offline

 

#62 2007-06-11 10:27:59

vthinsel
Member
Registered: 2007-05-24
Posts: 41

Re: Fan does run all the time :-(

fonz wrote:

ultrabrutal wrote:

Does this mean it hangs/endless loops or what?

Yes, and that's what it's supposed to do. Move the fan script to another directory (e.g. fun_plug.d/bin/) and create in start/ a script that starts the fan script in the background.
See http://dns323.kood.org/forum/p3037-2007 … html#p3037

Hi !

In fact, I start the script using fun_plug script.
If you chmod +x the sript, it should start automatically.

You ar right, I should put it somewhere else like ../bin/ but I'm lazy at times.

regarding shutdown at high temps, no, I haven't tried.

V.

Offline

 

#63 2007-06-11 20:51:39

ultrabrutal
Member
Registered: 2007-06-10
Posts: 22

Re: Fan does run all the time :-(

guys, thanks for the help. it now appears to work without hanging and I have log files after reboot smile

Offline

 

#64 2007-06-12 14:23:40

vthinsel
Member
Registered: 2007-05-24
Posts: 41

Re: Fan does run all the time :-(

Soooooo

I finally decided not to stop completely the fan, even with disks stopped. My dns was at 53. Now it is around 45.
When drives are stopped, I force a given fanspeed, to ensure a small airflow. I can't hear it though.

See attached file for the script.

I'll post some stats once I have enough usage, but this script looks to fit my needs.

Vincent.

Offline

 

#65 2007-06-25 20:04:30

tybreizh29
New member
Registered: 2007-06-24
Posts: 1

Re: Fan does run all the time :-(

Hi,
I'm trying the following fan control script. Works fine but disks always spin and never spin down.
Someone knows why ?
thanks for helping
Marc

Code:

#!/bin/sh
#
# This script was created at http://dns323.kood.org by FIB,
# it has been slightly modified by leper (with help from
# fonz). It sets the fanspeed of the device depending on 
# the temperature, which is measured in Fahrenheit. If 
# your box measures temperature in Celsius, you need to 
# edit it to work.

# Set the path to use RAM-disk instead of harddrive, to 
# execute from. This is done so that the disks will go
# into sleep mode, while the script is running.
PATH=/usr/bin:/bin:/usr/sbin:/sbin

# Create a logfile on the RAM-disk.
LOGDIR=/log
FANLOGFILE=${LOGDIR}/fan_ctrl.log
mkdir -p ${LOGDIR}

# Kill the old fan controller.
kill -9 `pidof fancontrol`
echo "Fancontrol killed. Installing fan_ctrl.sh" >${FANLOGFILE}

# With temps between T1 and T2, the script automatically
# lowers/raises the fanspeed between RPM1 and RPM2. This
# it does every update_interval seconds.
update_interval=10
T1=105
T2=140
RPM1=1940
RPM2=4000

while [ 1 ]
do
  T=`temperature g 0`
  T=${T##*=}
  CALCTEMP=`expr \( \( $T2 \< $T \) \* $RPM2 \) \| \( \( $RPM1 + \( $RPM2 - $RPM1 \) \* \( $T - $T1 \) \/ \( $T2 - $T1 \) \) \& \( $T \>= $T1 \) \)`
  CONVFTOC=`expr \( \( $T - 32 \) \* 10 + 9 \) \/ 18`
  newRPM=${CALCTEMP}
  fanspeed w $newRPM  
  echo `date`" ::CURRENT::" $T"F" ${CONVFTOC}"C -- fanspeed:" $newRPM "(written to "${FANLOGFILE}")." >>${FANLOGFILE}
  echo `date`" ::CURRENT::" $T"F" ${CONVFTOC}"C -- fanspeed:" $newRPM 
  # wait for next cycle
  sleep $update_interval
done

Offline

 

#66 2007-06-25 20:30:58

kruzes
Member
Registered: 2007-05-31
Posts: 22

Re: Fan does run all the time :-(

Hi all. Doesn't fonz have a little utility to check whether the disks are active? Why are "we" still parsing dmesg output instead of using that?

Offline

 

#67 2007-06-25 21:43:28

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Fan does run all the time :-(

kruzes wrote:

Hi all. Doesn't fonz have a little utility to check whether the disks are active? Why are "we" still parsing dmesg output instead of using that?

True, I've created a small program for that. It doesn't seem to work on firmware 1.02 (linux 2.6.6), though.

Edit: Stupid bug, seems to work now... (v 0.7.176)

PPS: binary attached

Last edited by fonz (2007-06-25 22:09:10)

Offline

 

#68 2007-06-29 16:28:46

vthinsel
Member
Registered: 2007-05-24
Posts: 41

Re: Fan does run all the time :-(

I like this post smile

So here are the settings I'm using:

T1=$(c2f 50)
T2=$(c2f 70)
IDLERPM=2200
RPM1=2500
RPM2=6500

With those, I get the following stats, see attached png.
Max temp is 53 (celcius), under heavy load, or HD stopped. So it looks to be OK for me.

I still need to figure out why the RPM is set at 0 at times......

I'll include fonz's hd tool, but it will have to be copied outside disks at startup in fun-plug I guess.....

Offline

 

#69 2007-07-06 22:40:56

osxtasy
Member
Registered: 2007-01-29
Posts: 9

Re: Fan does run all the time :-(

For someone to go thru all that dam trouble, you must have some sensitive ass ears...DAMM YO! I dont even hear mine unless the TV and everything else is turned off. Of course I run a small fan in the bedroom for "white noise" anyway when I sleep so........hmmm

Offline

 

#70 2008-03-19 23:19:26

arokor
New member
Registered: 2008-03-19
Posts: 1

Re: Fan does run all the time :-(

Hi all,

I had trouble with the fan spinning up for a short time every time fanspeed w # was called so I modified the ctrl_fanspeed.sh script by fonz an leper so that it only calls fanspeed when the fan speed actually should be changed.
Here's the code:

Code:

#!/bin/sh
#
# This script was created at http://dns323.kood.org by FIB,
# it has been slightly modified by leper (with help from
# fonz) and then even more slightly modified by Arokor.
# It sets the fanspeed of the device depending on 
# the temperature, which is measured in Fahrenheit. If 
# your box measures temperature in Celsius, you need to 
# edit it to work.
# Additional changes by gartylad.
 
# Set the path to use RAM-disk instead of harddrive, to 
# execute from. This is done so that the disks will go
# into sleep mode, while the script is running.
PATH=/usr/bin:/bin:/usr/sbin:/sbin
 
# Create a logfile on the RAM-disk.
#LOGDIR=/log
#FANLOGFILE=${LOGDIR}/fan_ctrl.log
#mkdir -p ${LOGDIR}
 
# Kill the old fan controller.
kill -9 `pidof fancontrol`
#echo "Fancontrol killed. Installing fan_ctrl.sh" >${FANLOGFILE}
 
# With temps between T1 and T2, the script automatically
# lowers/raises the fan speed between RPM1 and RPM2. This
# it does every update_interval seconds.
update_interval=60

# 110F = 43C
T1=110
# 140F = 60C
T2=140

RPM1=2300
RPM2=4500

oldRPM=0
 
while [ 1 ]
do
  T=`temperature g 0`
  T=${T##*=}
  # Check if temperature has fallen below T1 value
  if [ $T -lt $T1 ]; then
    # Temp below T1 fan stops
    CALCTEMP=`expr 0` 
  else
    # Temp above T1 fan starts
    CALCTEMP=`expr \( \( $T2 \< $T \) \* $RPM2 \) \| \( \( $RPM1 + \( $RPM2 - $RPM1 \) \* \( $T - $T1 \) \/ \( $T2 - $T1 \) \) \& \( $T \>= $T1 \) \)`
  fi
  CONVFTOC=`expr \( \( $T - 32 \) \* 10 + 9 \) \/ 18`
  newRPM=${CALCTEMP}
  # Only call fanspeed if the fan speed should be changed
  if [ $newRPM -ne $oldRPM ]; then
    fanspeed w $newRPM
    oldRPM=$newRPM
  fi
  # echo `date`" ::CURRENT::" $T"F" ${CONVFTOC}"C -- fanspeed:" $newRPM "(written to "${FANLOGFILE}")." >>${FANLOGFILE}
  # wait for next cycle
  sleep $update_interval
done

Offline

 

#71 2008-05-11 22:36:39

Raider_MXD
Member
Registered: 2008-05-06
Posts: 9

Re: Fan does run all the time :-(

tybreizh29 wrote:

Hi,
I'm trying the following fan control script. Works fine but disks always spin and never spin down.
Someone knows why ?
thanks for helping
Marc

I use the same script and also have this problem. Does this scipt have to be started in a special way to make the discs spin down ? At the moment I have it started in the background from the fun_plug file.

/Edit
My CH3SNAS contains two disks that run individually, so no RAID or JBOD.

Last edited by Raider_MXD (2008-05-13 00:16:24)

Offline

 

#72 2008-05-12 20:37:45

Caesareus
New member
Registered: 2008-05-12
Posts: 3

Re: Fan does run all the time :-(

Hi Raider_MXD,

I've realized exactly the same problems as you. I'm running a Conceptronics Ch3snas in RAID1. The fancontrol script is started in background (last line in "funplug": \mnt\HD_a2\control_fanspeed.sh). No log or echo is activated and I suppose it's running from Ram-Disc (path=/usr/bin:/bin:/usr/sbin:/sbin). In this configuration temperature in combination with rpm of the fan is working well but my disks will never spin down. If I comment out the last line in funplug, the original fancontrol is running and my disks go to sleep after a few minutes. Any ideas?

Harald

Offline

 

#73 2008-05-12 21:16:36

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: Fan does run all the time :-(

suppose you have lsof, then you can check what files are open on the hd with:
lsof | grep /mnt/HD

Offline

 

#74 2008-05-12 21:42:45

SilentException
Member
From: Island of Krk, Croatia
Registered: 2008-05-04
Posts: 148

Re: Fan does run all the time :-(

can someone share a lsof binary for dns-323?


D-Link DNS-323 v1.05 fun_plug-ed + many mods,  2 x 320GB Seagate Barracuda 7200.10 RAID0, Cat6 Gigabit Network, 9k Jumbo Frames, Average (WRITE): 19,32 MB/sec, Average (READ): 28,6 MB/sec

Offline

 

#75 2008-05-12 22:50:46

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: Fan does run all the time :-(

SilentException wrote:

can someone share a lsof binary for dns-323?

http://dns323.kood.org/forum/t2139-lsof-DNS-323.html


DNS-323 • 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB • RAID1 • FW1.03 • ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB