Fan control?

Fan control?

Postby jaker » Sun May 24, 2020 7:50 pm

Is there any possibility for fan control in Lacie Network Space Max? It seems like Standby with Wake-On-Lan does not stop the fan.

Is there hardware support for on-off, pwm or voltage control?

If there is no such GPIO or similar control, perhaps external switch could be added so that if LEDs are on, then fan would be also on.
jaker
Donator VIP
Donator VIP
 
Posts: 59
Joined: Sun Oct 27, 2019 7:55 pm

Re: Fan control?

Postby fvdw » Sun May 24, 2020 8:44 pm

yes it should be possible via using the parameters in /sys/devices/platform/gpio-fan or /sys/class/hwmon/hwmon0
I do not have a nwsp2 max so I can not say how to adjust, I guess it will be same as the gpio fan on 2big_v2
Howevr in contrary to 2big2 we do not load a fan temperature controller in case of nwsp2.
To see if it the 2big2 driver can be used please have a look if you have this folder /sys/bus/i2c/devices/0-003e/hwmon/hwmon0/
And if in this folder are fan control parameters, like pwm1 and pwn1_enable.

If that is the case execute this command
Code: Select all
/bin_cab/fan5big

And after that this command to see if controller is running
Code: Select all
ps -ef | grep fan5big

This controller will use disk temperature to control speed of the fan, so you will need to check if the fan control os really working dependend on dis temperature. As I can not test it I cannot guarantee that it will work. Remember if fan never switches on your disks may overheat so be care ful and test it

if this controller works we can adapt firmware to load it as well in case of nwsp2 max
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Fan control?

Postby jaker » Mon May 25, 2020 8:31 pm

Looks like it does not exist:
Code: Select all
root@ZENfvdwsl-base:/ # ls /sys/bus/i2c/devices/
0-0050/  0-0051/  i2c-0/


Code: Select all
root@ZENfvdwsl-base:/ # ls bin_cab/f*
bin_cab/fan5big  bin_cab/fand-x86  bin_cab/fan-phn


Code: Select all
root@ZENfvdwsl-base:/ # ls /sys/devices/platform
alarmtimer        leds-gpio           mv_crypto     orion_spi.0  serial8250.0
gpio-fan          leds-ns2            mv_xor.0      power        uevent
gpio-keys         mv643xx_eth.0       mv_xor.1      rtc-mv
gpio-usb          mv643xx_eth_port.0  orion-ehci.0  sata_mv.0
kirkwood_cpuidle  mv64xxx_i2c.0       orion-mdio    serial8250
root@ZENfvdwsl-base:/ # ls -la /sys/class/hwmon/
total 0
drwxr-xr-x   2 root root 0 2020-02-19 17:17 .
drwxr-xr-x  46 root root 0 2020-02-19 17:17 ..
lrwxrwxrwx   1 root root 0 2020-02-19 17:17 hwmon0 -> ../../devices/platform/gpio-fan/hwmon/hwmon0
root@ZENfvdwsl-base:/ #
jaker
Donator VIP
Donator VIP
 
Posts: 59
Joined: Sun Oct 27, 2019 7:55 pm

Re: Fan control?

Postby fvdw » Mon May 25, 2020 8:54 pm

mmm...so we cannot use the temperature daemon of the 2big and 5big

lets see what is inside the directory mentioned below and its sub folders?

Code: Select all
/sys/devices/platform/gpio-fan/hwmon/hwmon0
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Fan control?

Postby jaker » Mon May 25, 2020 9:01 pm

Code: Select all
root@ZENfvdwsl-base:/ # ls /sys/devices/platform/gpio-fan/hwmon/hwmon0
device      fan1_input  fan1_min     name   pwm1         pwm1_mode  uevent
fan1_alarm  fan1_max    fan1_target  power  pwm1_enable  subsystem
root@ZENfvdwsl-base:/ #


Code: Select all
root@ZENfvdwsl-base:/ # ls -la /sys/devices/platform/gpio-fan/hwmon/hwmon0
total 0
drwxr-xr-x  3 root root    0 2020-02-19 17:17 .
drwxr-xr-x  3 root root    0 2020-02-19 17:17 ..
lrwxrwxrwx  1 root root    0 2020-02-19 18:12 device -> ../../../gpio-fan
-r--r--r--  1 root root 4096 2020-02-19 18:12 fan1_alarm
-r--r--r--  1 root root 4096 2020-02-19 18:12 fan1_input
-r--r--r--  1 root root 4096 2020-02-19 18:12 fan1_max
-r--r--r--  1 root root 4096 2020-02-19 18:12 fan1_min
-rw-r--r--  1 root root 4096 2020-02-19 18:12 fan1_target
-r--r--r--  1 root root 4096 2020-02-19 18:12 name
drwxr-xr-x  2 root root    0 2020-02-19 18:12 power
-rw-r--r--  1 root root 4096 2020-02-19 18:12 pwm1
-rw-r--r--  1 root root 4096 2020-02-19 18:12 pwm1_enable
-r--r--r--  1 root root 4096 2020-02-19 18:12 pwm1_mode
lrwxrwxrwx  1 root root    0 2020-02-19 18:12 subsystem -> ../../../../../class/hwmon
-rw-r--r--  1 root root 4096 2020-02-19 17:17 uevent
root@ZENfvdwsl-base:/ #
jaker
Donator VIP
Donator VIP
 
Posts: 59
Joined: Sun Oct 27, 2019 7:55 pm

Re: Fan control?

Postby fvdw » Mon May 25, 2020 9:31 pm

that looks good

to see what speed is set give this command

Code: Select all
cat /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1

We need this value to restore it after trial to switch off the fan

and
Code: Select all
cat /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1_mode

This to see in which mode the fan is operated

Now lets see if we can switch the fan off
Give these commands
Code: Select all
echo 1 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1_enable
echo 1 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1_mode
echo 0 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1


Check if fan is switched off

to restore original speed
Code: Select all
echo n > /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1

where "n" is the number you have obtained in the first command
You can also reboot the nwsp2 max

If this works I can make a fan daemon to control the speed of the fan dependent on temperature of your harddisks


ps i expect that following speed settings can be used
0 switched off
15 = 1500 rpm
14 = 1700
13 =1800
12 = 2100
11 = 3100
10 = 3300
9 = 4300
8 = 5500 (max speed)
You could test that by writing these number to pwm1 as indicate above

I will need this info to code the fan temperature controller properly
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Fan control?

Postby jaker » Tue May 26, 2020 6:52 am

Code: Select all
root@ZENfvdwsl-base:/ # cat /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1
159
root@ZENfvdwsl-base:/ # cat /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1_mode
0
root@ZENfvdwsl-base:/ # echo 1 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1_enable
root@ZENfvdwsl-base:/ # echo 1 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1_mode
-sh: can't create /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1_mode: Permission denied
root@ZENfvdwsl-base:/ # echo 0 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1
root@ZENfvdwsl-base:/ # echo 159 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm1
root@ZENfvdwsl-base:/ #

Yes. Fan stops after the commands.

Looks like the adjustment range is from 0 to 255.
Going down keeps the fan spinning with set values all the way down to 1
0 stops the fan
It needs to be set up to 100 to get it spinning again. This might vary between fans and one in my Lacie is quite old.

Code: Select all
root@ZENfvdwsl-base:/ # echo 0 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/pwm
1
root@ZENfvdwsl-base:/ # echo 100 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/p
wm1
root@ZENfvdwsl-base:/ # echo 255 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/p
wm1
root@ZENfvdwsl-base:/ # echo 256 > /sys/devices/platform/gpio-fan/hwmon/hwmon0/p
wm1
sh: write error: Invalid argument


And this listing might give the reason why pwm1_mode wasn't succesful.
Code: Select all
root@ZENfvdwsl-base:/sys/devices/platform/gpio-fan/hwmon/hwmon0 # ls -la
total 0
drwxr-xr-x  3 root root    0 2020-02-20 00:36 .
drwxr-xr-x  3 root root    0 2020-02-20 00:36 ..
lrwxrwxrwx  1 root root    0 2020-02-20 03:52 device -> ../../../gpio-fan
-r--r--r--  1 root root 4096 2020-02-20 03:52 fan1_alarm
-r--r--r--  1 root root 4096 2020-02-20 03:52 fan1_input
-r--r--r--  1 root root 4096 2020-02-20 03:52 fan1_max
-r--r--r--  1 root root 4096 2020-02-20 03:52 fan1_min
-rw-r--r--  1 root root 4096 2020-02-20 03:52 fan1_target
-r--r--r--  1 root root 4096 2020-02-20 03:52 name
drwxr-xr-x  2 root root    0 2020-02-20 03:52 power
-rw-r--r--  1 root root 4096 2020-02-20 03:51 pwm1
-rw-r--r--  1 root root 4096 2020-02-20 03:37 pwm1_enable
-r--r--r--  1 root root 4096 2020-02-20 03:37 pwm1_mode
lrwxrwxrwx  1 root root    0 2020-02-20 03:52 subsystem -> ../../../../../class/hwmon
-rw-r--r--  1 root root 4096 2020-02-20 03:34 uevent
root@ZENfvdwsl-base:/sys/devices/platform/gpio-fan/hwmon/hwmon0 #


The fan itself has only +&- connected (red and black) and there isn't any RPM feedback. Depending on what kind of controller you're planning it might be good idea to start the fan always after stop with let's say value 200 to make sure it starts spinning.

It seems to have worked properly. I don't know has there been any control for it or has it been just at the same 159 level all the time. I haven't noticed any changes in fan sound. Anyway I'm interested to get it stopped while in standby with WOL. If you're willing to get smart temperature control for it, that would be superb.
jaker
Donator VIP
Donator VIP
 
Posts: 59
Joined: Sun Oct 27, 2019 7:55 pm

Re: Fan control?

Postby fvdw » Tue May 26, 2020 10:09 am

I will compile a trial version this evening
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Fan control?

Postby fvdw » Tue May 26, 2020 8:37 pm

Attached a first version for testing

Unpack the zip file and put the file in the fvdw shared folder, connect via ssh and copy the daemon to root of system
Code: Select all
mv /direct-usb/fvdw/fannwsp2max /fannwsp2max

make it executable
Code: Select all
chmod 755 /fannwsp2max

start it
Code: Select all
/fannwsp2max

This will start the fan controller with threshold value of 47 oC
Meaning the fan will start as soon as one of the two disk reaches a temperature of 47 oC
It will set speed dependent on difference between threshold and actual value of disk temperature, it will increase speed if difference is bigger and switches fan of if temperature is a few degree lower then threshold.

As your disk may not have 47 oC you can test the fan controller by giving a different threshold temparature
Code: Select all
/fannwsp2max n

In this command "n" is the threshold temperature
for example using as threshold 35 degree celsius
Code: Select all
/fannwsp2max 35
You do not have the required permissions to view the files attached to this post.
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Fan control?

Postby jaker » Fri May 29, 2020 7:36 pm

Congratulations! It seems to work correctly. I managed to start several processes, killed them, but bottom line is that the level setting works and more the limit is exceeded the faster the fan spins.

I will now leave it running and wait for it to go to standby with WOL.

I'm not sure how it works, it might not start again after WOL command, but at least I'll check if the fan shuts down.

Should this command with set level be added to Boot jobs?


And I'll probably use some lower value than 47C as my device shows that it hasn't reached over 52.

By the way does this come from hard disk SMART info or somewhere else? If it is from SMART then this should represent really all time high over several years.

Disk Status Current temperature Max temperature Max temperature ever reached
sda active 33 °C 33 °C 52 °C
sdb active 30 °C 30 °C 52 °C

Temperatures differ from each other because its running without enclosure so that I can see the fan.

Code: Select all
/fannwsp2max 32
fannwsp2max daemon version 1 26-may-2020 started
fannwsp2max: temperature limit = 32 oC
fannwsp2: disks installed: sda=1 sdb=1
fannwsp2max: an driver path is /sys/devices/platform/gpio-fan/hwmon/hwmon0/
root@ZENfvdwsl-base:/direct-usb/Storage2TB # fannwsp2max: disk temperatures sda 33 sdb 30
fannwsp2max: temperature above limit(32) fan on, temp = 33
fannwsp2max: disk temperatures sda 34 sdb 31
fannwsp2max: temperature above limit(32) fan on, temp = 34
fannwsp2max: disk temperatures sda 35 sdb 32
fannwsp2max: temperature above limit(32) fan on, temp = 35
jaker
Donator VIP
Donator VIP
 
Posts: 59
Joined: Sun Oct 27, 2019 7:55 pm

Next

Return to Lacie Network Space vs2 and max version

Who is online

Users browsing this forum: No registered users and 2 guests