2014. január 5., vasárnap

Dlink DNS 323 fan always runs

I have a Dlink DNS 323 NAS with original firmware.
The device works great but sometimes the fan runs continously but no reason, because the temperature is not high.

When I login into the administration page and set the fan control to "always high" then save the configuration, the fan switch to maximum RPM.
After that I set the fan control to off/ low/high and save the config, the fan switchs off. After that the fan control works good for a period again.
It switch to low and switch off depending the temperature.

I've wrote a small script which can help me to resolve this issue. It can be run manually or with some modification from cron.

Here is the script:

#!/bin/bash

USER="admin"
echo -n "Admin pasword: "
read PASS
echo -n "NAS IP: "
read IP
echo "Logging in..."
wget -q --save-cookies cookies.txt --post-data 'f_LOGIN_NAME=$USER&f_LOGIN_PASSWD=$PASS&Config_Button=Configuration' http://$IP/goform/formLogin -O - > /dev/null
echo "Switch to high RPM"
wget -q --load-cookies cookies.txt --post-data 'f_onoff0=1&f_time=15&f_fan=2&power_onoff0=1' http://$IP/goform/SetPowerManagement -O - > /dev/null
echo "Wait a sec..."
sleep 1
echo "Switch off"
wget -q --load-cookies cookies.txt --post-data 'f_onoff0=1&f_time=15&f_fan=0&power_onoff0=1' http://$IP/goform/SetPowerManagement -O - > /dev/null
echo "Finished"
rm -f cookies.txt

Please feel free to use it.