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

#1 2011-04-15 04:24:59

Johny Mnemonic
Member
Registered: 2011-04-15
Posts: 7

DNS-320 Fan control script

Because I was not able to find working solution for fan control I wrote a script myself.

I moved the code to github, so you can grab it there:
https://github.com/johny-mnemonic/Scrip … control_v1

Github link is pointing to updated version of the first script, that I split into two files and make it HDD hibernation friendly.
It is running in my DNS-320 for long time so it should be stable.

New Fancontrol_v2 version is now accessible in branch fancontrol_v2. Treat it as beta for a while.
I added new features and there are also some changes and code from Gyngy, who modified my first fancontrol version (http://dns323.kood.org/forum/viewtopic.php?id=6641).
I also modified Gyngy's tplot script for plotting temperature into the chart accessible through AjaXplorer. Now I am thinking whether it would be better to run bin/tplot.sh periodically from cron, instead of in while/sleep loop. Any advice?

Instructions:
Copy files from "bin" and "start" folders to you /ffp subfolders and make them executable with chmod +x
You can change SysHigh/Low and HddHigh/Low temperatures for your liking same as hysteresis and other variables.

Changelog:

Fancontrol_v2:
- Partial rewrite with code from Gyngy
- Added ability to monitor both HDDs (optional)
- Added detection of HDD standby state, so it works with any hibernation daemon (even buil-in one)
- Added Stopping and starting of buil-in fan_control daemon to prevent overheating
- Changed logging format a bit (non-existent and hibernated HDD temperature set to -1C)
- Fixed few bugs in logging
------
- Added tplot.sh script from Gyngy to plot temperature chart
- Added checking of fan.log for updates. Generate new graph only when there is some change.
- Added cron to force refresh of graph every 12 hours even if there is no update.
- Rewritten tplot.sh to be HDD hibernation friendly
- Fixed bin/tplot.sh as it was touching HDD.
- Fixed few bugs in logging

Fancontrol_v1:
- Latest version splitted to two files for HDD hibernation support
- Hibernation possible only with status written to /tmp/hdd
- Only one monitored HDD

IMPORTANT:
My drive is Seagate Barracuda LP 2TB, so you may have to change diskx_temp() function to fit your drive if you have different smart output.
Check smartctl output for your drive and accommodate grep, tail and head parts accordingly.
My drive has ID 194 for line called "Temperature_Celsius", thats why you see 194 for grep there.
If anyone needs step-by-step instructions, just let me know, but I thing this is pretty easy ;-)

Last edited by Johny Mnemonic (2012-04-09 14:22:09)


My embedded devices:
Asus RT-N16 + WD 500GB USB + TomatoUSB
D-Link DNS-320 + Seagate Barracuda LP 2TB + fun_plug v0.5

Offline

 

#2 2011-04-15 04:28:35

Johny Mnemonic
Member
Registered: 2011-04-15
Posts: 7

Re: DNS-320 Fan control script

ToDo:
1. Copy script to ramfs to stop using main drive
2. Find some smart way to get temperature for any drive


My embedded devices:
Asus RT-N16 + WD 500GB USB + TomatoUSB
D-Link DNS-320 + Seagate Barracuda LP 2TB + fun_plug v0.5

Offline

 

#3 2011-06-16 12:48:34

Gyngy
Member
Registered: 2011-05-27
Posts: 32

Re: DNS-320 Fan control script

Hello Johny,
I did some update to your script and post it in new thread.

About replacing FAN :
I replace 40x40x10 mm 5V fan with 92x92x20 mm 12V one.
It is normal cheap 12 V fan. I did test about controlling low/ high speed and fan was rotating well, so I used it.

Installation was done by brute force ;-):
- disassemble DNS-320,
- unmount 40mm fan
- using screwdriver I crack/remove steal plate where fan was mounted - it was melted to bigger steal plate (have to take care not to destroy big plate)
- drill big hole to plastic cover from back of DNS-320
- uncut corner triangles from one side of fan - I could now screw fan from inside of DNS-320

Fan is flushed into back of NAS and temperatures are much lower - noise is now made from HDDs.

Best regards!
Tom

Offline

 

#4 2011-06-19 16:32:55

Gyngy
Member
Registered: 2011-05-27
Posts: 32

Re: DNS-320 Fan control script

Some pictures of modification could be found HERE!

Offline

 

#5 2011-09-08 00:41:11

jk7gr
Member
Registered: 2011-09-08
Posts: 5

Re: DNS-320 Fan control script

Hi Johny,
have you finalized yet the version of your script that is running from ramfs?

Thanks

Offline

 

#6 2011-09-10 12:14:14

annamartha
New member
Registered: 2011-09-10
Posts: 1

Re: DNS-320 Fan control script

Gyngy wrote:

Some pictures of modification could be found HERE!

Thanks for the link Gyngy.

Offline

 

#7 2011-12-08 21:33:17

DanielBrettig45
New member
Registered: 2011-12-08
Posts: 1

Re: DNS-320 Fan control script

I think you can follow the instruction of Johny and your problem will be solved. Thanks for sharing.

Offline

 

#8 2012-01-01 20:38:18

danfozzy
Member
Registered: 2011-12-17
Posts: 70

Re: DNS-320 Fan control script

Gyngy wrote:

Some pictures of modification could be found HERE!

that 12v fan is running ok even with the 5v supply?? im really keen to do this as my fan is noisy!

Offline

 

#9 2012-01-01 21:08:05

Gyngy
Member
Registered: 2011-05-27
Posts: 32

Re: DNS-320 Fan control script

Hi,
yes that fan was running well but it was still loud for me.
I replaced it with this one:
http://www.noctua.at/main.php?show=prod … &set=1

Now it is almost silent while running on LOW.

Best regards!
gyngy

danfozzy wrote:

Gyngy wrote:

Some pictures of modification could be found HERE!

that 12v fan is running ok even with the 5v supply?? im really keen to do this as my fan is noisy!

Offline

 

#10 2012-02-04 12:04:46

danfozzy
Member
Registered: 2011-12-17
Posts: 70

Re: DNS-320 Fan control script

I see you went for the 92 mm fan, as you had already cut out the back for the previous fan.

If u could start again, would you go for the same or the Nf-n8 (80mm) that someone mentioned on a previous thread?

Offline

 

#11 2012-02-06 21:24:03

jp1357
Member
Registered: 2012-01-26
Posts: 5

Re: DNS-320 Fan control script

I have the Nf-n8 (80mm) with rubber mounting screws. I placed it the same way as Gyngy (only I didn’t used brute force tongue ), and run it in manual mode, high speed.
It really works fantastic. Since you truly don't hear the fan at all and it cools my hdd perfect it's only 32 C and the system is 37 C. So I would definitely choose it again. I don't know the 92 mm, so can't say anything about that one.

Offline

 

#12 2012-02-06 23:41:26

danfozzy
Member
Registered: 2011-12-17
Posts: 70

Re: DNS-320 Fan control script

jp1357 wrote:

I have the Nf-n8 (80mm) with rubber mounting screws. I placed it the same way as Gyngy (only I didn’t used brute force tongue ), and run it in manual mode, high speed.
It really works fantastic. Since you truly don't hear the fan at all and it cools my hdd perfect it's only 32 C and the system is 37 C. So I would definitely choose it again. I don't know the 92 mm, so can't say anything about that one.

Can u send a pic or 2 of your drive? Real interested in doing this now!

Offline

 

#13 2012-04-09 03:29:42

Johny Mnemonic
Member
Registered: 2011-04-15
Posts: 7

Re: DNS-320 Fan control script

jk7gr wrote:

Hi Johny,
have you finalized yet the version of your script that is running from ramfs?

Thanks

Hi jk7gr,

Sorry, I forgot to check this forum.
I decided to move the code to github long time ago, but only now I finally did it, together with rewrite.

If you check the code you will see, that to only move it to ramfs was not enough, as every temperature check will spin-up the drive anyway.
With version 1 I solved that by using HDDspindown daemon from optware.
Version 2 should be independent on HDD hibernation daemon.


My embedded devices:
Asus RT-N16 + WD 500GB USB + TomatoUSB
D-Link DNS-320 + Seagate Barracuda LP 2TB + fun_plug v0.5

Offline

 

#14 2012-04-26 11:58:15

lujomu
Member
Registered: 2012-04-26
Posts: 6

Re: DNS-320 Fan control script

Hi!

I am running fun_plug 0.7 on my DNS-320 and wanted to try your script, but it seems that hdparm is not present.

Does it come with another package or has it maybe been stripped from fun_plug 0.7? Any ideas?

Thanks

Offline

 

#15 2012-04-26 12:57:12

Johny Mnemonic
Member
Registered: 2011-04-15
Posts: 7

Re: DNS-320 Fan control script

lujomu wrote:

Hi!

I am running fun_plug 0.7 on my DNS-320 and wanted to try your script, but it seems that hdparm is not present.

Does it come with another package or has it maybe been stripped from fun_plug 0.7? Any ideas?

Thanks

Sorry, I am still running on 0.5, but you can try to search packages if hdparm is available and install it.


My embedded devices:
Asus RT-N16 + WD 500GB USB + TomatoUSB
D-Link DNS-320 + Seagate Barracuda LP 2TB + fun_plug v0.5

Offline

 

#16 2012-04-30 15:17:09

lujomu
Member
Registered: 2012-04-26
Posts: 6

Re: DNS-320 Fan control script

Thought so, thanks anyway!

Offline

 

#17 2012-04-30 23:31:26

Johny Mnemonic
Member
Registered: 2011-04-15
Posts: 7

Re: DNS-320 Fan control script

lujomu wrote:

Thought so, thanks anyway!

I tried to search for hdparm and it seems like really easy fix for you.

I found, there is no hdparm even in fun_plug 0.5, there is just a link to busybox as you can see below.
You need to create same link in 0.7 and everything should work.

Code:

/ffp/home/root# ls -la /ffp/sbin/hdparm
lrwxrwxrwx    1 root     root           14 Aug 21  2011 /ffp/sbin/hdparm -> ../bin/busybox

My embedded devices:
Asus RT-N16 + WD 500GB USB + TomatoUSB
D-Link DNS-320 + Seagate Barracuda LP 2TB + fun_plug v0.5

Offline

 

#18 2012-05-01 00:15:59

lujomu
Member
Registered: 2012-04-26
Posts: 6

Re: DNS-320 Fan control script

I created a link, but when I type 'hdparm' it says:

Code:

hdparm: applet not found

It seems hdparm is not included in this version of busybox:

Code:

BusyBox v1.11.2 (2010-11-17 11:44:30 CST) multi-call binary
Copyright (C) 1998-2008 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.

Usage: busybox [function] [arguments]...
   or: function [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use and BusyBox
        will act like whatever it was invoked as!

Currently defined functions:
        adjtimex, arping, ash, awk, basename, cat, chgrp, chmod, chown,
        cmp, cp, crond, crontab, date, dd, df, dhcprelay, dirname, dmesg,
        du, dumpleases, echo, egrep, env, expr, false, fgrep, find, free,
        getty, goweb, grep, gunzip, gzip, halt, head, hostname, id, ifconfig,
        init, kill, killall, ln, logger, logread, ls, mkdir, mknod, mkswap,
        modprobe, more, mv, netstat, pidof, ping, poweroff, ps, pwd, rdate,
        reboot, rm, rmdir, route, sed, sh, sleep, swapoff, swapon, sync,
        syslogd, tail, tar, top, touch, true, udhcpc, udhcpd, uname, vi,
        wc, zcat

Shoot ... I really like the DNS-320, but that fan drives me crazy! wink

Offline

 

#19 2012-05-01 15:54:19

Johny Mnemonic
Member
Registered: 2011-04-15
Posts: 7

Re: DNS-320 Fan control script

lujomu wrote:

I created a link, but when I type 'hdparm' it says:

Code:

hdparm: applet not found

It seems hdparm is not included in this version of busybox

Shoot ... I really like the DNS-320, but that fan drives me crazy! wink

I was afraid this could be the cause why there is no link for hdparm...

You have two options then:
1. Get hdparm working with hdparm package or better busybox
2. Modify my v2 script to use same method of detection HDD sleep as v1 and use hddspindown script from optware. (offcourse you can use v1 directly)

I am using hddspindown anyway, as it has logging and you can easily modify it to do what you need.

If you decide to go for hddspindown, you need to modify it to create /tmp/hdd file each time it stops HDD and delete that file each time it detect HDD wake-up.


My embedded devices:
Asus RT-N16 + WD 500GB USB + TomatoUSB
D-Link DNS-320 + Seagate Barracuda LP 2TB + fun_plug v0.5

Offline

 

#20 2012-05-04 15:43:31

lujomu
Member
Registered: 2012-04-26
Posts: 6

Re: DNS-320 Fan control script

Johny Mnemonic wrote:

You have two options then:
1. Get hdparm working with hdparm package or better busybox
2. Modify my v2 script to use same method of detection HDD sleep as v1 and use hddspindown script from optware. (offcourse you can use v1 directly)

Thanks a lot for the pointers, but I am afraid this is a bit over my head! Maybe I should look into replacing that fan instead...

Offline

 

#21 2012-05-11 12:38:29

suprimos
Member
Registered: 2012-05-10
Posts: 9

Re: DNS-320 Fan control script

hello,

iam really new in the topic of funplug...
i just got funplug 0.7 and transmission to run...
but my fan is just to loud for me...
could provide a detailed installation guide or a link for your script??

i got this far:
copied bin+start folder to ffp

root@dlink-43850A:~# chmod a+x /ffp/start/fancontrol.sh
root@dlink-43850A:~# chmod a+x /ffp/bin/fancontrol.sh
root@dlink-43850A:~# sh /ffp/start/fancontrol.sh start
root@dlink-43850A:~# sh /ffp/bin/fancontrol.sh start
/ffp/bin/fancontrol.sh: line 32: [: missing `]'
/ffp/bin/fancontrol.sh: line 35: [: missing `]'


now what?




thanks

Last edited by suprimos (2012-05-11 12:46:44)

Offline

 

#22 2012-05-20 22:52:46

BlDsT
New member
Registered: 2012-05-20
Posts: 1

Re: DNS-320 Fan control script

lujomu wrote:

Hi!

I am running fun_plug 0.7 on my DNS-320 and wanted to try your script, but it seems that hdparm is not present.

Does it come with another package or has it maybe been stripped from fun_plug 0.7? Any ideas?

Thanks

hi guys,

here is a hdparm package for ffp 0.7: https://docs.google.com/open?id=0B2ZXjn … y00dnFPMDA
just download and install it with: funpkg -i "packagename".

Offline

 

#23 2012-05-21 01:57:46

lujomu
Member
Registered: 2012-04-26
Posts: 6

Re: DNS-320 Fan control script

BlDsT wrote:

hi guys,

here is a hdparm package for ffp 0.7: https://docs.google.com/open?id=0B2ZXjn … y00dnFPMDA
just download and install it with: funpkg -i "packagename".

Wow, works just fine!

Thanks a lot!

Offline

 

#24 2012-05-31 10:38:44

suprimos
Member
Registered: 2012-05-10
Posts: 9

Re: DNS-320 Fan control script

HELP !!!!!!

root@DLINK-DNS-320:~# sh /ffp/start/fancontrol.sh stop
root@DLINK-DNS-320:~# sh /ffp/bin/fancontrol.sh stop
/ffp/bin/fancontrol.sh: line 32: [: missing `]'
/ffp/bin/fancontrol.sh: line 35: [: missing `]'
/ffp/bin/fancontrol.sh: line 32: [: missing `]'
/ffp/bin/fancontrol.sh: line 35: [: missing `]'
/ffp/bin/fancontrol.sh: line 32: [: missing `]'
/ffp/bin/fancontrol.sh: line 35: [: missing `]'
/ffp/bin/fancontrol.sh: line 32: [: missing `]'
/ffp/bin/fancontrol.sh: line 35: [: missing `]'
/ffp/bin/fancontrol.sh: line 32: [: missing `]'
/ffp/bin/fancontrol.sh: line 35: [: missing `]'
/ffp/bin/fancontrol.sh: line 32: [: missing `]'
/ffp/bin/fancontrol.sh: line 35: [: missing `]'
/ffp/bin/fancontrol.sh: line 32: [: missing `]'
/ffp/bin/fancontrol.sh: line 35: [: missing `]'
/ffp/bin/fancontrol.sh: line 32: [: missing `]'
/ffp/bin/fancontrol.sh: line 35: [: missing `]'

Offline

 

#25 2012-05-31 23:25:15

lujomu
Member
Registered: 2012-04-26
Posts: 6

Re: DNS-320 Fan control script

@suprimos: You don't have to execute the '/ffp/bin/fancontrol.sh' script manually, it just has to be there. It is started/stopped by the script '/ffp/start/fancontrol.sh'.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB