Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
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?
Offline
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
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
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
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
Offline
switch to ASCII, and it should be OK.
Offline
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
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
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
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
Has anyone verified that important things like shut-down at high temp works w/this modified script?
Offline
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
guys, thanks for the help. it now appears to work without hanging and I have log files after reboot
Offline
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
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
#!/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
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
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
I like this post
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
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
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:
#!/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
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
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
can someone share a lsof binary for dns-323?
Offline
SilentException wrote:
can someone share a lsof binary for dns-323?
Offline