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 2008-04-28 00:29:27

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

program for LED and fan control

hai,
i made a simple program for controlling the hdd leds and fan on the 313. it can also get the temperature in celsius. hope it will be useful for someone.


download package grom http://www.uloz.cz/show/file/60685-g751ctl.tbz2 OR from the attachmend to this post
1) save it somewhere
2) from the command line do :
tar xvjf 60685-g751ctl.tbz2
cd g751ctl
cp g751ctl /ffp/bin
3) ???
4) profit

i'll write a better daemon for the fancontrol sometime, that default one is crappy as hell,because it starts the fan only when the hdd is melting down..

in the next release :
power/netlink led control

Offline

 

#2 2008-04-28 12:03:21

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: program for LED and fan control

the hdd leds can be light independently , so if you light red + blue you got purple color etc smile
wait for update

Offline

 

#3 2008-04-29 00:29:05

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: program for LED and fan control

ok, i have the next relase smile

changelog:
- added g751temp binary. you can get the temperature from internal sensor, and to get/set THY & TOS values in the register. Later two are currently useless, but there is a (crashing) program by dlink in distro, so i thought it would be nice to have a functional one.
- the every led except the network one can be light separatedly, so you can see color combinations unavailable to ordinary user smile

enjoy

Offline

 

#4 2008-05-04 20:36:46

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: program for LED and fan control

Hi @pcp,

thanks for the nice progs, works fine. Im using Debian-Etch at my DNS-313 and this is one of the missing tools.
But also I miss a tool that helps the Power-Button working. The Utility "ubutton" from the original D-Link-Firmware doesīt his job, in most cases it crashes with "Segmentation Fault", sometimes logs "kill singal xxxx" but nothing else happens.  Any hints?

Greatings  The Bear.


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#5 2008-05-04 21:22:16

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: program for LED and fan control

the ubutton basically, if i understand the strace output correctly, forks into two processes. the first one periodically polls the /dev/sl_pwr device for power button status, and if there is keypress, it creates file /tmp/shutdown, which is a signal for second process to initiate system halt.
it shouldn't be difficult to create similar application, but the d-link's kernel sources are bit of hacked, and i need some time to get into. watch the forum for the updates smile

Offline

 

#6 2008-05-04 22:50:12

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: program for LED and fan control

Hi, pcp

that`s interesting! Especially to meet someone who has those knowledges...
I understand. As I wrote, sometimetimes the "ubutton" stays alive. Then I get the message "kill singal xxx" and "Power Button Event", but mostly it crashes... No idea, why... When I try to load ubutton at bootup (in rc.local) it never stays alive.
When making "rm -rf /mnt/HD_a2/.systemfile" then "ubutton &" sometimes works...
Remember he says "kill singal.." not "signal", itīs a bug in the file ...\DNS-313 GPL\Image\src\linux\drivers\char\gemini_pwr.c
But in fact, the ubutton tries to make many other actions nobody needs...
What a system is running on your 313? Now on mine running Debian-Etch very fine, but in future want to make a new kernel. What do you think about?
And not at least, how do you think about a DNS-313-WIKI?

so long,   the Bear


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#7 2008-05-04 23:36:33

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: program for LED and fan control

...and I think, itīs not a good idea periodically poling the /dev/sl_pwr device for power button status. Needs too much ressources. Making a kernel-module which takes an interrupt and calls a external programm to shutdown the unit seems the better solution...


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#8 2008-05-05 00:01:18

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: program for LED and fan control

sure, their sources looks like as they were written by a crowd of a drugged orthodox perl programmers. irq parts are commented out, who knows how it really works. i am not very experienced with kernel stuff. luckily, the sl3212 chipset is integrated in many devices, so there are 'vannila' files available.
what kernel do you use? is it the stock debian? i compiled my own from the gpl'ed sources by the d-link, because i wanted an ext3 support, and it works fine.

system i am using is built from a d-link sources, i made some changes to a rd.gz - by default, it wipes out whole system partition every time you restart the box.

Offline

 

#9 2008-05-05 09:26:27

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: program for LED and fan control

Hi, pcp,

by now Iīm still using the original DLink-Kernel 2.6.15 because my experiences with kernel stuff are a lot lesser then yours ;o)
But in future we must do this. In the german DLink-forum many people reported a very poor network-performance and we guess, itīs also the blame of the buggy kernel.

These changes in rd.gz Iīve also made. But yes, the complete system seems scratched together from wherever, I think, running Debian will be the better way then screwing at the  original firmware.
Forgive my poor english, what are "vanilla-files"?


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#10 2008-05-05 10:11:14

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: program for LED and fan control

By the vanilla files i mean the sources untouched by the D-link. It seems the Storlink is supplying the kernel sources to a vendors who are using their chips. Vendors then hack it somehow to make it work with their device, and then some of them publish these sources as a "GPL" (like the D-link did).

The performance problems might be related to a small memory integrated in a device, or to a cpu load. But for me, the network speed is sufficient, much better than with other NAS'es.

Offline

 

#11 2008-05-08 23:02:54

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: program for LED and fan control

jesus christ, i've found out how the ubutton works

1) register your process id via the ioctl call to the power button driver
2) freeze
3) when the button is pressed, kernel calls kill_proc(your_pid) with a SIGUSR2
4) so you know that button was pressed, and you can ride safely to the hell
5) ???
6) profit

it has one little error, that power event can occur only once, if you miss the chance your button is useless (as far as i found out)

very interesting concept, i have to say. i lol'd hardly today

tl;dr
kernel code for power button is crappy, so if you want to use pbutton effectively, you'll have to install a new kernel. good news are that it's simple to write code that will act as original ubutton daemon. expect sources and binary soon.

Last edited by pcp (2008-05-08 23:04:28)

Offline

 

#12 2008-05-09 00:02:42

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: program for LED and fan control

by the hell, i didnīt understand any word....   ;-)

Hm, installing a new kernel isnīt the problem, must only take a new zImage in /.boot/
But where can i get it?
At this moment, i remember using ext3 is a good idea too...

Greetings and many thanks    the bear.


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#13 2008-05-09 00:28:43

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: program for LED and fan control

My Debian Etch on DNS-313 works. O.K., some things are missing, e.g. the powerbutton.
Some guys tried it and  reported it works fine.
Should i post the ready-to-use download source and a simple installation tutorial yet?


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#14 2008-05-10 00:30:10

radir
Member
Registered: 2008-01-03
Posts: 68

Re: program for LED and fan control

CharminBaer wrote:

My Debian Etch on DNS-313 works. O.K., some things are missing, e.g. the powerbutton.
Some guys tried it and  reported it works fine.
Should i post the ready-to-use download source and a simple installation tutorial yet?

Hi,

Yes, please. I am very interested in your experiences too but guess everybody else would find it useful.

Thanks.

Offline

 

#15 2008-05-10 00:32:19

radir
Member
Registered: 2008-01-03
Posts: 68

Re: program for LED and fan control

pcp wrote:

jesus christ, i've found out how the ubutton works

1) register your process id via the ioctl call to the power button driver
2) freeze
3) when the button is pressed, kernel calls kill_proc(your_pid) with a SIGUSR2
4) so you know that button was pressed, and you can ride safely to the hell
5) ???
6) profit

it has one little error, that power event can occur only once, if you miss the chance your button is useless (as far as i found out)

very interesting concept, i have to say. i lol'd hardly today

tl;dr
kernel code for power button is crappy, so if you want to use pbutton effectively, you'll have to install a new kernel. good news are that it's simple to write code that will act as original ubutton daemon. expect sources and binary soon.

Hi, could you please tell where you found the source? Is this 'gemini_pwr.c' you mentioned eariler?

Thanks.

Offline

 

#16 2008-05-10 01:44:33

pcp
Member
From: Moravistan
Registered: 2008-04-23
Posts: 75

Re: program for LED and fan control

Hi, could you please tell where you found the source? Is this 'gemini_pwr.c' you mentioned eariler?

Thanks.

yes, it;s in the drivers/char/gemini_pwr.c. but the code is very ugly and should not be viewed by anyone.

Offline

 

#17 2008-06-09 23:50:08

CharminBaer
Member
From: Leipzig, Germany
Registered: 2008-04-25
Posts: 76

Re: program for LED and fan control

This thread is quite interesting, donīt let it perish...


DNS-313 / native running etch4.0r3...
and by now running lenny with all the features and no probs.

Offline

 

#18 2012-01-18 00:27:37

Electrocut
Member
From: France
Registered: 2009-04-05
Posts: 195

Re: program for LED and fan control

Just to let you know, even if the thread is 3 years old, that was really useful for me today smile

The link above was dead, I download the first release (source + binary) from here (= your backup ? ;-))

And it's working great!

By the way, I didn't know the fan could run at 2 different speed. I've never heard the fan running at full speed until today.

Edit: found the last release on the other thread: http://forum.dsmg600.info/viewtopic.php?id=2589
And it's working great! Now I can control LEDs as I want.

PS: The reason why I'm testing this, is because I'd like to switch PowerLED off manually, cause ubutton service from Dlink (which is supposed to do turn the LED off when the disk spins down) works very bad on my DNS-313 (high CPU Usage), don't know why ;-)

Last edited by Electrocut (2012-01-18 00:38:48)


DNS-313

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB