Is fan control possible on ALT-F's debian reloaded?

1,033 views
Skip to first unread message

Tinybilbo

unread,
May 2, 2011, 7:04:37 PM5/2/11
to Alt-F
Hi Joao,

I've been having a look at the full "debian reloaded" provided by your
firmware.
And although I know that your intention is we're "on our own" with
it...
I would like some help with setting the fan speeds :).

I noticed that you have some fan control patches that are used in your
firmware,
Is there any way that these could be used by the reloaded function.

Even if they can't, can the fan speed be changed to half rather than
full, before I boot into debian reloaded.
Under your firmware my temps never rise very high and and the fan has
always remained on low.
So half should be more than enough for the occasional use that I have
in mind.

Thanks

Tiny

Tinybilbo

unread,
May 2, 2011, 7:33:08 PM5/2/11
to Alt-F
Hi,
I meant to add that I'm on a Rev C1 dns-323...
Thanks

Joao Cardoso

unread,
May 2, 2011, 7:54:12 PM5/2/11
to Alt-F
Well, I took the safe track, just in case a RAID rebuild happens right
after "booting", which will generate a lot of disk heat for eventually
a quite long time.

I believe that there is a Debian fan control thread in the DNS Hack
forum, http://forum.dsmg600.info/viewforum.php?id=3

However, following the approach "you are on your own", I can set the
rev C1 fan speed to low :)

Before doing it, I will wait for further confirmation from you, until
you do your own research in the Hack Forum, OK?

> Thanks
>
> Tiny

Tinybilbo

unread,
May 3, 2011, 1:47:56 PM5/3/11
to Alt-F
Hi Joao,

Thank you for your answer,

>Well, I took the safe track, just in case a RAID rebuild happens right
after "booting", which will generate a lot of disk heat for eventually
a quite long time.

-I completely understand, and it's correct (better safe than
sorry :) ),
although I think the RAID rebuild would probably be performed under
ALT-f,
before the debian reloaded could run, so fancontrol would be
maintained.
Also I'm currently using your firmware from flash, and will only use
occasionally debian reloaded when I need a VPN.

>Before doing it, I will wait for further confirmation from you, until
you do your own research in the Hack Forum, OK?

-I've actually been looking through that forum for the past week, I
posted here, because I could'nt find anything there.
I was'nt able to find anything that enabled fan control on a reloaded
debian, on a Rev C1 nas.
All the Rev C1 fancontrol scripts (that I found) are for the stock
firmware and FFP.
If you know of an actual thread, that would help me, please let me
know (I searched the entire forum for "fan C1")

Under debian reloaded there are no drivers installed for the fan.
/sys/devices/platform/dns323c-fan.0 is pretty much empty (no
hwmon:hwmon1, or pwm1)
I can see that in your firmware, that the drivers are present,
presumably by patching the kernel,
maybe by using something like the "linux-2.6.35.7-
dns323_rev_C1_fan_support.patch" from your source

I'm guessing that I need to either patch the kernel I'm currently
using, (however I can't find any patches for it),
(also I'm not even sure how to patch a kernel....)
or compile a newer kernel with the relevant patches and install that.
I have tried installing a newer kernel, but on reboot, debian reloaded
won't run.
(is it even possible to install a newer kernel on a "reloaded"? - if
so, How?).

How do I use the patch?, and can it be used on any kernel?
It seems to be the same one from lm-sensors
http://lists.lm-sensors.org/pipermail/lm-sensors/2010-June/028733.html
Do you have any hints/pointers as to the process that I need to do in
order to get fancontrol?
(Just the process... I'll google how to actually do it)

>However, following the approach "you are on your own", I can set the
rev C1 fan speed to low :)

-I found the debian script /rootmnt/rootsq/usr/sbin and shadowed it
in /usr/sbin, changing

echo 255 > /sys/class/hwmon/hwmon1/device/pwm1
to
echo 63 > /sys/class/hwmon/hwmon1/device/pwm1

Which matches the low fan speed in Alt-f,

So for the moment I'll use that untill I learn enough to get the patch
working.

Thanks again for your time and help...

Tiny


Joao Cardoso

unread,
May 3, 2011, 5:01:18 PM5/3/11
to al...@googlegroups.com

> -I've actually been looking through that forum for the past week, I
> posted here, because I could'nt find anything there.
> I was'nt able to find anything that enabled fan control on a reloaded
> debian, on a Rev C1 nas.
> All the Rev C1 fancontrol scripts (that I found) are for the stock
> firmware and FFP.
> If you know of an actual thread, that would help me, please let me
> know (I searched the entire forum for "fan C1")
>
> Under debian reloaded there are no drivers installed for the fan.
> /sys/devices/platform/dns323c-fan.0 is pretty much empty (no
> hwmon:hwmon1, or pwm1)

The C1 hardware fan control is not PWM (Pulse Width Modulation) controlled
like the rev A1 and B1.

The fan is controlled by two I/O lines (GPIO lines), given four possibilities,
00-off, 01-low, 10-high, 11-very high (unused)

So, perhaps the /sys/devices/platform/dns323c-fan.0 has the necessary files to
control the fan speed.
Only seeing the list of Debian patches applied to the vanilla kernel one could
tell.

> I can see that in your firmware, that the drivers are present,
> presumably by patching the kernel,
> maybe by using something like the "linux-2.6.35.7-
> dns323_rev_C1_fan_support.patch" from your source

Yes.

> I'm guessing that I need to either patch the kernel I'm currently
> using, (however I can't find any patches for it),

Debian "offers" the patches applied to their kernels.

> (also I'm not even sure how to patch a kernel....)
> or compile a newer kernel with the relevant patches and install that.

Well, you can learn. There are some howtos on that subject.
But if your motivation is just to have control over the fan, it is going to be
the hell of a job (given the outcome).

> I have tried installing a newer kernel, but on reboot, debian reloaded
> won't run.
> (is it even possible to install a newer kernel on a "reloaded"? - if
> so, How?).

Just copy the kernel and initramfs/initrd to the Debian /boot directory and
adjust the /vmlinuz and /initrd.img links to them.

> How do I use the patch?, and can it be used on any kernel?
> It seems to be the same one from lm-sensors
> http://lists.lm-sensors.org/pipermail/lm-sensors/2010-June/028733.html
> Do you have any hints/pointers as to the process that I need to do in
> order to get fancontrol?
> (Just the process... I'll google how to actually do it)

It is involved. Configuring, compiling and running a kernel for a 386 desktop
computer is complicated enought, but for an embedded device, with almost no
user-base support, is much more complex.

> >However, following the approach "you are on your own", I can set the
>
> rev C1 fan speed to low :)
>
> -I found the debian script /rootmnt/rootsq/usr/sbin and shadowed it
> in /usr/sbin, changing
>
> echo 255 > /sys/class/hwmon/hwmon1/device/pwm1
> to
> echo 63 > /sys/class/hwmon/hwmon1/device/pwm1
>
> Which matches the low fan speed in Alt-f,

If it is good enough for you, then stick with it.

Don't get me wrong, there is nothing special being able to do it, but given
your background you are going to spend weeks until you are able to get a
running kernel. You have not only to master kernel building but also the
Debian way of generating it.
For me, the workload seems disproportionate to the outcome.

Joao Cardoso

unread,
May 3, 2011, 8:20:34 PM5/3/11
to Alt-F


> Well, you can learn. There are some howtos on that subject.
> But if your motivation is just to have control over the fan, it is going to be
> the hell of a job (given the outcome).

I just get a simpler idea: just 'apt-get install linux-source-2.6.32'
and build it natively, i.e., in the box.
It will take ages to accomplish, but it will work. You have to install
a few development packages such as gcc, binutils, make, etc.

Follow http://kernel-handbook.alioth.debian.org/ch-common-tasks.html

After building, installing, and running it; than you can try to apply
any patches.

Joao Cardoso

unread,
May 3, 2011, 8:48:13 PM5/3/11
to Alt-F
I just did it, and the good news is that C1 board support is already
built.-in:

linux-source-2.6.32/arch/arm/mach-orion5x/dns323-setup.c

...
/* Rev C1 */
#define DNS323C_GPIO_KEY_POWER 1
#define DNS323C_GPIO_POWER_OFF 2
#define DNS323C_GPIO_LED_RIGHT_AMBER 8
#define DNS323C_GPIO_LED_LEFT_AMBER 9
#define DNS323C_GPIO_LED_POWER 17
#define DNS323C_GPIO_FAN_BIT1 18
#define DNS323C_GPIO_FAN_BIT0 19
...

If you examine 'dmesg' output you should see a message saying
DNS-323 ... C1

mine says:
[ 0.227597] DNS-323: Identified HW revision B1

So you don't have to build and patch the kernel, you only have to
learn how to expose (under /sys/class/...) and *use* the GPIO bits 18
and 19 that control the fan speed.

It looks like there is no fan driver (drivers/hwmon/) although the
"dns323c-fan" is registered in dns323-setup.c.

Quote of the day: "You are now on your own". again? :-)


On May 4, 1:20 am, Joao Cardoso <whoami.jc...@gmail.com> wrote:
> > Well, you can learn. There are some howtos on that subject.
> > But if your motivation is just to have control over the fan, it is going to be
> > the hell of a job (given the outcome).
>
> I just get a simpler idea: just 'apt-get install linux-source-2.6.32'
> and build it natively, i.e., in the box.
> It will take ages to accomplish, but it will work. You have to install
> a few development packages such as gcc, binutils, make, etc.
>
> Followhttp://kernel-handbook.alioth.debian.org/ch-common-tasks.html

Tinybilbo

unread,
May 4, 2011, 5:22:50 PM5/4/11
to Alt-F
> I just did it, and the good news is that C1 board support is already
> built.-in:
>
> linux-source-2.6.32/arch/arm/mach-orion5x/dns323-setup.c
>
> ...
> /* Rev C1 */
> #define DNS323C_GPIO_KEY_POWER          1
> #define DNS323C_GPIO_POWER_OFF          2
> #define DNS323C_GPIO_LED_RIGHT_AMBER    8
> #define DNS323C_GPIO_LED_LEFT_AMBER     9
> #define DNS323C_GPIO_LED_POWER          17
> #define DNS323C_GPIO_FAN_BIT1           18
> #define DNS323C_GPIO_FAN_BIT0           19
> ...
>
> If you examine 'dmesg' output you should see a message saying
> DNS-323 ... C1
>
> mine says:
> [    0.227597] DNS-323: Identified HW revision B1
>
> So you don't have to build and patch the kernel, you only have to
> learn how to expose (under /sys/class/...) and *use* the GPIO bits 18
> and 19 that control the fan speed.
>
> It looks like there is no fan driver (drivers/hwmon/)  although the
> "dns323c-fan" is registered in dns323-setup.c.
>
> Quote of the day: "You are now on your own". again? :-)

Thank you again Joao!...

For taking the time to help me while I learn...,
I have no problem "being on my own", so long as I can have a gentle
nudge in the right direction..
Ok - so I was clueless before :), but now at least I know what to read
up on.

I had actually seen the (fan) pin-outs of the gpio in the wiki (the C1
gpio differs to the A and B revisons),
but did'nt realise they could be manipulated directly (like a button
or led - I guess).

Regards

Tiny

Joao Cardoso

unread,
May 5, 2011, 11:10:30 AM5/5/11
to Alt-F

> I had actually seen the (fan) pin-outs of the gpio in the wiki (the C1
> gpio differs to the A and B revisons),
> but did'nt realise they could be manipulated directly (like a button
> or led - I guess).

Read around post 11 under the topic "Experimental kernels available
for testing for Rev-A1 and rev-C1 boards"

jmccrohan

unread,
May 5, 2011, 4:08:40 PM5/5/11
to Alt-F
Hi Tiny,

I'm running Debian Squeeze on my DNS323.

I got caught by the same fan issue when I moved to Debian.

I wrote some simple scripts to implement fan + led control.

They might be of some use:

https://gist.github.com/957801

Regards,
Jon

Tinybilbo

unread,
May 8, 2011, 2:41:30 PM5/8/11
to Alt-F
> I wrote some simple scripts to implement fan + led control.
>
> They might be of some use:
>
> https://gist.github.com/957801
>
> Regards,
> Jon

Thanks Jon,

The scripts work perfectly...
Can the scripts be modified to include sending a halt command when the
power button is pressed,
Then the box becomes a little more wife friendly.... :)
I think the power input is gpio2...
Also are you using using debian reloaded or have you flashed debian
natively (on your revC1)?

Also thanks again to Joao for all his help...

Dmitriy Istselemov

unread,
Apr 21, 2015, 11:31:16 PM4/21/15
to al...@googlegroups.com
воскресенье, 8 мая 2011 г., 23:41:30 UTC+5 пользователь Tinybilbo написал:

Hello,

A lot of time has past, but nevertheless. Have you managed the halt problem using the button?
Reply all
Reply to author
Forward
0 new messages