REPORTING STUFF: D-Link DNS 320L rev A3

1,811 views
Skip to first unread message

Rafael Ourique

unread,
Jul 5, 2014, 6:10:47 PM7/5/14
to al...@googlegroups.com
First, let me quote this topic:

On Saturday, July 5, 2014 10:53:58 AM UTC-3, João Cardoso wrote:



But thanks for reporting back,  there has been 28 downloads of  Alt-F-0.1RC4-DNS-320L-rev-A1.bin and no report at all, so I didn't know if it was working or not!

The minimum needed for a box to work is to have disk and network access. But for me that does not means "supported", much more is need -- system temperature reading, automatic fan control, all buttons and leds working as expected... and from your report none of these seems to be right now!

So, the DNS-320L-rev-A1/A3 is not fully supported, but it works.

There are a lot of things to test, debug and fix, and most means trying and error, as I don't have such a box of my own, so instructions have to be followed, results reported back, doing another try/error cycle... all this taking days or weeks, depending on your technical expertise and linux experience.

Thanks for reporting back,
João




Well... i won't lie to you: i don't understand much of what you're saying BUT, if i can help in any way, just create a thread or mail me with what i should do, what should/shouldn't happen and what files i should send you for you to check if this works and i'll gladly do it next month (it's easier to do this on vacation). for now, i'll revert to the "stock" firmware and try to start over. i messed with so many things that i don't even know what i'm doing on it anymore.

About the examples you used on the last post, here's my impressions of what is happening

Temperature reading: sysctrl service does not recognize the board it seems. the status view, however, seems to detect the HD temperature and fan speed

check the images below

http://i.imgur.com/8Cj0dbY.png
http://i.imgur.com/EYDDTC1.png

Fan control: This one almost drove me nuts last night: basically, the fan is working on "bursts": it plays full rotation (60000) for 10-20 seconds then it returns do 50% rotation (30000) for another 10-20 seconds. the noise is giving me a goddamned headache by the way.
LEDs: the "power" led blinks when it's turning on and after that, all four (five if you count that below the "usb" button both the blue and orange leds are lit) are on 100% of the time. since when the stock d-link firmware "formatted" the HD it created a RAID-something that i'm 90% sure i did NOT asked and do NOT want, the red LEDs seems accurate enough
 haven't tried messing with buttons or led functions. it isn't necessary for what i'm using it for

CPU Issue: the CPU usage also seems to have a problem: from time to time it goes on 100% CPU usage for no actual reason. checking it with a putty terminal (top command, connected via ssh), it has shown that these spikes originated in transmission, but after i killed the process, it STILL gets some spikes now and then for no reason at all.

On a side note, i faced similar problems using transmission on fun_plug and deluged+deluge-web on debian squeeze. i'm a rather heavy torrent user (at least 300GB of data divided into 20 or 30 torrents), but that's too much! specially AFTER the verification for downloaded data has finished long ago. transmission even kept filling a log file with error messages so much it ended up with almost 5gb when i deleted it.
I have bad karma with these things :(

That's about it for now. i'll keep following the project and will return later.

best of luck!

João Cardoso

unread,
Jul 5, 2014, 9:46:03 PM7/5/14
to


On Saturday, July 5, 2014 11:10:47 PM UTC+1, Rafael Ourique wrote:
First, let me quote this topic:

On Saturday, July 5, 2014 10:53:58 AM UTC-3, João Cardoso wrote:



But thanks for reporting back,  there has been 28 downloads of  Alt-F-0.1RC4-DNS-320L-rev-A1.bin and no report at all, so I didn't know if it was working or not!

The minimum needed for a box to work is to have disk and network access. But for me that does not means "supported", much more is need -- system temperature reading, automatic fan control, all buttons and leds working as expected... and from your report none of these seems to be right now!

So, the DNS-320L-rev-A1/A3 is not fully supported, but it works.

There are a lot of things to test, debug and fix, and most means trying and error, as I don't have such a box of my own, so instructions have to be followed, results reported back, doing another try/error cycle... all this taking days or weeks, depending on your technical expertise and linux experience.

Thanks for reporting back,
João




Well... i won't lie to you: i don't understand much of what you're saying BUT, if i can help in any way, just create a thread or mail me with what i should do, what should/shouldn't happen and what files i should send you for you to check if this works and i'll gladly do it next month (it's easier to do this on vacation).

Thanks.

The ore interesting log files are the System Log, Kernel Log and the System Configuration log, use System->Utils->Logs to get them (there is a Download and Filter button at the page bottom)

The System Configuration log contains the other two plus some other info, but it is generated at power up and important runtime info might be missing; to regenerate it use Services->User->user, hit the StartNow button and it will run once (will remain in the Stopped state afterwards).
 
for now, i'll revert to the "stock" firmware and try to start over. i messed with so many things that i don't even know what i'm doing on it anymore.

About the examples you used on the last post, here's my impressions of what is happening

Temperature reading: sysctrl service does not recognize the board it seems.

The easy way to see logs is to use System->Utilities->Logs. The hard way is to use the command line 'varlog'.
sysctrl should log fan/temperature: 'logread | grep sysctrl', or filter the System Log with sysctrl on System->Utilities->Logs, System Log
 
the status view, however, seems to detect the HD temperature and fan speed

Good, thanks.

In the DNS-320L there is a daemon called dns320l-daemon that keeps track of that ('ps' or System->Utilities->Logs->Running process).
It stores the temperature in /tmp/sys/temp1_input and the fan speed in /tmp/sys/fan1_input. So that is working!

sysctrl should read the temperature from /tmp/sys/temp1_input and write the desired fan speed (in 1..255 values) to  /tmp/sys/pwm1 (that the dns320l-daemon should read and actually control the fan).

This apparent complexity comes from D-Link using a second microcontroller where the fan and temperature are attached to.
 

check the images below

http://i.imgur.com/8Cj0dbY.png

OK, thanks again. That is a  webUI bug. sysctrl will use default values (as long as it recognizes the board)


ah, the system temperature is not right! And the disk temperature is too high!!!

If you haven't not yet flashed D-Link back, can you please execute the commands:


cat /tmp/sys/temp1_input | hexdump -C
echo -e 'GetTemperature\r' | nc 'local:/var/run/dns320l.socket' | hexdump -C

 


Fan control: This one almost drove me nuts last night: basically, the fan is working on "bursts": it plays full rotation (60000) for 10-20 seconds then it returns do 50% rotation (30000) for another 10-20 seconds. the noise is giving me a goddamned headache by the way.

sysctrl seems to be working, but badly... there are temperature trip points (off<->low, low<->high), and a 1 C margin (with hysteresis) around the trip points.

LEDs: the "power" led blinks when it's turning on and after that, all four (five if you count that below the "usb" button both the blue and orange leds are lit) are on 100% of the time.

From my counting its four leds (and seven colors): the power led, the two blue (or white) and the two orange disk leds, plus the white and orange USB led. Not right? Each disk and USB leds use to be a single led with two colors.

You have only one disk and nonetheless both disk white/blue leds are on? that is wrong.
 
since when the stock d-link firmware "formatted" the HD it created a RAID-something

RAID1 -- don't know why they did that, RAID1 only makes sense with at least two disks
 
that i'm 90% sure i did NOT asked and do NOT want, the red LEDs seems accurate enough

Yes,both orange leds sgould turn on when the RAID1 is in the degraded state (which it is, as there is only one disk)
Does the blue (or white) disk leds blinks when data is accessed from the disk?

 haven't tried messing with buttons or led functions. it isn't necessary for what i'm using it for

CPU Issue: the CPU usage also seems to have a problem: from time to time it goes on 100% CPU usage for no actual reason.

You don't know that, it might be some program that is running and does a periodic heavy check.
 
checking it with a putty terminal (top command, connected via ssh), it has shown that these spikes originated in transmission, but after i killed the process, it STILL gets some spikes now and then for no reason at all.

On a side note, i faced similar problems using transmission on fun_plug and deluged+deluge-web on debian squeeze. i'm a rather heavy torrent user (at least 300GB of data divided into 20 or 30 torrents), but that's too much! specially AFTER the verification for downloaded data has finished long ago. transmission even kept filling a log file with error messages so much it ended up with almost 5gb when i deleted it.
I have bad karma with these things :(

That's about it for now. i'll keep following the project and will return later.

Thanks for the report.
I hope that other DNS-320L users continue contributing in this thread, even if you don't return.

João
 

best of luck!

Ronaldo Antoni

unread,
Jul 7, 2014, 9:37:40 PM7/7/14
to
About DNS-320L (A2): 

Yes, the date is correct (via ntp); 
Other problems: 
-Does not display the temperature status; 
-The status displays as rev. A1 

Running hexdump-C / dev/event0 to press buttons on the NAS (usb and then on / off), the following message is displayed on the terminal:
[root@storage]# hexdump -C /dev/event0
00000000  39 4a bb 53 c6 61 0a 00  01 00 85 00 01 00 00 00  |9J.S.a..........|
00000010  39 4a bb 53 c6 61 0a 00  00 00 00 00 00 00 00 00  |9J.S.a..........|
00000020  39 4a bb 53 25 bd 0d 00  01 00 85 00 00 00 00 00  |9J.S%...........|
00000030  39 4a bb 53 25 bd 0d 00  00 00 00 00 00 00 00 00  |9J.S%...........|
alt-f.log
KernelLog.log
SystemLog.log
Message has been deleted

João Cardoso

unread,
Jul 7, 2014, 10:31:29 PM7/7/14
to al...@googlegroups.com


On Tuesday, July 8, 2014 2:37:40 AM UTC+1, Ronaldo Antoni wrote:
About DNS-320L (A2): 

Yes, the date is correct (via ntp); 


Yes, but it is not stored in the RCT on poweroff. This means that if you don't have internet then on powerup the date will probably be Jan 1, 1970.
This can be addressed latter.

Other problems: 
-Does not display the temperature status; 

Yes, this is the main issue. More on this bellow.

-The status displays as rev. A1 

The initial tests were made on a rev-A1, that it the reason. The A1/A2/A3 will probably be undistinguished, in the future the model/board will appear as "DNS-320L-A1A2A3"

 

Running hexdump-C / dev/event0 to press buttons on the NAS (usb and then on / off), the following message is displayed on the terminal:
[root@storage]# hexdump -C /dev/event0
00000000  39 4a bb 53 c6 61 0a 00  01 00 85 00 01 00 00 00  |9J.S.a..........|
00000010  39 4a bb 53 c6 61 0a 00  00 00 00 00 00 00 00 00  |9J.S.a..........|
00000020  39 4a bb 53 25 bd 0d 00  01 00 85 00 00 00 00 00  |9J.S%...........|
00000030  39 4a bb 53 25 bd 0d 00  00 00 00 00 00 00 00 00  |9J.S%...........|

Thanks. Together with the logs I have already a lot to work to do.

Does pressing the Power button powers off the box?
If not, the best way to shutdown or reboot the box is by using the commands 'poweroff' or 'reboot' from the command line; they will do a clean poweroff or shutdown (I hope)

From the logs I see that a critical process for the dns320l is not being run, it is named 'dns320l-daemon'.

Debugging this is going to be difficult. Do you have linux experience? I will assume that you don't have any linux experience, so forgive me if I'm too detailed.

Do you know how to edit files with 'vi'? If not you should probably install 'nano', use Packages->Alt-F.
Then use 'nano /etc/inittab' to edit /etc/inittab and comment (add a leading # at the line start) the line following '# DNS-320L MCU daemon':

before:
# DNS-320L MCU daemon
null::respawn:/usr/sbin/dns320l-daemon

after:
# DNS-320L MCU daemon
#null::respawn:/usr/sbin/dns320l-daemon

then exit the editor (you are asked to save the file, save it)

then execute the following commands

kill -1 1
killall dns320l
-daemon
rm
-f /var/run/dns320l.socket
dns320l-daemon -d >& /mnt/sda2/dns320l.log

wait some 30 seconds and hit the Control-C key. You should have a file named  /mnt/sda2/dns320l.log. Please attach it.

Thanks.

Ronaldo Antoni

unread,
Jul 8, 2014, 1:30:16 PM7/8/14
to al...@googlegroups.com
I have basic knowledge in linux (I use on my desktop) and in the past has worked with iptables + squid + sarg and others in the genre. 

Follows the requested log attached
dns320l.log

João Cardoso

unread,
Jul 8, 2014, 8:11:53 PM7/8/14
to al...@googlegroups.com


On Tuesday, July 8, 2014 6:30:16 PM UTC+1, Ronaldo Antoni wrote:
I have basic knowledge in linux (I use on my desktop) and in the past has worked with iptables + squid + sarg and others in the genre. 

Follows the requested log attached

Thanks. So the temperature is being correcly read from the MCU (the auxiliary micro-controller that reads temperature, drives the fan, reads the power button, stores the data/time, poweron and off the box, etc...)

Now I will ask you to open two ssh/telnet sessions to the box.

-In one of them you start stopping the sysctrl daemon using 'rcsysctrl stop' and run the 'dns320l-dameon -d' command watching the displayed output,

-on the other:
--  watch /tmp/sys/temp1_input using 'cat' -- does it follows the read temperature in the other session? As there might exists nonvisible characters, it's better using 'hexdump -C /tmp/sys/temp1_input'
-- try setting the fan speed using 'echo xx > /tmp/sys/pwm1', where xx=0 means stop the fan, less than 128 mean speed greater then 128 means full speed, and after each write read the value in /tmp/sys/fan1_input using cat and hexdump -C and also the output from the dns320l-daemon in the other session). The fan1_input should be 0, 3000 or 6000, depending on the pwm1 value written.
As newlines might matter, try also 'echo -n xx > /tmp/sys/pwm1'.

Please summarize the results and post the relevant outputs, including the hexdump -C output.

After diagnosing the issue I will attach an updated dns320l-daemon for you to try, if you agree.

This only deals with the temperature and fan, other issues will follow, it's better to not mixup things :-)

Thanks

Ronaldo Antoni

unread,
Jul 12, 2014, 10:01:17 PM7/12/14
to al...@googlegroups.com
Look what happens with sysctrl. After starting it, check the status and the process is stopped:

[root@storage]# rcsysctrl start
Starting sysctrl: OK.
[root@storage]# rcsysctrl status
sysctrl stopped

Response of the executed commands:
[root@storage]# cat /tmp/sys/temp1_input
24
[root@storage]# hexdump -C /tmp/sys/temp1_input
00000000  32 34                                             |24|
00000002
[root@storage]# 

[root@storage]# cat /tmp/sys/fan1_input
3000[root@storage]# hexdump -C /tmp/sys/fan1_input
00000000  33 30 30 30                                       |3000|
00000004
[root@storage]# 

The fan turns on and off periodically, does not seem to respond to commands, and did not notice anything different in output dns320l-daemon.

Another strange thing is that the 320L will not turn off, either by button or by command. Looks like he shuts down the system but can not turn off the hardware.



Ronaldo Antoni
(54)9979-8920


--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/alt-f/3d0ef095-3605-4070-9293-43dd067dfd48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

João Cardoso

unread,
Jul 16, 2014, 7:41:52 PM7/16/14
to


On Sunday, July 13, 2014 3:01:17 AM UTC+1, Ronaldo Antoni wrote:
Look what happens with sysctrl. After starting it, check the status and the process is stopped:

[root@storage]# rcsysctrl start
Starting sysctrl: OK.
[root@storage]# rcsysctrl status
sysctrl stopped

Response of the executed commands:
[root@storage]# cat /tmp/sys/temp1_input
24
[root@storage]# hexdump -C /tmp/sys/temp1_input
00000000  32 34                                             |24|
00000002
[root@storage]# 

[root@storage]# cat /tmp/sys/fan1_input
3000[root@storage]# hexdump -C /tmp/sys/fan1_input
00000000  33 30 30 30                                       |3000|
00000004
[root@storage]# 

hmm, the EOL (end of line) are missing. But that does not explains everything.
 

The fan turns on and off periodically, does not seem to respond to commands,

Have you tried using (stopping first the sysctrl daemon)

echo 255 > /tmp/sys/pwm1

and nothing appears in the dns320l-daemon output console? while it is running? odd...

 
and did not notice anything different in output dns320l-daemon.

Another strange thing is that the 320L will not turn off, either by button or by command. Looks like he shuts down the system but can not turn off the hardware.

Yes, besides the fan and temperature, powering off the box is also done my the MCU. For that and other purposes the dns320l-daemon supports a set od commands on its own.
To see waht commands are available use the following command in one console (having the 'dns320l-daemon -d' in execution in another console)

echo -e 'help\r' | nc local:/var/run/dns320l.socket


It should output

Available Commands2:

DeviceReady, DeviceShutdown, ShutdownDaemon, EnablePowerRecovery, DisablePowerRecovery, GetPowerRecoveryState, EnableWOL, DisableWOL, GetWOLState, SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, PowerLedBlink, ReadRtc, systohc, hctosys, GetTemperature, help, quit,

If you want to read the temperature, use

echo -e 'GetTemperature\r' | nc local:/var/run/dns320l.socket

if you want to blink the power led use

echo -e 'PowerLedBlink\r' | nc local:/var/run/dns320l.socket

To avoid the need to write all that you can define a function, e.g., defining the dns320l functions as follows

dns320l() {
echo
-e "$1\r" | nc local:/var/run/dns320l.socket
}

and now you just use

dns320l GetTemperature

to read the temperature, or

dns320l PowerLedOff

turn the power led off.

Can you please try to see if all available commands work?

Thanks

Ronaldo Antoni

unread,
Jul 17, 2014, 8:19:12 AM7/17/14
to Grupo Alt-F
Weekend do the tests and post the results. 
Have no forecast for RC5?

Ronaldo Antoni
(54)9979-8920


2014-07-16 20:41 GMT-03:00 João Cardoso <whoami...@gmail.com>:


On Sunday, July 13, 2014 3:01:17 AM UTC+1, Ronaldo Antoni wrote:
Look what happens with sysctrl. After starting it, check the status and the process is stopped:

[root@storage]# rcsysctrl start
Starting sysctrl: OK.
[root@storage]# rcsysctrl status
sysctrl stopped

Response of the executed commands:
[root@storage]# cat /tmp/sys/temp1_input
24
[root@storage]# hexdump -C /tmp/sys/temp1_input
00000000  32 34                                             |24|
00000002
[root@storage]# 

[root@storage]# cat /tmp/sys/fan1_input
3000[root@storage]# hexdump -C /tmp/sys/fan1_input
00000000  33 30 30 30                                       |3000|
00000004
[root@storage]# 
hmm, the EOL (end of line) are missing. But that does not explains everything.
 
The fan turns on and off periodically, does not seem to respond to commands,
Have you tried using (stopping first the sysctrl daemon)

echo 255 > /tmp/sys/pwm1

and nothing appears in the dns320l-daemon output console? odd...

 
and did not notice anything different in output dns320l-daemon.

Another strange thing is that the 320L will not turn off, either by button or by command. Looks like he shuts down the system but can not turn off the hardware.
Yes, besides the fan and temperature, powering off the box is also done my the MCU. For that and other purposes the dns320l-daemon supports a set od commands on its own.
To see waht commands are available use the following command in one console (having the 'dns320l-daemon -d' in execution in another console)

echo -e 'help\r' | nc local:/var/run/dns320l.socket


It should output

Available Commands2:

DeviceReady, DeviceShutdown, ShutdownDaemon, EnablePowerRecovery, DisablePowerRecovery, GetPowerRecoveryState, EnableWOL, DisableWOL, GetWOLState, SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, PowerLedBlink, ReadRtc, systohc, hctosys, GetTemperature, help, quit,

If you want to read the temperature, use

echo -e 'GetTemperature\r' | nc local:/var/run/dns320l.socket

if you want to blink the power led use

echo -e 'PowerLedBlink\r' | nc local:/var/run/dns320l.socket

To avoid the need to write all that you can define a function, e.g., defining the dns320l functions as follows

dns320l() {
echo
-e "$1\r" | nc local:/var/run/dns320l.socket
}

and now you just use

dns320l GetTemperature

to read the temperature, or

dns320l PowerLedOff

turn the power led off.

Can you please try to see if all available commands work?

Thanks

--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.

João Cardoso

unread,
Jul 18, 2014, 10:39:50 AM7/18/14
to


On Thursday, July 17, 2014 1:19:12 PM UTC+1, Ronaldo Antoni wrote:
Weekend do the tests and post the results. 

Great!
I attach [attachments deleted, as obsoleted, see posts bellow] two scripts that automate the tests. I tested them as possible, but can't be sure they will fully work on the dns320l.

The scripts follows the directions I gave in the previous post, and have instructions at its top:

# start first the dns320l-setup.sh script on one console window,
# keeping it open and the dns320l-daemon running,
# then start the dns320l-test.sh script on another window console.
#
# the logfile will have at maximum 32KB, so try to finish the test
# scripts fast, or the initial test output will be lost.

Essencially, you have to telnet/ssh the box as the 'root' user in two separate windows, start executing the dns320l-setup.sh in one of them and the dns320l-test.sh in another window; you will be asked for a folder on disk where to store the logs produced, and asked for a short comment after each command completes. The comment can be just "fan stopped", "power led not blinking", etc. If you have no comment just press <enter>.

Please attach (not inline) the log.
 
Have no forecast for RC5?

Not really.

Alt-F is pretty stable, the fixes system (System->Utilities->Fixes) seems to be working fine, packages updates can fix package errors or updates (only possible when I have the bandwidth to do that), no new features are planned... so there is no reason for a new release soon.

I can only release a special DNS320L release as soon as we fix the current issues, of course.

Obrigado,
João
 

Ronaldo Antoni

unread,
Jul 20, 2014, 4:28:02 PM7/20/14
to Grupo Alt-F
Just today I was able to perform the tests, but unable to run any script. Here are the errors returned:

[root@storage]# sh /dns320l-setup.sh
: not foundtup.sh: line 2: 
: not foundtup.sh: line 9: 
Ignoring signals from the shell
: invalid signal specification11: 2
: not foundtup.sh: line 12: 
Stopping sysctrl
Usage: /etc/init.d/S21sysctrl {start|stop|status|restart|reload}
: not foundtup.sh: line 15: 
Desactivating the dns320l-daemon
: No such file or directory
'h: invalid number '1
: not foundtup.sh: line 19: 
: no process killedemon
: not foundtup.sh: line 21: 
Starting the dns320l-daemon in debug mode. CTRL-C to stop
/dns320l-setup.sh: line 32: syntax error: unexpected end of file (expecting "then")
[root@storage]# 

[root@storage]# sh /dns320l-test.sh
: not foundst.sh: line 2: 
: not foundst.sh: line 9: 
dns320l-daemon: Testing 
'leep: invalid number '1
-ns320l-daemon: output of : -
': not a valid identifier
: not foundst.sh: line 18: sync
: not foundst.sh: line 19: }
: not foundst.sh: line 20: 
: not foundst.sh: line 22: 
/dns320l-test.sh: line 35: syntax error: unexpected word (expecting "do")
[root@storage]# 


Ronaldo Antoni
(54)9979-8920


2014-07-18 11:39 GMT-03:00 João Cardoso <whoami...@gmail.com>:


On Thursday, July 17, 2014 1:19:12 PM UTC+1, Ronaldo Antoni wrote:
Weekend do the tests and post the results. 

Great!
I attach two scripts that automate the tests. I tested them as possible, but can't be sure they will fully work on the dns320l.


The scripts follows the directions I gave in the previous post, and have instructions at its top:

# start first the dns320l-setup.sh script on one console window,
# keeping it open and the dns320l-daemon running,
# then start the dns320l-test.sh script on another window console.
#
# the logfile will have at maximum 32KB, so try to finish the test
# scripts fast, or the initial test output will be lost.

Essencially, you have to telnet/ssh the box as the 'root' user in two separate windows, start executing the dns320l-setup.sh in one of them and the dns320l-test.sh in another window; you will be asked for a folder on disk where to store the logs produced, and asked for a short comment after each command completes. The comment can be just "fan stopped", "power led not blinking", etc. If you have no comment just press <enter>.

Please attach (not inline) the log.
 
Have no forecast for RC5?

Not really.

Alt-F is pretty stable, the fixes system (System->Utilities->Fixes) seems to be working fine, packages updates can fix package errors or updates (only possible when I have the bandwidth to do that), no new features are planned... so there is no reason for a new release soon.

I can only release a special DNS320L release as soon as we fix the current issues, of course.

Obrigado,
João
 

--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.

João Cardoso

unread,
Jul 20, 2014, 5:21:18 PM7/20/14
to al...@googlegroups.com


On Sunday, July 20, 2014 9:28:02 PM UTC+1, Ronaldo Antoni wrote:
Just today I was able to perform the tests, but unable to run any script. Here are the errors returned:

 
Have you used/viewed/edited the file under MS-Windows? That's the only explanation -- I just downloaded the dns320l-setup.sh and it runs correctly

Then I even downloaded them directly from the box using the attachment links:



Ronaldo Antoni

unread,
Jul 20, 2014, 7:07:13 PM7/20/14
to Grupo Alt-F
I do not use windows. I had to give execute permission in scrips. 

Attached is the log of scripts!

Ronaldo Antoni
(54)9979-8920


--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.
dns320l-test.log

João Cardoso

unread,
Jul 21, 2014, 11:47:32 AM7/21/14
to al...@googlegroups.com


On Monday, July 21, 2014 12:07:13 AM UTC+1, Ronaldo Antoni wrote:
I do not use windows. I had to give execute permission in scrips. 

Attached is the log of scripts!

Obrigado Ronaldo!

Everything seems to be working fine, with two exceptions, the Fan Low Speed and Fan Full Speed command seem to be exchanged, according to your comments. We have to confirm this latter.

Also some of your comments seems unrelated to the command under execution, e.g., "Comments on systohc: high speed fan". This might be a coincidence, so I will ignore your comment for now.

I will make some changes to the dns320l-daemon and sysctrl and ask for your cooperation again.
Keep alert.

Meanwhile, thanks a lot for your work.
João


The digested log results, inlined:


dns320l-daemon[2427]: bind
dns320l-daemon[2438]: Bind name to ls.
dns320l-daemon[2438]: Listen on ls for connections.
dns320l-daemon[2438]: Server startup success on /var/run/dns320l.socket
dns320l-daemon[2438]: dns320l-daemon startup complete, going to FanControl mode

dns320l-daemon: Testing GetTemperature
dns320l-daemon: output of GetTemperature: -24-
dns320l-daemon: Comments on GetTemperature: nada

dns320l-daemon: Testing SetFanStop
dns320l-daemon: output of SetFanStop: -OK-
dns320l-daemon: Comments on SetFanStop: fan stop

dns320l-daemon: Testing SetFanHalf
dns320l-daemon: output of SetFanHalf: -OK-
dns320l-daemon: Comments on SetFanHalf: medium speed fan (isn't this exchanged with SetFanFull?)

dns320l-daemon: Testing SetFanFull
dns320l-daemon: output of SetFanFull: -OK-
dns320l-daemon: Comments on SetFanFull: low speed fan (isn't this exchanged with SetFanHalf?)

dns320l-daemon: Testing PowerLedOn
dns320l-daemon: output of PowerLedOn: -OK-
dns320l-daemon: Comments on PowerLedOn: nada

dns320l-daemon: Testing PowerLedOff
dns320l-daemon: output of PowerLedOff: -OK-
dns320l-daemon: Comments on PowerLedOff: led off

dns320l-daemon: Testing PowerLedBlink
dns320l-daemon: output of PowerLedBlink: -OK-
dns320l-daemon: Comments on PowerLedBlink: led blinks

dns320l-daemon: Testing EnablePowerRecovery
dns320l-daemon: output of EnablePowerRecovery: -OK-
dns320l-daemon: Comments on EnablePowerRecovery: nada

dns320l-daemon: Testing GetPowerRecoveryState
dns320l-daemon: output of GetPowerRecoveryState: -128-
dns320l-daemon: Comments on GetPowerRecoveryState: fan reduced speed (probably stray event)

dns320l-daemon: Testing DisablePowerRecovery
dns320l-daemon: output of DisablePowerRecovery: -OK-
dns320l-daemon: Comments on DisablePowerRecovery: nada

dns320l-daemon: Testing GetPowerRecoveryState
dns320l-daemon: output of GetPowerRecoveryState: -0-
dns320l-daemon: Comments on GetPowerRecoveryState: nada

dns320l-daemon: Testing EnableWOL
dns320l-daemon: output of EnableWOL: -OK-
dns320l-daemon: Comments on EnableWOL: nada

dns320l-daemon: Testing GetWOLState
dns320l-daemon: output of GetWOLState: -1-
dns320l-daemon: Comments on GetWOLState: nada

dns320l-daemon: Testing DisableWOL
dns320l-daemon: output of DisableWOL: -OK-
dns320l-daemon: Comments on DisableWOL: nada

dns320l-daemon: Testing GetWOLState
dns320l-daemon: output of GetWOLState: -0-
dns320l-daemon: Comments on GetWOLState: nada

dns320l-daemon: Testing ReadRtc
dns320l-daemon: output of ReadRtc: -RTC: Sun Jul 20 20:03:42 2014-
dns320l-daemon: Comments on ReadRtc: corret date

dns320l-daemon: Testing systohc
dns320l-daemon: output of systohc: -OK-
dns320l-daemon: Comments on systohc: high speed fan (probably stray event)

dns320l-daemon: Testing hctosys
dns320l-daemon: output of hctosys: -RTC: Sun Jul 20 20:04:00 2014 Sys: Sun Jul 20 20:04:01 2014 Diff: 1s-
 (does a newline exists at the end of each RTC/Sys/Diff?)
dns320l-daemon: Comments on hctosys: nada

dns320l-daemon: Testing DeviceReady
dns320l-daemon: output of DeviceReady: -OK-
dns320l-daemon: Comments on DeviceReady:

dns320l-daemon: Testing ShutdownDaemon
dns320l-daemon[2438]: Shutting down dns320l-daemon...
dns320l-daemon: output of ShutdownDaemon: -OK-
dns320l-daemon: Comments on ShutdownDaemon: concluded

init: starting pid 2642, tty '/dev/null': '/usr/sbin/dns320l-daemon'
dns320l-daemon[2644]: Server startup success on /var/run/dns320l.socket
dns320l-daemon[2644]: dns320l-daemon startup complete, going to FanControl mode
init: process '/usr/sbin/dns320l-daemon' (pid 2642) exited. Scheduling for restart.
init: starting pid 2659, tty '/dev/null': '/usr/sbin/dns320l-daemon'
dns320l-daemon[2660]: bind
init: process '/usr/sbin/dns320l-daemon' (pid 2659) exited. Scheduling for restart.
init: starting pid 2661, tty '/dev/null': '/usr/sbin/dns320l-daemon'
dns320l-daemon[2662]: bind
init: process '/usr/sbin/dns320l-daemon' (pid 2661) exited. Scheduling for restart.
init: starting pid 2663, tty '/dev/null': '/usr/sbin/dns320l-daemon'

 

Ronaldo Antoni
(54)9979-8920


Ronaldo Antoni

unread,
Jul 21, 2014, 12:39:07 PM7/21/14
to Grupo Alt-F
the cooler is constantly switching speed, so it may have no function in relation to the script. By commands from another forum post here, I could not control it!

Ronaldo Antoni
(54)9979-8920


--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.

Henrik Bruening

unread,
Jul 24, 2014, 3:39:12 PM7/24/14
to al...@googlegroups.com
hey guys just in case more testers needed... got Alt-F installed on a DNS 320L A2
and guess what... got the same spindown/up issue...

by the way: according to the webinterface sysctrl is not running - after starting it shuts itself down automatically...
the only way to get rid of the spinups was to run a 

echo -e 'SetFanHalf\r' | nc local:/var/run/dns320l.socket

via a script every second

João Cardoso

unread,
Jul 24, 2014, 5:06:43 PM7/24/14
to al...@googlegroups.com


On Thursday, July 24, 2014 8:39:12 PM UTC+1, Henrik Bruening wrote:
hey guys just in case more testers needed...

Hey Henrik, testers are always welcome :)
 
got Alt-F installed on a DNS 320L A2
and guess what... got the same spindown/up issue...

by the way: according to the webinterface sysctrl is not running - after starting it shuts itself down automatically...
the only way to get rid of the spinups was to run a 

echo -e 'SetFanHalf\r' | nc local:/var/run/dns320l.socket

Yes, that's a simple "cure" for the issue. If sysctrl if not stopped (there is a fix for that), stop it and execute that command.
You can eventually make a simple fan on-off control script, something like

tp_low=44
tp_high=46

temp=$(echo -e 'GetTemperature\r' | nc local:/var/run/dns320l.socket)
if test "$temp" -gt "%tp_high"; then

   echo -e 'SetFanHalf\r' | nc local:/var/run/dns320l.socket
elif test "$temp" -lt "%tp_low"; then
   echo -e 'SetFanStop\r' | nc local:/var/run/dns320l.socket
fi

I'm working on the issue and I think that I have it trapped.
Today or tomorrow I will make a post with new sysctrl and dns320l-daemon binaries and test scripts.

Henrik Bruening

unread,
Jul 24, 2014, 5:54:53 PM7/24/14
to al...@googlegroups.com
cool!!! awaiting your update then
 

João Cardoso

unread,
Jul 25, 2014, 12:05:49 PM7/25/14
to
Hi,

I attach a new set of tests for the dns320L. [Attachement deleted as obsolete, see posts bellow]

You should transfer the attached dns320l.test.tar.gz to the box, for example to the /root or /tmp folder (not on disk!) and extract it: eg:

scp dns320l.test.tar.gz root@dns-323:/tmp

then login as root into the box and

cd /tmp
tar -xvzf dns320l.test.tar.gz
./dns320l-setup.sh

and keep it running. Open a new session to the box on a new window and

cd /tmp
./dns320l-test.sh


When the dns320l-test script finish you will find the log in the disk, e.g., under /mnt/sda2/dns320l-test.log


The comments on top of the sh script says:

# start first the dns320l-setup.sh script on one console window,
# keeping it open and the dns320l-daemon running,
# then start the dns320l-test.sh script on another window console.
#
# the logfile will have at maximum 32KB, so try to finish the test
# scripts fast, or the initial test output will be lost.
#
# Be sure to run the dns320l-test.sh script twice, first without testing
# the power-off mode, save the log under other name, then a second time.
#
# the powerdown test implies pressing the power button and releasing it twice.
# I expect the power led to start binking for the first press, and
# turn to solid on after release, and that only on the second button press
# the box will shut down. This has to be observed, it is not registed in then
# log, as filesystems are mounted read-only durint the test to prevent a
# lengly fsck at power up.

Please attach (not inline) the log and post your notes on the powerdown sequence attempt and fan control.

If you find that fan control is working OK when those two binaries are running, you can copy the dns320l-daemon and sysctrl to /usr/sbin.
Notice that as soon as the test finish the system dns320l-daemon and sysctrl will be re-activated, you will have to kill them and start the supplied ones.

Thanks
Joao



Ronaldo Antoni

unread,
Jul 25, 2014, 1:55:38 PM7/25/14
to Grupo Alt-F
Ran the script and am attaching the log. 
I'll put the binaries running and post the results later!


Ronaldo Antoni
(54)9979-8920


2014-07-25 13:05 GMT-03:00 João Cardoso <whoami...@gmail.com>:
Hi,

I attach a new set of tests for the dns320L.
You should transfer the attached dns320l.test.tar.gz to the box, for example to the /root or /tmp folder (not on disk!) and extract it: eg:

scp dns320l.test.tar.gz root@dns-323:/tmp

then login as root into the box and

cd /tmp
tar -xvzf dns320l.test.tar.gz
./dns320l-setup.sh

and keep it running. Open a new session to the box on a new window and

cd /tmp
./dns320l-test.sh


When the dns320l-test script finish you will find the log in the disk, e.g., under /mnt/sda2/dns320l-test.log

The comments on top of the sh script says:

# start first the dns320l-setup.sh script on one console window,
# keeping it open and the dns320l-daemon running,
# then start the dns320l-test.sh script on another window console.
#
# the logfile will have at maximum 32KB, so try to finish the test
# scripts fast, or the initial test output will be lost.
#
# Be sure to run the dns320l-test.sh script twice, first without testing
# the power-off mode, save the log under other name, then a second time.
#
# the powerdown test implies pressing the power button and releasing it twice.
# I expect the power led to start binking for the first press, and
# turn to solid on after release, and that only on the second button press
# the box will shut down. This has to be observed, it is not registed in then
# log, as filesystems are mounted read-only durint the test to prevent a
# lengly fsck at power up.

Please attach (not inline) the log and post your notes on the powerdown sequence attempt and fan control.

If you find that fan control is working OK when those two binaries are running, you can copy the dns320l-damemon and sysctrl to /usr/sbin.

Thanks
Joao



--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.
dns320l-test.log

Ronaldo Antoni

unread,
Jul 25, 2014, 2:12:57 PM7/25/14
to Grupo Alt-F
Please find attached a print of my dns-320L (A2) the status screen, along with some considerations: 
a) the status screen does not display the teperatura; 
b) the script does not solve the problem of the cooler; 

I take this post to a question: my hard drive was formatted and loaded with new firmware dlink. Now I see that it has 4 partitions, including swap. My question is: can I remove the remaining partitions and leave only containing data?

Ronaldo Antoni
(54)9979-8920


2014-07-25 13:05 GMT-03:00 João Cardoso <whoami...@gmail.com>:
Hi,

I attach a new set of tests for the dns320L.
You should transfer the attached dns320l.test.tar.gz to the box, for example to the /root or /tmp folder (not on disk!) and extract it: eg:

scp dns320l.test.tar.gz root@dns-323:/tmp

then login as root into the box and

cd /tmp
tar -xvzf dns320l.test.tar.gz
./dns320l-setup.sh

and keep it running. Open a new session to the box on a new window and

cd /tmp
./dns320l-test.sh


When the dns320l-test script finish you will find the log in the disk, e.g., under /mnt/sda2/dns320l-test.log

The comments on top of the sh script says:

# start first the dns320l-setup.sh script on one console window,
# keeping it open and the dns320l-daemon running,
# then start the dns320l-test.sh script on another window console.
#
# the logfile will have at maximum 32KB, so try to finish the test
# scripts fast, or the initial test output will be lost.
#
# Be sure to run the dns320l-test.sh script twice, first without testing
# the power-off mode, save the log under other name, then a second time.
#
# the powerdown test implies pressing the power button and releasing it twice.
# I expect the power led to start binking for the first press, and
# turn to solid on after release, and that only on the second button press
# the box will shut down. This has to be observed, it is not registed in then
# log, as filesystems are mounted read-only durint the test to prevent a
# lengly fsck at power up.

Please attach (not inline) the log and post your notes on the powerdown sequence attempt and fan control.

If you find that fan control is working OK when those two binaries are running, you can copy the dns320l-damemon and sysctrl to /usr/sbin.

Thanks
Joao



--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.

Henrik Bruening

unread,
Jul 25, 2014, 3:01:55 PM7/25/14
to al...@googlegroups.com
Same here, as a log has been uploaded already I just let you my findings with the new files moved to /usr/sbin:

Same behavior as before... Spin up/down :( so no improvement

To answer the had partition question: In case u don't plan to go back 2 dlink fw you can do whatever you want with the Xtra partitions - if you want to keep your data if u install original fw again: Don't touch them. Just my 2 cents

João Cardoso

unread,
Jul 25, 2014, 5:49:46 PM7/25/14
to


On Friday, July 25, 2014 8:01:55 PM UTC+1, Henrik Bruening wrote:
Same here, as a log has been uploaded already I just let you my findings with the new files moved to /usr/sbin:

Same behavior as before... Spin up/down :( so no improvement

Thanks guys, but you missed a point: the powerdown command. More on that latter.

As there is no possibility of writing a script for debugging, you have to understand what is involved.
The following commands only make sense if executed in the /tmp folder, where the dns320l.test.tar.gz was extracted.

On the dns320L, the 'init' process launches the /usr/sbin/dns320l-daemon, and if it terminates or is killed init will launch it again.
To temporarily disable this, which is needed, use the following code segment:

# disable init from launching dns320-daemon, and terminate it
sed -i 's/\(.*dns320l-daemon.*\)/#\1/' /etc/inittab

kill -1 1
killall dns320l-daemon

To reenable init launching /usr/sbin/dns320l-daemon, use the following code segment

# allow init to launch the dns320-daemon
sed -i 's/^[#]*[[:space:]]*\(.*dns320l-daemon.*\)/\1/' /etc/inittab
kill -1 1

The systems fan, temperature, etc control daemon is called sysctrl, and, on the dns320L it interact with the dns320l-daemon.
Here are code segments to start, stop and get its status:

# stop a running sysctr:
rcsysctrl stop

# start a new /usr/sbin/sysctrl
rcsysctrl start

# get the status of sysctrl
rcsysctrl status

The dns320l-daemon must be started in debug mode in one console window and let it running, while we perform the tests on another console window. We might have to take a look at the window where it was invoked, to see what it logs.

# start the dns320l-daemon on a window and let it running
./dns320l-daemon -d

To communicate with the running dns320l-daemon, one has to sent it a command using

# send CMD to the running dns320l-daemon:
echo -e "CMD\r" | nc local:/var/run/dns320l.socket

Where CMD can be any of:
        GetTemperature DeviceReady
        SetFanStop SetFanHalf SetFanFull
        PowerLedOff PowerLedOn PowerLedBlink
        EnablePowerRecovery DisablePowerRecovery GetPowerRecoveryState
        EnableWOL DisableWOL GetWOLState
        ReadRtc systohc hctosys
       

The dns320l-daemon and sysctrl itself communicate across a set of files located at /tmp/sys:


/tmp/sys/fan1_input : dns320l-daemon writes the current fan speed, sysctrl reads it. Can be 0, 3000 or 6000
/tmp/sys/pwm1  : sysctrl writes the desired fan speed, dns320l-daemon reads it. Can be 0 - stopped,  127 medium speed, 255 full speed
/tmp/sys/temp1_input : the dns320l-daemon writes the system temperature in milli Celsius, sysctrl reads it.



issue 1: fan control

From the logs, I see that dns320l-daemon is reading a wrong pwm:
dns320l-daemon[1624]: Read Temperature: -25000-
dns320l-daemon[1624]: Reading pwm1: --1092236064-
dns320l-daemon[1624]: writing fan1: -3000-

To see what the culprit is, using the above code segments do:

1-a) is dns320l-daemon the culprit? run it alone:

-stop sysctrl
-disable init from launching /usr/sbin/dns320l-daemon
-start './dns320l-daemon -d' from the local folder
-use each of these commands and watch what the dns320l-daemon reports in its window:

echo 0 > /tmp/sys/pwm1 # should report reading a -0- and the fan should stop
cat /tmp/sys/fan1_input # should output 0

echo 127 > /tmp/sys/pwm1 # should report reading a -127- and the fan should go medium speed
cat /tmp/sys/fan1_input # should output 3000

echo 255 > /tmp/sys/pwm1 # should report reading a -255- and the fan should go full speed
cat /tmp/sys/fan1_input # should output 6000

What do you see?

1-b) is sysctrl the culprit? run it alone

-stop sysctrl
-disable init from launching /usr/sbin/dns320l-daemon
-start watching the system log in one window using 'logread -f'
-start './sysctrl' from the local folder in another window.
-use each of these commands and watch the output of the 'logread -f' window regarding sysctrl.

Remember that sysctrl only logs every 30 seconds and only when there are temperature changes (or other event). Also the reported temperature is a running average of the last readings, so it will not show the temperature that you set, instead it will slowly converge to the set value.
The values used bellow, 10, 42 and 50 should be OK, but it depends on what you set under Services->System->sysctrl Configure.

# simulate a temperature of 10 degrees Celsius to sysctrl
echo 10000 > /tmp/sys/temp1_input
cat /tmp/sys/pwm1 # should be '0',meaning sysctrl wants to stop the fan
cat /tmp/sys/fan1_input # this is the same value that sysctrl will log

# simulate a temperature of 42 degrees Celsius to sysctrl
echo 42000 > /tmp/sys/temp1_input
cat /tmp/sys/pwm1 # should be '127',meaning sysctrl wants the fan at medium speed
cat /tmp/sys/fan1_input # this is the same value that sysctrl will log. should see no change

# simulate a temperature of 50 degrees Celsius to sysctrl
echo 50000 > /tmp/sys/temp1_input
cat /tmp/sys/pwm1 # should be '255',meaning sysctrl wants
the fan at full speed
cat /tmp/sys/fan1_input # this is the same value that sysctrl will log.
should see no change


issue 2: powerdown

To powerdown a dns320L, the DeviceShutdown
command has to be sent to the dns320l-daemon.
The dns320l power button is read by the dns320l-daemon, which should log "Power Button Pressed!", "Power Button Released!"
No other action is taken by the daemon when the power button is pressed, namely no DeviceShutdown command is executed.

The question here is to know what sequence of commands can/shall be sent, if the box power led starts blinking by itself when the power button is pressed, and if the powerdown sequence can be aborted.

Testing this causes some problems, namely we run the risk of an unclean shutdown, which mean a possibly lengthy fsck at the next reboot. So the ideal is to do all this tests without having disks in the box. Or, at least, to remount the filesystems in read-only mode. As before, the tests should be done at the /tmp directory where the new dns320l-daemon lies

# remount all disk filesystems in read-only mode:
sync
for i in $(awk '/(ext2|ext3|ext4|vfat|ntfs)/{print $1}' /proc/mounts); do
  mount -o remount,ro $i
done
mount # verify by inspection that the /mnt/xxx filesystems are mounted ro and not rw


When the tests are finished we can remount the filesystem in read-write mode using the following command sequence (assuming that the box has not power down :-()

# remount all disk filesystems in read-write mode:
for i in $(awk '/(ext2|ext3|ext4|vfat|ntfs)/{print $1}' /proc/mounts); do
  mount -o remount,rw $i
done


Using the appropriate code sequences, do:

-remount fs in read-only mode (or work without disks inserted)
-disable init from launching /usr/sbin/dns320l-daemon
-stop sysctrl
-start './dns320l-daemon -d' from the local folder
-Press the box power button and watch what the dns320l-daemon reports in its window (Button pressed?) and if the power led starts blinking (expect yes)
-Wait a couple of seconds, then release the power button. Does the dns320l-daemon reports in its window "Button released?" does the power led stops blinking? Does the box powers down? If not, continue.
-send the DeviceReady command to the dns320l-daemon -- does the power led stops blinking?
-wait a minute or two to see if the power down sequence has been aborted, then repeat the above button press/release sequence
-This time send the DeviceShutdown command to the dns320l-daemon -- does the power led stops blinking and the box powers down? Immediately or after a delay?

Got it?

Issue 3: back buttons

how many does the box has? one USB button? one recessed reset button? more? Need to know what events they trigger when pressed

To continue -- that's mostly what is missing.

Thanks.

Henrik Bruening

unread,
Jul 25, 2014, 6:49:24 PM7/25/14
to al...@googlegroups.com


issue 1: fan control

From the logs, I see that dns320l-daemon is reading a wrong pwm. To see what is the culprit, using the above code segments do:

-stop sysctrl
-disable init from launching dns320l-daemon
-start ./dns320l-daemon -d

-use each of these commands and watch what the dns320l-daemon reports in its window:

echo 0 > /tmp/sys/pwm1 # should report reading a -0- and the fan should stop
cat /tmp/sys/fan1_input # should output 0

echo 127 > /tmp/sys/pwm1 # should report reading a -127- and the fan should go medium speed
cat /tmp/sys/fan1_input # should output 3000

echo 255 > /tmp/sys/pwm1 # should report reading a -0- and the fan should go full speed

cat /tmp/sys/fan1_input # should output 6000

What do you see?

All works as expected  even the correct pwm was read BUT just one issue i saw:
is it a wanted behavior thar sysctrl is just closing itself as soon as it has been started?

[root@DNS320]# rcsysctrl start
Starting sysctrl: OK.
[root@DNS320]# rcsysctrl status
sysctrl stopped


unfortunally i had to plug the powercable to reboot the server as telnet reboot and WebUI reboot did not restart the machine that's why my fanscript was still running now my spindown/up issues are solved as well... i just need to heat the NAS up a lil to see if the fan is ever switching to fullspeed

 
issue 2: powerdown

To be continue tomorrow



Henrik Bruening

unread,
Jul 25, 2014, 7:06:49 PM7/25/14
to al...@googlegroups.com
stop... after another reboot all issues are back
my shortterm solution is a script in inet.d like this

kill -1 1
killall dns320l-daemon
rcsysctrl stop
/usr/sbin/./dns320l-daemon
rcsysctrl start

now even temp in Webui is correctly displayed
BUT sysctrl is still not running properly

João Cardoso

unread,
Jul 26, 2014, 10:57:31 AM7/26/14
to


On Friday, July 25, 2014 11:49:24 PM UTC+1, Henrik Bruening wrote:


issue 1: fan control

From the logs, I see that dns320l-daemon is reading a wrong pwm. To see what is the culprit, using the above code segments do:

-stop sysctrl
-disable init from launching dns320l-daemon
-start ./dns320l-daemon -d
-use each of these commands and watch what the dns320l-daemon reports in its window:

echo 0 > /tmp/sys/pwm1 # should report reading a -0- and the fan should stop
cat /tmp/sys/fan1_input # should output 0
 
echo 127 > /tmp/sys/pwm1 # should report reading a -127- and the fan should go medium speed
cat /tmp/sys/fan1_input # should output 3000

echo 255 > /tmp/sys/pwm1 # should report reading a -0- and the fan should go full speed
cat /tmp/sys/fan1_input # should output 6000

What do you see?

All works as expected  even the correct pwm was read

Then the issue is at the sysctrl  side, as Ronaldo logs show:


dns320l-daemon[1624]: Read Temperature: -25000-
dns320l-daemon[1624]: Reading pwm1: --1092236064-
dns320l-daemon[1624]: writing fan1: -3000-

Hope that you have used the right commands, namedly staring the dns320l-daemon using './dns320l-daemon -d' in the /tmp directory where the dns320l.test.tar.gz was extracted, and that you stopped your 1sec fanscript task.

Anyway I will continue editing the post that originate your's, adding the sysctrl side of testing.

BUT just one issue i saw:
is it a wanted behavior thar sysctrl is just closing itself as soon as it has been started?

No. This is

issue 3: sysctrl stops after being started

 

[root@DNS320]# rcsysctrl start
Starting sysctrl: OK.
[root@DNS320]# rcsysctrl status
sysctrl stopped



To see what happens to sysctrl, watch the output of the system log using the command 'logread' or 'logread -f' to show only new events.
Also remember that we are testing the new sysctrl, the one that you should start using the ./sysctrl' command in the /tmp dir. The './' is very importants, as it executes commands in your current directory, not one from the systems directory.
Using 'rcsysctrl' uses the sysctrl from /usr/sbin/sysctrl, the one shipped with the firmware, and we are not interested in it.

Sysctrl logs at start and then every 30 seconds if the temperature has changed (or other event occurred)
Please post the logread output after sysctrl starts.

João Cardoso

unread,
Jul 26, 2014, 11:11:23 AM7/26/14
to al...@googlegroups.com


On Saturday, July 26, 2014 12:06:49 AM UTC+1, Henrik Bruening wrote:
stop... after another reboot all issues are back

Of course.

You are not running a disk-based system, Alt-F runs in memory, so your changes might be lost after a reboot. Not always, read the How to costumize the firmware wiki. But please, when doing our tests be sure that your changes are not influencing the tests.

 
my shortterm solution is a script in inet.d like this

kill -1 1

This make no sense alone. This signals the init process that its configuration file, /etc/inittab, has been changed and that init should re-read it.
 
killall dns320l-daemon
rcsysctrl stop
/usr/sbin/./dns320l-daemon

If you expect this to be the new daemon you *might* be wrong.

rcsysctrl start

This, together with the previous rcsysctrl stop does not make sense. Stopping it to restart it again? Why?

now even temp in Webui is correctly displayed

When we make many changes things *might* start working, but we don't know *what* makes it work, and worse, we can't replicate it latter.
 

Henrik Bruening

unread,
Jul 26, 2014, 2:15:36 PM7/26/14
to al...@googlegroups.com
Okay you may be right about the kill -1 1 part
But for the rest one more point: I copied the new daemon and sysctrl to /usr/sbin as you said in an earlier post so as long as this does survive a reboot my script should be using the new files - or not???
regarding the other question if I really use the correct commands:
I did a copy paste from your instructions and that's why I'm sure that my output was correct as well.
I monitored temp and fan now for 18 hours and everything is running correct now - temperature is read correctly and fan speed is set correctly as well.

João Cardoso

unread,
Jul 26, 2014, 7:32:03 PM7/26/14
to


On Saturday, July 26, 2014 7:15:36 PM UTC+1, Henrik Bruening wrote:
Okay you may be right about the kill -1 1 part
But for the rest one more point: I copied the new daemon and sysctrl to /usr/sbin as you said in an earlier post

having the care of first stopping the system's sysctrl and dns320l-daemon
 
so as long as this does survive a reboot

t depends if the /Alt-F/usr/sbin folder exists, i.e.,if you have installed any Alt-F package and if aufs is active.
But  this can also be customized in another way, copy the new binaries to some location on disk and use the user boot script to copy them to the /usr/sbin/ directory. user script to run at power up: Services->User->user Configure
But the system dns320l-daemon and sysctrl should be already running, so before the copy operation one has to stop them.
Discussing this deserves a new topic to not mix things.
 
my script should be using the new files

Yes.
 
- or not???
 regarding the other question if I really use the correct commands:
I did a copy paste from your instructions and that's why I'm sure that my output was correct as well.
I monitored temp and fan now for 18 hours and everything is running correct now - temperature is read correctly and fan speed is set correctly  as well.

Great! So after all the sysctrl and dns320l-daemon I sent are working fine together.

Or are you using your fanspeed script together with both the new sysctrl and new dns320l-daemon? That would invalidate the results.

I apologize for being so careful, but as Inglish is not my mother language, that can be a source of problems.

So we only have now to test the box powerdown. I will continue adding/editing my post above with the instructions.

Thanks!
Joao

Henrik Bruening

unread,
Jul 27, 2014, 6:38:19 AM7/27/14
to al...@googlegroups.com
just one more question:
is it still possible in the RC4 to manually set the high and low fan speeds via 
lo_fan="2000"
hi_fan="4000"
 in /etc/sysctrl.config ???

Am Sonntag, 27. Juli 2014 01:32:03 UTC+2 schrieb João Cardoso:


On Saturday, July 26, 2014 7:15:36 PM UTC+1, Henrik Bruening wrote:
Okay you may be right about the kill -1 1 part
But for the rest one more point: I copied the new daemon and sysctrl to /usr/sbin as you said in an earlier post
having the care of first stopping the system's sysctrl and dns320l-daemon
 
so as long as this does survive a reboot

t depends if the /Alt-F/usr/sbin folder exists, i.e.,if you have installed any Alt-F package and if aufs is active.
But  this can also be customized in another way, copy the new binaries to some location on disk and use the user boot script to copy them to the /usr/sbin/ directory. user script to run at power up: Services->User->user Configure
But the system dns320l-daemon and sysctrl should be already running, so before the copy operation one has to stop them.
Discussing this deserves a new topic to not mix things.
 
my script should be using the new files

Yes.
 
- or not???
 regarding the other question if I really use the correct commands:
I did a copy paste from your instructions and that's why I'm sure that my output was correct as well.
I monitored temp and fan now for 18 hours and everything is running correct now - temperature is read correctly and fan speed is set correctly  as well.

João Cardoso

unread,
Jul 27, 2014, 9:10:08 AM7/27/14
to al...@googlegroups.com


On Sunday, July 27, 2014 11:38:19 AM UTC+1, Henrik Bruening wrote:
just one more question:
is it still possible in the RC4 to manually set the high and low fan speeds via 
lo_fan="2000"
hi_fan="4000"
 in /etc/sysctrl.config ???

Yes, using an unix compatible editor.
The currently running sysctrl will notice the change and apply them immediately.
You can see that watching 'logread' output:

Jul 27 14:04:17 DNS-323 daemon.info sysctrl: reading /etc/sysctrl.conf

sysctrl will also dump to syslog its current configuration if it receives a SIGUSR1 signal:

kill -USR1 $(pidof sysctrl)

and using logread you will see:

Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.lo_fan=2000
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.hi_fan=5000
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.lo_temp=40
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.hi_temp=50
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.mail=1
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.recovery=1
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.fan_off_temp=40
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.max_fan_speed=6000
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.crit_temp=60
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.warn_temp=52
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.crit_temp_command="/sbin/poweroff"
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.warn_temp_command="(null)"
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.front_button_command1="(null)"
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.front_button_command2="(null)"
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: args.back_button_command="(null)"
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: sdb left rdwr=0 last=0 spindow=1200 power=0
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: sda right rdwr=0 last=0 spindow=1200 power=1
Jul 27 14:03:40 DNS-323 daemon.info sysctrl: (null) (null) rdwr=0 last=0 spindow=1200 power=1

Or, after applying the necessary fixes (System->Utilities->Fixes), you can use the sysctrl webUI (Services->System->sysctrl Configure) to perform the changes.

Yes, Alt-F "propaganda" is not fake:

Alt-F also has a set of comprehensive administering web pages, you don't need to use the command line to configure it

Great! So after all the new sysctrl and dns320l-daemon I sent are working fine together.


Or are you using your fanspeed script together with both the new sysctrl and new dns320l-daemon? That would invalidate the results.

Can you please be so kind to answer that?
 

So we only have now to test the box powerdown. I will continue adding/editing my post above with the instructions.

Aren't you going to test the powerdown issue? I would appreciate that.
I have updated https://groups.google.com/d/msg/alt-f/sYs0Y__xCh0/tD2ye-lj-o8J

Thanks!
Joao

Henrik Bruening

unread,
Jul 27, 2014, 1:01:06 PM7/27/14
to al...@googlegroups.com
for the powerdown stuff i'll test it tomorrow and let you know my findings

Henrik Bruening

unread,
Jul 30, 2014, 2:25:24 AM7/30/14
to

Hi,

i just did a few more tests on sysctrl the last days and sysctrl is definitely not working properly!
here is what i did to test it:
- stop sysctrl
- disable and kill dns320daemon
- start logread -f in a separate putty session
- start sysctrl via rcsysctrl start
 [root@DNS320]# echo 10000 > /tmp/sys/temp1_input
[root@DNS320]# cat /tmp/sys/pwm1
127
[root@DNS320]# cat /tmp/sys/fan1_input
3000
[root@DNS320]# rcsysctrl start
Starting sysctrl: OK.
[root@DNS320]# cat /tmp/sys/pwm1
0

as you can see i have to start sysctrl manually to get it setting the desired fanspeed

simple reason: sysctrl is directly closed after starting it - it is not running properly in the background,
thats also the reason why my fan is constantly spinning at 3000rpm although i set the low fanspeed in sysctrl.config to 2000 - sysctrl is never coming to the point to set the fan speed properly as is crashes before
 EDIT 1:
looking into the sysctrl.c it does not enter the mainloop

last entry in logread -f is:
Jul 31 12:20:21 DNS320 daemon.info sysctrl: args.front_button_command1="(null)"
Jul 31 12:20:21 DNS320 daemon.info sysctrl: args.front_button_command2="(null)"
Jul 31 12:20:21 DNS320 daemon.info sysctrl: args.back_button_command="(null)"
Jul 31 12:20:21 DNS320 daemon.info sysctrl: sdb left rdwr=0 last=0 spindow=1200 power=1
Jul 31 12:20:21 DNS320 daemon.info sysctrl: sda right rdwr=0 last=0 spindow=1200 power=1
Jul 31 12:20:21 DNS320 daemon.info sysctrl: (null) (null) rdwr=0 last=0 spindow=1200 power=1


thats from 
print_config();
print_disks(); 
in sysctrl.c

afterwards the mainloop should be started in line 260 of sysctrl.c and after 30 seconds the main loop should read temp and set fanspeed - what never happens
so i assume that somewhere in fanctl() is an error...

i'll try to add some more syslog lines in and make a test compile tonight to see where it breaks...

so the dns320ldaemon is definitely running but not sysctrl.
 EDIT 2:

nailed it down to 

//      get_led(power_led, pled); // power led not in use by other script...

int get_led(int which, char *mode) {
char buf1[128], buf2[128];
int u;
if (leds[which] == NULL)
return -1;
sprintf(buf1, "%s%s", leds[which], "trigger");
read_str_from_file(buf1, buf2, 128);
*(strchr(buf2,']')) = '\0';
strcpy(mode, strchr(buf2,'[') + 1);
sprintf(buf1, "%s%s", leds[which], "brightness");
read_int_from_file(buf1, &u);
return u;
}

the 2 lines in red crash the whole sysctrl and the file /sys/tmp/power_led/brightness does not exists
I'm not that deep in c so i don't know what these 2 lines try to do...

using the attached sysctrl where i just commented both lines out the sysctrl service is properly running and not stopped directly after getting started...

cheers
Henrik

sysctrl.zip

Henrik Bruening

unread,
Jul 31, 2014, 9:42:58 AM7/31/14
to al...@googlegroups.com
just to bring it up... see my answer above


Am Mittwoch, 30. Juli 2014 08:25:24 UTC+2 schrieb Henrik Bruening:

Hi,

i just did a few more tests on sysctrl the last days and sysctrl is definitely not working properly!
here is what i did to test it:
- stop sysctrl
- disable and kill dns320daemon
- start logread -f in a separate putty session
- start sysctrl via rcsysctrl start
 [root@DNS320]# echo 10000 > /tmp/sys/temp1_input
[root@DNS320]# cat /tmp/sys/pwm1
127
[root@DNS320]# cat /tmp/sys/fan1_input
3000
[root@DNS320]# rcsysctrl start
Starting sysctrl: OK.

Henrik Bruening

unread,
Jul 31, 2014, 11:00:27 AM7/31/14
to al...@googlegroups.com
here is another possible sourcefor an error as the the fan will never really spin down...
while overwriting the pwm value 127 by 0 the result in the file at the end is 027

int write_int_to_file(const char *filename, int u) {
int fd;
char buf[64];

fd = open(filename, O_WRONLY);
if (fd == -1) {
syslog(LOG_ERR, "open %s: %m", filename);
return -1;
}
sprintf(buf, "%d", u);
write(fd, buf, strlen(buf));
close(fd);
return 0;
}

better one as this one really overwrites the old value...

int write_int_to_file(const char *filename, int u) {
        int fd;
        char buf[64];
        FILE *fp;

        fp = fopen(filename, "w+");
        if (fd == -1) {
                syslog(LOG_ERR, "open %s: %m", filename);
                return -1;
        }
        rewind(fp);
        sprintf(buf, "%d", u);
        fwrite(buf, strlen(buf),1,fp);
        fclose(fp);
        return 0;

João Cardoso

unread,
Jul 31, 2014, 6:28:03 PM7/31/14
to
Thanks a lot for your findings.

Most of the issues you found are fixed in the new sysctrl. I have not yet SVN commited it because it is not yet finished, so you are watching the pristine sysctrl shipped with RC4, not the new one I sent you..
When your start sysctrl using the rcsysctrl start, you are starting the one found first in the PATH, not the one in your current directory. Better start it just as ./sysctrl (there is nothing special in sysctrl to require it to be started by an initscript).

Anyway I enclose the current source code and the binary sysctrl and dns320l-daemon for you (or other DNS320L user) to test.

[Attachment deleted, as obsoleted by new version, see posts bellow]


The binaries are compiled with debugging on and not stripped, so the best way to test and debug it is to install the gdb package and run in the directory where the sysctrl is:

gdb sysctr
run

if/when the binaries crashes, gdb will show it and you can use

where

to have a stack call trace. Please post it.

-The /sys/tmp/power_led/ folder is created at boot time by /etc/init.d/rcS  when the board is detected. Unfortunately it happens too early in the boot sequence to be fixable, so you have to use a "user boot script" to fix that latter (Services->User-> user configure)

mkdir -p /tmp/sys/power_led

should do the trick, not sure But the boot script has to first stop sysctrl.
It's also a good idea to make the boot script copy the new sysctr and dns320l-daemon from a location on disk to /usr/sbin, something like

#!/bin/sh

# User script to be executed at boot time. UNTESTED.
# when the disk partiton is detected and mounted
# Be sure you know what you are doing!

case "$1" in
    start)

        board=$(cat /tmp/board)
        if test "$board" != "DNS-320L-A1"; then exit 0; fi # this is only for the DNS-320L

        # create power_led sys folder. Expect that files there will be created as needed.
        mkdir -p /tmp/sys/power_led

        # copy new sysctrl to /usr/sbin
        rcsysctrl stop
        cp /some/location/on/disk/sysctrl /usr/sbin

        rcsysctrl start


        # disable init from launching dns320-daemon, and terminate it
        sed -i 's/\(.*dns320l-daemon.*\)/#\1/
' /etc/inittab
        kill -1 1
        killall dns320l-daemon
        cp /some/location/on/disk/dns320l-daemon /usr/sbin

        # allow init to launch the dns320-daemon
        sed -i 's/^[#]*[[:space:]]*\(.*
dns320l-daemon.*\)/\1/' /etc/inittab
        kill -1 1

        ;;
    stop) : ;;
    *) usage $0 "start|stop" ;;
esac


The  "overwriting the pwm value 127 by 0 the result in the file at the end is 027" is handled by opening the file in truncation mode.

I have done a lot of other yet untested changes to dns320l-daemon, so please test and use the enclosed binaries



On Thursday, July 31, 2014 4:00:27 PM UTC+1, Henrik Bruening wrote:
here is another possible sourcefor an error as the the fan will never really spin down...
while overwriting the pwm value 127 by 0 the result in the file at the end is 027

This is handled by opening the file in truncation mode.

Thanks,
João



Henrik Bruening

unread,
Aug 1, 2014, 2:11:13 AM8/1/14
to al...@googlegroups.com
okay i tried the new version you sent.
this one really fixes a few issues but it is still crashing in get_led

*(strchr(buf2,']')) = '\0';
strcpy(mode, strchr(buf2,'[') + 1);

Am Freitag, 1. August 2014 00:28:03 UTC+2 schrieb João Cardoso:
Thanks a lot for your findings.

Most of the issues you found are fixed in the new sysctrl. I have not yet SVN commited it because it is not yet finished, so you are watching the pristine sysctrl shipped with RC4, not the new one I sent you..
When your start sysctrl using the rcsysctrl start, you are starting the one found first in the PATH, not the one in your current directory. Better start it just as ./sysctrl (there is nothing special in sysctrl to require it to be started by an initscript).

Anyway I enclose the current source code and the binary sysctrl and dns320l-daemon for you (or other DNS320L user) to test.

        kill -1 1
        killall dns320l-daemon
        cp /some/location/on/disk/dns320l-daemon /usr/sbin

        # allow init to launch the dns320-daemon
        sed -i 's/^[#]*[[:space:]]*\(.*
dns320l-daemon.*\)/\1/' /etc/inittab
        kill -1 1

        ;;
    stop) : ;;
    *) usage $0 "start|stop" ;;
esac


The  "overwriting the pwm value 127 by 0 the result in the file at the end is 027" is handled by opening the file in truncation mode.

I have done a lot of other yet untested changes to dns320l-daemon, so please test and use the enclosed binaries


On Thursday, July 31, 2014 4:00:27 PM UTC+1, Henrik Bruening wrote:
here is another possible sourcefor an error as the the fan will never really spin down...
while overwriting the pwm value 127 by 0 the result in the file at the end is 027

Ronaldo Antoni

unread,
Aug 3, 2014, 8:05:07 AM8/3/14
to Grupo Alt-F
I created the script and put it in to start User script, but did not detect differences in the use of NAS. Maybe I did something wrong (and this is likely). 
Another thing that strikes me is that the status screen the temperature of the NAS is not displayed.

Ronaldo Antoni
(54)9979-8920


        kill -1 1
        killall dns320l-daemon
        cp /some/location/on/disk/dns320l-daemon /usr/sbin

        # allow init to launch the dns320-daemon
        sed -i 's/^[#]*[[:space:]]*\(.*
dns320l-daemon.*\)/\1/' /etc/inittab
        kill -1 1

        ;;
    stop) : ;;
    *) usage $0 "start|stop" ;;
esac


The  "overwriting the pwm value 127 by 0 the result in the file at the end is 027" is handled by opening the file in truncation mode.

I have done a lot of other yet untested changes to dns320l-daemon, so please test and use the enclosed binaries


On Thursday, July 31, 2014 4:00:27 PM UTC+1, Henrik Bruening wrote:
here is another possible sourcefor an error as the the fan will never really spin down...
while overwriting the pwm value 127 by 0 the result in the file at the end is 027
This is handled by opening the file in truncation mode.

Thanks,
João



João Cardoso

unread,
Aug 3, 2014, 4:25:51 PM8/3/14
to


On Friday, August 1, 2014 7:11:13 AM UTC+1, Henrik Bruening wrote:
okay i tried the new version you sent.
this one really fixes a few issues but it is still crashing in get_led

Please try the attached sysctrl and dns320l-daemon binaries, all source code included [Attachment removed, as is obsoleted]

There are several changes since the last post. They were tested whenever possible.

Most notably:

-The dns320l-daemon now supports a client mode using the  '-x cmd' option.
If a running dns320l-daemon is running, 'cmd' is sent to it, otherwise 'cmd' is sent directly to the MCU. This avoids the need to have to execute 'echo -e 'cmd\r | nc ....' The 'help' command is also supported, so './dns320l-daemon -x help' lists the available commands.
This is needed not only for user convenience, but also at powerdown, when the dns320l-daemon is not running anymore but the  DeviceShutdown command has to be sent to the MCU.

-Needed "device" files are now created at startup.

-power led desired state supported (heartbeat mode is mapped to trigger). Notice that sysctrl only changes the power led if the led trigger is "none".

-the power button status should be reflected in the power_button file content.

Thanks and please continue reporting back.



João Cardoso

unread,
Aug 3, 2014, 4:29:33 PM8/3/14
to al...@googlegroups.com


On Sunday, August 3, 2014 1:05:07 PM UTC+1, Ronaldo Antoni wrote:
I created the script and put it in to start User script,

Is it being executed? You should see in the system log "Executing "your_script start" in background"
 
but did not detect differences in the use of NAS.

Please try instead the binaries I just post in the previous post.

Ronaldo Antoni

unread,
Aug 3, 2014, 7:42:08 PM8/3/14
to Grupo Alt-F
I put the new files running:

[root@storage]# ./test.sh start
Stopping sysctrl: OK.
Starting sysctrl: OK.
killall: dns320l-daemon: no process killed
[root@storage]# 

Desculpe minha ignorância, mas não consegui localizar os logs para verificar se os processos estão em execução. Quais arquivos devo conferir?

Ronaldo Antoni
(54)9979-8920


--

Ronaldo Antoni

unread,
Aug 3, 2014, 9:11:18 PM8/3/14
to Grupo Alt-F
[root@storage]# ps aux | grep sys
  515 root     syslogd -C -m 0 -D
  975 root     grep sys
[root@storage]# ps aux | grep dns
  978 root     [dns320l-daemon]
  980 root     grep dns
[root@storage]# 

The status screen Alt-F has an error:
awk: cmd. line:1: Unexpected end of string expr: syntax error sh: °C/°F: bad number sh: °C/°F: bad number sh: °C/°F: bad number sh: bad number sh: bad number sh: bad number



Ronaldo Antoni
(54)9979-8920

João Cardoso

unread,
Aug 3, 2014, 9:34:07 PM8/3/14
to al...@googlegroups.com


On Monday, August 4, 2014 12:42:08 AM UTC+1, Ronaldo Antoni wrote:
I put the new files running:

[root@storage]# ./test.sh start
Stopping sysctrl: OK.
Starting sysctrl: OK.
killall: dns320l-daemon: no process killed
[root@storage]# 

Desculpe minha ignorância, mas não consegui localizar os logs

To check the execution of your test.sh script, add a line containing 'set -x' after the first line, then execute it again and post all its output.

The logs can be found at System->Utilities->View Logs, "System log" and "Running Processes". Please attach (not inline) them.

To check the system temperature and fan speed from the command line, to diagnose the Status page errors, do

hexdump -C /tmp/sys/temp1_input
hexdump -C /tmp/sys/fan1_input
hexdump -C /tmp/sys/pwm1


Thanks

Ronaldo Antoni

unread,
Aug 4, 2014, 3:59:28 PM8/4/14
to Grupo Alt-F
Attached the requested logs and output of test.sh after adding "set-x"

[root@storage]# ./test.sh start
+ cat /tmp/board
+ board=DNS-320L-A1
+ test DNS-320L-A1 != DNS-320L-A1
+ mkdir -p /tmp/sys/power_led
+ rcsysctrl stop
Stopping sysctrl: OK.
+ cp /mnt/dados/sysctrl /usr/sbin
+ rcsysctrl start
Starting sysctrl: OK.
+ sed -i s/\(.*dns320l-daemon.*\)/#\1/ /etc/inittab
+ kill -1 1
+ killall dns320l-daemon
killall: dns320l-daemon: no process killed
+ cp /mnt/dados/dns320l-daemon /usr/sbin
+ sed -i s/^[#]*[[:space:]]*\(.*dns320l-daemon.*\)/\1/ /etc/inittab
+ kill -1 1
[root@storage]# 



Ronaldo Antoni
(54)9979-8920


--
SystemLog.log
Processes.log

Ronaldo Antoni

unread,
Aug 4, 2014, 4:15:20 PM8/4/14
to Grupo Alt-F
[root@storage]# hexdump -C /tmp/sys/temp1_input
[root@storage]# hexdump -C /tmp/sys/fan1_input
[root@storage]# hexdump -C /tmp/sys/pwm1
00000000  30 0a                                             |0.|
00000002
[root@storage]#


Ronaldo Antoni
(54)9979-8920

João Cardoso

unread,
Aug 4, 2014, 7:30:31 PM8/4/14
to al...@googlegroups.com


On Monday, August 4, 2014 8:59:28 PM UTC+1, Ronaldo Antoni wrote:
Attached the requested logs and output of test.sh after adding "set-x"

[root@storage]# ./test.sh start
+ cat /tmp/board
+ board=DNS-320L-A1
+ test DNS-320L-A1 != DNS-320L-A1
+ mkdir -p /tmp/sys/power_led
+ rcsysctrl stop
Stopping sysctrl: OK.
+ cp /mnt/dados/sysctrl /usr/sbin
+ rcsysctrl start
Starting sysctrl: OK.
+ sed -i s/\(.*dns320l-daemon.*\)/#\1/ /etc/inittab

single quotes are missing. It might be a display issue. It should read


sed -i 's/\(.*dns320l-daemon.*\)/#\1/' /etc/inittab

If you use the command above the line for the dns320l-daemon in /etc/inittab should be commented.

 
+ kill -1 1
+ killall dns320l-daemon
killall: dns320l-daemon: no process killed
+ cp /mnt/dados/dns320l-daemon /usr/sbin
+ sed -i s/^[#]*[[:space:]]*\(.*dns320l-daemon.*\)/\1/ /etc/inittab

Same  issue, it should be


sed -i 's/^[#]*[[:space:]]*\(.*dns320l-daemon.*\)/\1/' /etc/inittab

after executing the command above the entry for the dns320l-daemon in /etc/inittab should become uncommented.

Please try again.
 
ps.google.com/d/optout.

Ronaldo Antoni

unread,
Aug 4, 2014, 8:21:52 PM8/4/14
to Grupo Alt-F
The script contains single quotes. Same results.

Ronaldo Antoni
(54)9979-8920


João Cardoso

unread,
Aug 5, 2014, 5:15:17 PM8/5/14
to al...@googlegroups.com


On Tuesday, August 5, 2014 1:21:52 AM UTC+1, Ronaldo Antoni wrote:
The script contains single quotes. Same results.

OK, please try the new attachment, it was a dns320l-daemon error.
Please attach the System log

Thanks
dns320l.tar.gz

Ronaldo Antoni

unread,
Aug 5, 2014, 7:27:24 PM8/5/14
to Grupo Alt-F
[root@storage]# ./test.sh start
+ cat /tmp/board
+ board=DNS-320L-A1
+ test DNS-320L-A1 != DNS-320L-A1
+ mkdir -p /tmp/sys/power_led
+ rcsysctrl stop
Stopping sysctrl: OK.
+ cp /mnt/dados/sysctrl /usr/sbin
+ rcsysctrl start
Starting sysctrl: OK.
+ sed -i s/\(.*dns320l-daemon.*\)/#\1/ /etc/inittab
+ kill -1 1
+ killall dns320l-daemon
+ cp /mnt/dados/dns320l-daemon /usr/sbin
+ sed -i s/^[#]*[[:space:]]*\(.*dns320l-daemon.*\)/\1/ /etc/inittab
+ kill -1 1
[root@storage]# 

On the status screen the temperature is displayed, but the cooler is off (perhaps due to the low ambient temperature?). I changed the parameter of temperature in services> system> sysctrl to 34 degrees and the fan turned on normally. Seems to be working. 
The LEDs are illuminated both buttons, but NAS still does not turn off with the halt command via ssh.

Ronaldo Antoni
(54)9979-8920


--
SystemLog.log

João Cardoso

unread,
Aug 6, 2014, 10:05:18 AM8/6/14
to al...@googlegroups.com


On Wednesday, August 6, 2014 12:27:24 AM UTC+1, Ronaldo Antoni wrote:

(...)
 
On the status screen the temperature is displayed, but the cooler is off (perhaps due to the low ambient temperature?). I changed the parameter of temperature in services> system> sysctrl to 34 degrees and the fan turned on normally. Seems to be working. 

Ah, good news at last!

You can play with "Fan Off Temp." and "Low Fan Speed Temp" to adjust the fan off temperature and the low to high speed fan speeds.

There are more stuff to test, if you are willing to do them.

Please give your answers in line, following my questions, not at the top. This make easier to follow

Execute the 'logread -f' command on a login window and keep it open, while executing command on another login window.
logread will display the system log as new itens are added to it.
At the end you can terminate the logread command by hitting CTRL-C.

1-Back buttons:

1-press the box back USB button for a couple of seconds. In the logread window you should see "Entering back_button" and the two box front orange leds should start blinking twice a second. Does it?
2-press the box back recessed reset button for a couple of seconds. The same as above should happens. Does it?

2-Front power button:

Press the box front button for a couple of seconds. In the logread window you should see "Power Button Pressed" and "Power Button Released!".
If you see that, press and keep pressing the power button, and one of the front orange leds should start blinking, and if you release the button at that time you should see at the logread window "Rebooting NOW" and the box should do reboot. Does it?

It is possible that the power led starts blinking fast during this test. Does it?

Don't keep the button pressed until the other orange led starts blinking, because if you release it at that time "Poweroff NOW" will appear in the logread window, but the box will NOT powerdow and you will have to unplug the power cord. We have to fix power-off latter.


3-dns320l-daemon in client mode with a running dns320l-daemon:

execute the command

dns320l-daemon -dx help

the following should be displayed:

dns320l-daemon[2888]: cmd=help
Available Commands2:

DeviceReady, DeviceShutdown, ShutdownDaemon, EnablePowerRecovery, DisablePowerRecovery, GetPowerRecoveryState, EnableWOL, DisableWOL, GetWOLState, SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, PowerLedBlink, ReadRtc, systohc, hctosys, GetTemperature, help, quit.

You can try some of these commands, e.g.,

dns320l-daemon -dx GetTemperature

and the following should appear:

cmd=GetTemperature
ERR

or

cmd=GetTemperature
42000

Or whatever the temperature * 1000 is. Does it works as expected?

You can also try the SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, or the PowerLedBlink commands. Do they work as expected?
As sysctrl is running, the fan might be put back at it original state some seconds after you execute the commands.


4-dns320l-daemon in client mode without a running dns320l-daemon:

This test requires that the dns320l-daemon be terminated first.
You can see if a dns320l-daemon is running by executing the command

ps | grep -v grep | grep dns320l-daemon

That command will output something like

2887 root     dns320l-daemon

when a dns320l-daemon is running and produce no output when no dsn320l-daemon is running.

To terminate the currently running dns320l-daemon you have to tell init to not launch it again by executing the commands:

sed -i 's/\(.*dns320l-daemon.*\)/#\1/' /etc/
inittab
kill
-1 1
killall dns320l
-daemon

after executing that above commands the command

ps | grep -v grep | grep dns320l-daemon

should produce no output at all, and we can continue testing.

Execute the command

dns320l-daemon -dx GetTemperature

On my system the above command gives the following errors, as I don't have a dns320L:

dns320l-daemon[2962]: no server, send cmd directly to MCU
dns320l-daemon[2962]: error from tcgetattr: Input/output error
dns320l-daemon[2962]: error from tggetattr: Input/output error
dns320l-daemon[2962]: Handling Command2: GetTemperature
dns320l-daemon[2962]: Error writing byte 0: 250, count: -1
dns320l-daemon[2962]: Try number: 1
dns320l-daemon[2962]: Error writing byte 0: 250, count: -1
dns320l-daemon[2962]: Try number: 2
dns320l-daemon[2962]: Error writing byte 0: 250, count: -1
dns320l-daemon[2962]: Try number: 3
dns320l-daemon[2962]: Error writing byte 0: 250, count: -1
dns320l-daemon[2962]: Try number: 4
dns320l-daemon[2962]: Error writing byte 0: 250, count: -1
dns320l-daemon[2962]: Try number: 5
dns320l-daemon[2962]: Error writing byte 0: 250, count: -1
dns320l-daemon[2962]: Try number: 6
ERR

I expect that on your system no error will appears and that the box temperature * 1000 be displayed. Does it?
Can you please post all the command output?

You can try other commands, such as setting the fan off, middle and full speed.

After completing these tests you have to tell init to start the dns320l-daemon again by executing the commands

sed -i 's/^[#]*[[:space:]]*\(.*dns320l-daemon.*\)/\1/' /etc/
inittab
kill
-1 1

and using the command


ps | grep -v grep | grep dns320l-daemon

should show that the dns320l-daemon is again running.


The LEDs are illuminated

You have to tell us what leds are you talking about -- blue disk leds? orange disk led? one led, two? Blue or white power led? blinking? steady-on?
 
both buttons, but NAS still does not turn off with the halt command via ssh.

No, we have to still fix that. We will return to that next time.

Thanks

PS-Ronaldo, if you want you can give your answers or make comments in Português, I'm certain that nobody will complain.


Ronaldo Antoni

unread,
Aug 6, 2014, 10:20:50 AM8/6/14
to Grupo Alt-F
I'm traveling today. Over the weekend possibly be able to do the tests and send the results!

Ronaldo Antoni
(54)9979-8920


Ronaldo Antoni

unread,
Aug 9, 2014, 11:08:01 AM8/9/14
to Grupo Alt-F
Since Portuguese authorized me better. Much better than translations of google ...
Minhas respostas estão em negrito!

1-Back buttons:

1-press the box back USB button for a couple of seconds. In the logread window you should see "Entering back_button" and the two box front orange leds should start blinking twice a second. Does it?
2-press the box back recessed reset button for a couple of seconds. The same as above should happens. Does it?

Ao pressionar a tecla usb:
Aug  9 11:46:05 storage daemon.info sysctrl: Entering back_button
Ao liberá-la:
Aug  9 11:46:10 storage daemon.info sysctrl: executing user script "/usr/bin/eject"
Aug  9 11:46:10 storage daemon.info sysctrl: user script "/usr/bin/eject" finished

Ao pressionar reset:
Aug  9 11:49:04 storage daemon.info sysctrl: Entering back_button
Ao soltar reset:
ug  9 11:49:09 storage daemon.info sysctrl: executing user script "/usr/bin/eject"
Aug  9 11:49:09 storage daemon.info sysctrl: user script "/usr/bin/eject" finished

Aleatoriamente, aparece no log algo do tipo:
Aug  9 11:48:55 storage daemon.info sysctrl: temp=35.3 fan=0


2-Front power button:

Press the box front button for a couple of seconds. In the logread window you should see "Power Button Pressed" and "Power Button Released!".
If you see that, press and keep pressing the power button, and one of the front orange leds should start blinking, and if you release the button at that time you should see at the logread window "Rebooting NOW" and the box should do reboot. Does it?

It is possible that the power led starts blinking fast during this test. Does it?

Don't keep the button pressed until the other orange led starts blinking, because if you release it at that time "Poweroff NOW" will appear in the logread window, but the box will NOT powerdow and you will have to unplug the power cord. We have to fix power-off latter.

Após algum tempo com o botão pressionado, o led começa a piscar. Nada é exibido no log.

3-dns320l-daemon in client mode with a running dns320l-daemon:

execute the command

dns320l-daemon -dx help

the following should be displayed:

dns320l-daemon[2888]: cmd=help
Available Commands2:

DeviceReady, DeviceShutdown, ShutdownDaemon, EnablePowerRecovery, DisablePowerRecovery, GetPowerRecoveryState, EnableWOL, DisableWOL, GetWOLState, SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, PowerLedBlink, ReadRtc, systohc, hctosys, GetTemperature, help, quit.

You can try some of these commands, e.g.,

dns320l-daemon -dx GetTemperature

and the following should appear:

cmd=GetTemperature
ERR

or 

cmd=GetTemperature
42000 

Or whatever the temperature * 1000 is. Does it works as expected?

[root@storage]# dns320l-daemon -dx GetTemperature
dns320l-daemon[1334]: cmd=GetTemperature
36000


You can also try the SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, or the PowerLedBlink commands. Do they work as expected?
As sysctrl is running, the fan might be put back at it original state some seconds after you execute the commands.

Sim, funcionam normalmente!!!
Segue toda a saída dos comandos:
[root@storage]# ps | grep -v grep | grep dns320l-daemon
  982 root     /usr/sbin/dns320l-daemon
[root@storage]# sed -i 's/\(.*dns320l-daemon.*\)/#\1/' /etc/inittab
[root@storage]# kill -1 1
[root@storage]# killall dns320l-daemon
killall: dns320l-daemon: no process killed
[root@storage]# ps | grep -v grep | grep dns320l-daemon
[root@storage]# dns320l-daemon -dx GetTemperature
dns320l-daemon[1350]: no server, send cmd directly to MCU
dns320l-daemon[1350]: Handling Command2: GetTemperature
dns320l-daemon[1350]: Returning 1 read bytes
dns320l-daemon[1350]: Try number: 1
35000
[root@storage]# 


You can try other commands, such as setting the fan off, middle and full speed.

After completing these tests you have to tell init to start the dns320l-daemon again by executing the commands

sed -i 's/^[#]*[[:space:]]*\(.*dns320l-daemon.*\)/\1/' /etc/inittab
kill -1 1

and using the command

ps | grep -v grep | grep dns320l-daemon

should show that the dns320l-daemon is again running.


The LEDs are illuminated

You have to tell us what leds are you talking about -- blue disk leds? orange disk led? one led, two? Blue or white power led? blinking? steady-on?
 
both buttons, but NAS still does not turn off with the halt command via ssh.

No, we have to still fix that. We will return to that next time.

Thanks

PS-Ronaldo, if you want you can give your answers or make comments in Português, I'm certain that nobody will complain.

Ronaldo Antoni
(54)9979-8920


João Cardoso

unread,
Aug 9, 2014, 8:21:07 PM8/9/14
to
[I have been trying to do this post half a dozen times! F* Google Groups!]



On Saturday, August 9, 2014 4:08:01 PM UTC+1, Ronaldo Antoni wrote:

    Since Portuguese authorized me better. Much better than translations of google ...
    Minhas respostas estão em negrito!


Thanks Ronaldo.
Everything is OK except the power button, continue reading.

 

    1-Back buttons:
    1-press the box back USB button for a couple of seconds. In the logread window you should see "Entering back_button" and the two box front orange leds should start blinking twice a second. Does it?
    2-press the box back recessed reset button for a couple of seconds. The same as above should happens. Does it?
    Ao pressionar a tecla usb:
    Aug  9 11:46:05 storage daemon.info sysctrl: Entering back_button
    Ao liberá-la:
    Aug  9 11:46:10 storage daemon.info sysctrl: executing user script "/usr/bin/eject"
    Aug  9 11:46:10 storage daemon.info sysctrl: user script "/usr/bin/eject" finished
    Ao pressionar reset:
    Aug  9 11:49:04 storage daemon.info sysctrl: Entering back_button
    Ao soltar reset:
    ug  9 11:49:09 storage daemon.info sysctrl: executing user script "/usr/bin/eject"
    Aug  9 11:49:09 storage daemon.info sysctrl: user script "/usr/bin/eject" finished


OK, both USB and reset buttons are read.

 

    Aleatoriamente, aparece no log algo do tipo:
    Aug  9 11:48:55 storage daemon.info sysctrl: temp=35.3    fan=0


That's also OK, that's sysctrl logging that the temperature has changed


    2-Front power button:
    Press the box front button for a couple of seconds. In the logread window you should see "Power Button Pressed" and "Power Button Released!".
    If you see that, press and keep pressing the power button, and one of the front orange leds should start blinking, and if you release the button at that time you should see at the logread window "Rebooting NOW" and the box should do reboot. Does it?
    It is possible that the power led starts blinking fast during this test. Does it?
    Don't keep the button pressed until the other orange led starts blinking, because if you release it at that time "Poweroff NOW" will appear in the logread window, but the box will NOT powerdow and you will have to unplug the power cord. We have to fix power-off latter.
    Após algum tempo com o botão pressionado, o led começa a piscar. Nada é exibido no log.


hmmm, Houston, we have a problem here.

Can you please post the output of the following commands:

ls -l /sys/class/gpio /sys/class/input
find
/sys -name \*dns320\*
find
/sys/ -name \*gpio\*





if ! test -d /sys/class/gpio/gpio29; then
echo
29 > /sys/class/gpio/export
fi
cat
/sys/class/gpio/gpio29/*



 

    3-dns320l-daemon in client mode with a running dns320l-daemon:
    execute the command
    dns320l-daemon -dx help
    the following should be displayed:
    dns320l-daemon[2888]: cmd=help
    Available Commands2:
    DeviceReady, DeviceShutdown, ShutdownDaemon, EnablePowerRecovery, DisablePowerRecovery, GetPowerRecoveryState, EnableWOL, DisableWOL, GetWOLState, SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, PowerLedBlink, ReadRtc, systohc, hctosys, GetTemperature, help, quit.
    You can try some of these commands, e.g.,
    dns320l-daemon -dx GetTemperature
    and the following should appear:
    cmd=GetTemperature
    ERR
    or
    cmd=GetTemperature
    42000
    Or whatever the temperature * 1000 is. Does it works as expected?
    [root@storage]# dns320l-daemon -dx GetTemperature
    dns320l-daemon[1334]: cmd=GetTemperature
    36000


OK

 

    You can also try the SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, or the PowerLedBlink commands. Do they work as expected?
    As sysctrl is running, the fan might be put back at it original state some seconds after you execute the commands.
    Sim, funcionam normalmente!!!


Excelent!

 

    4-dns320l-daemon in client mode without a running dns320l-daemon:
    This test requires that the dns320l-daemon be terminated first.
    You can see if a dns320l-daemon is running by executing the command
    ps | grep -v grep | grep dns320l-daemon
    That command will output something like
    2887 root     dns320l-daemon
    when a dns320l-daemon is running and produce no output when no dsn320l-daemon is running.
    To terminate the currently running dns320l-daemon you have to tell init to not launch it again by executing the commands:
    sed -i 's/\(.*dns320l-daemon.*\)/#\1/' /etc/inittab
    kill -1 1
    killall dns320l-daemon
    after executing that above commands the command
    ps | grep -v grep | grep dns320l-daemon
    should produce no output at all, and we can continue testing.
    Execute the command
    dns320l-daemon -dx GetTemperature
    I expect that on your system no error will appears and that the box temperature * 1000 be displayed. Does it?
    Can you please post all the command output?
    Segue toda a saída dos comandos:
    [root@storage]# ps | grep -v grep | grep dns320l-daemon
      982 root     /usr/sbin/dns320l-daemon
    [root@storage]# sed -i 's/\(.*dns320l-daemon.*\)/#\1/' /etc/inittab
    [root@storage]# kill -1 1
    [root@storage]# killall dns320l-daemon
    killall: dns320l-daemon: no process killed
    [root@storage]# ps | grep -v grep | grep dns320l-daemon
    [root@storage]# dns320l-daemon -dx GetTemperature
    dns320l-daemon[1350]: no server, send cmd directly to MCU
    dns320l-daemon[1350]: Handling Command2: GetTemperature
    dns320l-daemon[1350]: Returning 1 read bytes
    dns320l-daemon[1350]: Try number: 1
    35000


Excelent, it's working. This is critical to properly power off the box.

To test if power-off works, the filesystem should be remounted read-only by executing the commands
(Para testar se é possível desligar, é necessário montar os sistemas de ficheiros apenas em mode de leitura executando os commandos:)

for i in $(awk '/(ext2|ext3|ext4|vfat|ntfs)/{print $1}' /proc/mounts); do
mount
-o remount,ro $i
done



Now press the power button until the power led starts flashing, then release the button and execute the command
(agora mantenha premido o botao de ON/OFF até que o led  de ON comece a piscar, e então liberte o botão e execute o comando:)

dns320l-daemon -dx DeviceReady



Does the power led stops flashing?
( O led de ON/OFF parou de piscar?)


If the led stops flashing, then press again the power button until it starts flashing. In any case execute the command
Se parou, volte a pressionar o botão de ON/OFF até que o led recomece a piscar. Em qualquer caso  execute o comando:)

dns320l-daemon -dx DeviceShutdown



Has the box powered-down?
(desligou-se?)

Thanks


Ronaldo Antoni

unread,
Aug 10, 2014, 5:13:29 PM8/10/14
to Grupo Alt-F
Saídas:

[root@storage]# ls -l /sys/class/gpio /sys/class/input
/sys/class/gpio:
total 0
--w-------    1 root     root          4096 Dec 31  1969 export
lrwxrwxrwx    1 root     root             0 Dec 31  1969 gpio24 -> ../../devices/virtual/gpio/gpio24
lrwxrwxrwx    1 root     root             0 Dec 31  1969 gpio29 -> ../../devices/virtual/gpio/gpio29
lrwxrwxrwx    1 root     root             0 Dec 31  1969 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
lrwxrwxrwx    1 root     root             0 Dec 31  1969 gpiochip32 -> ../../devices/virtual/gpio/gpiochip32
--w-------    1 root     root          4096 Dec 31  1969 unexport

/sys/class/input:
total 0
lrwxrwxrwx    1 root     root             0 Dec 31  1969 event0 -> ../../devices/platform/gpio-keys/input/input0/event0
lrwxrwxrwx    1 root     root             0 Dec 31  1969 input0 -> ../../devices/platform/gpio-keys/input/input0


[root@storage]# find /sys -name \*dns320\*
/sys/devices/platform/leds-gpio/leds/dns320l:red:sata0
/sys/devices/platform/leds-gpio/leds/dns320l:red:sata1
/sys/devices/platform/leds-gpio/leds/dns320l:blue:usb
/sys/devices/platform/leds-gpio/leds/dns320l:orange:usb
/sys/devices/platform/leds-gpio/leds/dns320l:blue:sata0
/sys/devices/platform/leds-gpio/leds/dns320l:blue:sata1
/sys/class/leds/dns320l:red:sata0
/sys/class/leds/dns320l:red:sata1
/sys/class/leds/dns320l:blue:usb
/sys/class/leds/dns320l:orange:usb
/sys/class/leds/dns320l:blue:sata0
/sys/class/leds/dns320l:blue:sata1


[root@storage]# find /sys/ -name \*gpio\*
/sys/bus/platform/devices/leds-gpio
/sys/bus/platform/devices/gpio-keys
/sys/bus/platform/drivers/leds-gpio
/sys/bus/platform/drivers/leds-gpio/leds-gpio
/sys/bus/platform/drivers/mvebu-gpio
/sys/bus/platform/drivers/poweroff-gpio
/sys/bus/platform/drivers/gpio-keys
/sys/bus/platform/drivers/gpio-keys/gpio-keys
/sys/bus/platform/drivers/gpio-fan
/sys/devices/virtual/gpio
/sys/devices/virtual/gpio/gpiochip32
/sys/devices/virtual/gpio/gpiochip32/ngpio
/sys/devices/virtual/gpio/gpio24
/sys/devices/virtual/gpio/gpio29
/sys/devices/virtual/gpio/gpiochip0
/sys/devices/virtual/gpio/gpiochip0/ngpio
/sys/devices/platform/leds-gpio
/sys/devices/platform/gpio-keys
/sys/class/gpio
/sys/class/gpio/gpiochip32
/sys/class/gpio/gpio24
/sys/class/gpio/gpio29
/sys/class/gpio/gpiochip0
[root@storage]# 

cat /sys/class/gpio/gpio29/*


Ocorreram erros ao montar o disco em modo somente leitura
[root@storage]# for i in $(awk '/(ext2|ext3|ext4|vfat|ntfs)/{print $1}' /proc/mo
unts); do
> mount -o remount,ro $i
> done
mount: mounting /dev/sda3 on /mnt/firmware failed: Device or resource busy
[root@storage]# 

Pressionei o botão on/off até o led começar a piscar:
[root@storage]# dns320l-daemon -dx DeviceReady
dns320l-daemon[2352]: cmd=DeviceReady
OK

O led continuou a piscar


[root@storage]# dns320l-daemon -dx DeviceShutdown
dns320l-daemon[2353]: cmd=DeviceShutdown
OK

[root@storage]# 

Sim! Desligado!!




Ronaldo Antoni
(54)9979-8920


2014-08-09 21:21 GMT-03:00 João Cardoso <whoami...@gmail.com>:
[I have been trying to do this post half a dozen times! F* Google Groups!]


On Saturday, August 9, 2014 4:08:01 PM UTC+1, Ronaldo Antoni wrote:

    Since Portuguese authorized me better. Much better than translations of google ...
    Minhas respostas estão em negrito!


Thanks Ronaldo.
Everything is OK except the power button, continue reading.
 

    1-Back buttons:
    1-press the box back USB button for a couple of seconds. In the logread window you should see "Entering back_button" and the two box front orange leds should start blinking twice a second. Does it?
    2-press the box back recessed reset button for a couple of seconds. The same as above should happens. Does it?
    Ao pressionar a tecla usb:
    Aug  9 11:46:05 storage daemon.info sysctrl: Entering back_button
    Ao liberá-la:
    Aug  9 11:46:10 storage daemon.info sysctrl: executing user script "/usr/bin/eject"
    Aug  9 11:46:10 storage daemon.info sysctrl: user script "/usr/bin/eject" finished
    Ao pressionar reset:
    Aug  9 11:49:04 storage daemon.info sysctrl: Entering back_button
    Ao soltar reset:
    ug  9 11:49:09 storage daemon.info sysctrl: executing user script "/usr/bin/eject"
    Aug  9 11:49:09 storage daemon.info sysctrl: user script "/usr/bin/eject" finished


OK, both USB and reset buttons are read.
 

    Aleatoriamente, aparece no log algo do tipo:
    Aug  9 11:48:55 storage daemon.info sysctrl: temp=35.3    fan=0


That's also OK, that's sysctrl logging that the temperature has changed

    2-Front power button:
    Press the box front button for a couple of seconds. In the logread window you should see "Power Button Pressed" and "Power Button Released!".
    If you see that, press and keep pressing the power button, and one of the front orange leds should start blinking, and if you release the button at that time you should see at the logread window "Rebooting NOW" and the box should do reboot. Does it?
    It is possible that the power led starts blinking fast during this test. Does it?
    Don't keep the button pressed until the other orange led starts blinking, because if you release it at that time "Poweroff NOW" will appear in the logread window, but the box will NOT powerdow and you will have to unplug the power cord. We have to fix power-off latter.
    Após algum tempo com o botão pressionado, o led começa a piscar. Nada é exibido no log.


hmmm, Houston, we have a problem here.

Can you please post the output of the following commands:

ls -l /sys/class/gpio /sys/class/input
find /sys -name \*dns320\*
find /sys/ -name \*gpio\*



if ! test -d /sys/class/gpio/gpio29; then
echo 29 > /sys/class/gpio/export
fi
cat /sys/class/gpio/gpio29/*

 

    3-dns320l-daemon in client mode with a running dns320l-daemon:
    execute the command
    dns320l-daemon -dx help
    the following should be displayed:
    dns320l-daemon[2888]: cmd=help
    Available Commands2:
    DeviceReady, DeviceShutdown, ShutdownDaemon, EnablePowerRecovery, DisablePowerRecovery, GetPowerRecoveryState, EnableWOL, DisableWOL, GetWOLState, SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, PowerLedBlink, ReadRtc, systohc, hctosys, GetTemperature, help, quit.
    You can try some of these commands, e.g.,
    dns320l-daemon -dx GetTemperature
    and the following should appear:
    cmd=GetTemperature
    ERR
    or
    cmd=GetTemperature
    42000
    Or whatever the temperature * 1000 is. Does it works as expected?
    [root@storage]# dns320l-daemon -dx GetTemperature
    dns320l-daemon[1334]: cmd=GetTemperature
    36000


OK

 

    You can also try the SetFanStop, SetFanHalf, SetFanFull, PowerLedOn, PowerLedOff, or the PowerLedBlink commands. Do they work as expected?
    As sysctrl is running, the fan might be put back at it original state some seconds after you execute the commands.
    Sim, funcionam normalmente!!!


Excelent!

 

    4-dns320l-daemon in client mode without a running dns320l-daemon:
    This test requires that the dns320l-daemon be terminated first.
    You can see if a dns320l-daemon is running by executing the command
    ps | grep -v grep | grep dns320l-daemon
    That command will output something like
    2887 root     dns320l-daemon
    when a dns320l-daemon is running and produce no output when no dsn320l-daemon is running.
    To terminate the currently running dns320l-daemon you have to tell init to not launch it again by executing the commands:
    sed -i 's/\(.*dns320l-daemon.*\)/#\1/' /etc/inittab
    kill -1 1
    killall dns320l-daemon
    after executing that above commands the command
    ps | grep -v grep | grep dns320l-daemon
    should produce no output at all, and we can continue testing.
    Execute the command
    dns320l-daemon -dx GetTemperature
    I expect that on your system no error will appears and that the box temperature * 1000 be displayed. Does it?
    Can you please post all the command output?
    Segue toda a saída dos comandos:
    [root@storage]# ps | grep -v grep | grep dns320l-daemon
      982 root     /usr/sbin/dns320l-daemon
    [root@storage]# sed -i 's/\(.*dns320l-daemon.*\)/#\1/' /etc/inittab
    [root@storage]# kill -1 1
    [root@storage]# killall dns320l-daemon
    killall: dns320l-daemon: no process killed
    [root@storage]# ps | grep -v grep | grep dns320l-daemon
    [root@storage]# dns320l-daemon -dx GetTemperature
    dns320l-daemon[1350]: no server, send cmd directly to MCU
    dns320l-daemon[1350]: Handling Command2: GetTemperature
    dns320l-daemon[1350]: Returning 1 read bytes
    dns320l-daemon[1350]: Try number: 1
    35000


Excelent, it's working. This is critical to properly power off the box.

To test if power-off works, the filesystem should be remounted read-only by executing the commands
(Para testar se é possível desligar, é necessário montar os sistemas de ficheiros apenas em mode de leitura executando os commandos:)

for i in $(awk '/(ext2|ext3|ext4|vfat|ntfs)/{print $1}' /proc/mounts); do
mount -o remount,ro $i
done

Now press the power button until the power led starts flashing, then release the button and execute the command
(agora mantenha premido o botao de ON/OFF até que o led  de ON comece a piscar, e então liberte o botão e execute o comando:)

dns320l-daemon -dx DeviceReady

Does the power led stops flashing?
( O led de ON/OFF parou de piscar?)

If the led stops flashing, then press again the power button until it starts flashing. In any case execute the command
Se parou, volte a pressionar o botão de ON/OFF até que o led recomece a piscar. Em qualquer caso  execute o comando:)

dns320l-daemon -dx DeviceShutdown

Has the box powered-down?
(desligou-se?)

Thanks

João Cardoso

unread,
Aug 11, 2014, 8:43:29 PM8/11/14
to al...@googlegroups.com
Thanks Ronaldo.

1-Power off:

Power-off works manually, but to automate the process we still have to detect the power-button press.
What is the output of

if ! test -d /sys/class/gpio/gpio29/; then
echo
no gpio export
echo
29 > /sys/class/gpio/export
fi

ls
-l /sys/class/gpio/gpio29/

for i in $(ls /sys/class/gpio/gpio29/); do
echo $i
: $(cat /sys/class/gpio/gpio29/$i)
done

If you see something like

active_low: 0
direction: in
edge: none
cat: read error: Is a directory
subsystem:
uevent:
value: 1

that's OK. Then run the following commands and press and release the power button watching the command output:

while true; do
usleep
20000
echo value
: $(cat /sys/class/gpio/gpio29/value)
echo power_button
: $(cat /tmp/sys/power_button)
done


I expect to see a

value: 1
power_button: 1

or  0 depending on the button is pressed or not. Does it?
You can terminate the output by pressing CTRL-C.

2-power led:
When you press the power button the power led starts blinking, right? Imediately? after how many seconds? It blinks fast or slowly? (once a second? twice a second?)

Try the following commands:

# just in case:
mkdir
-p /tmp/sys/power_led

# the power led should go off
echo none
> /tmp/sys/power_led/trigger
echo
0 > /tmp/sys/power_led/brightness

# the power led should go on
echo none
> /tmp/sys/power_led/trigger
echo
1 > /tmp/sys/power_led/brightness

# the power led should start blinking
echo timer
> /tmp/sys/power_led/trigger


Try each command separately, don't just copy/paste all them or you have no opportunity to watch the led.
Does it works as described?

Thanks

Ronaldo Antoni

unread,
Aug 12, 2014, 5:14:22 PM8/12/14
to Grupo Alt-F
[root@storage]# if ! test -d /sys/class/gpio/gpio29/; then
> echo no gpio export
> echo 29 > /sys/class/gpio/export
> fi
[root@storage]# ls -l /sys/class/gpio/gpio29/
total 0
-rw-r--r--    1 root     root          4096 Dec 31  1969 active_low
-rw-r--r--    1 root     root          4096 Dec 31  1969 edge
lrwxrwxrwx    1 root     root             0 Dec 31  1969 subsystem -> ../../../../class/gpio
-rw-r--r--    1 root     root          4096 Dec 31  1969 uevent
-rw-r--r--    1 root     root          4096 Dec 31  1969 value
[root@storage]# for i in $(ls /sys/class/gpio/gpio29/); do
> echo $i: $(cat /sys/class/gpio/gpio29/$i)
> done
active_low: 0
edge: none
cat: read error: Is a directory
subsystem:
uevent:
value: 1
[root@storage]# 

The output is independent of the button being pressed or not:
value: 1
power_button: 0
value: 1
power_button: 0
value: 1
power_button: 0

The LED starts flashing after about ten seconds down. It is difficult to measure, but some flashes twice per second imagine.

# just in case:
mkdir 
-/tmp/sys/power_led - NENHUMA SAÍDA

# the power led should go off
echo none 
> /tmp/sys/power_led/
trigger
echo 
0 > /tmp/sys/power_led/brightness - LED APAGADO

# the power led should go on
echo none 
> /tmp/sys/power_led/
trigger
echo 
1 > /tmp/sys/power_led/brightness - LED ACESO

# the power led should start blinking

echo timer 
> /tmp/sys/power_led/trigger - LED PISCANDO (APARENTEMENTE, MESMA VELOCIDADE QUE MANTENDO O BOTÃO PRESSIONADO POR ALGUNS SEGUNDOS).



Ronaldo Antoni
(54)9979-8920


João Cardoso

unread,
Aug 12, 2014, 6:49:59 PM8/12/14
to
Obrigado Ronaldo! Você é tão persistente como eu, quem será que desiste primeiro? :-)

Esta é a única coisa que falta resolver. Manteve o botão prsssionado tempo suficiente? Pelo menos até o led de ON/OFF começar a piscar?
(this is last thing to solve. Did you pressed the button long enough? At least until the power led starts blinking?)

[ADDED] Já que o botão demora tanto tempo a responder, use antes:
(as the button takes so long to respond, use this instead:)

while true; do

echo value
: $(cat /sys/class/gpio/gpio29/value)
echo power_button
: $(cat /tmp/sys/power_button)

sleep
1
done


 
The LED starts flashing after about ten seconds down. It is difficult to measure, but some flashes twice per second imagine.

OK. It's blinking fast.

Ronaldo Antoni

unread,
Aug 15, 2014, 8:06:48 PM8/15/14
to Grupo Alt-F
I just quit when you quit! 
A pity that I know so little and can not contribute greatly to the project, but I try as far as my knowledge allows!

Segue saída do comando:
while true; do
usleep 
20000
echo value
: $(cat /sys/class/gpio/gpio29/value)
echo power_button
: $(cat /tmp/sys/power_button)
done

confirmed: even holding the button until it starts flashing button, the log does not change

power_button: 1
value: 0
power_button: 1
value: 0
power_button: 1
value: 0
power_button: 1
value: 0
power_button: 1
value: 0
power_button: 1
value: 0
power_button: 1
value: 0
power_button: 1
value: 0


Ronaldo Antoni
(54)9979-8920


2014-08-12 19:49 GMT-03:00 João Cardoso <whoami...@gmail.com>:
Obrigado Ronaldo! Você é tão persistente como eu, quem será que desiste primeiro? :-)

Esta é a única coisa que falta resolver. Manteve o botão prsssionado tempo suficiente? Pelo menos até o led de ON/OFF começar a piscar?
(this is last thing to solve. Did you pressed the button long enough? At least until the power led starts blinking?)

 
The LED starts flashing after about ten seconds down. It is difficult to measure, but some flashes twice per second imagine.

OK. It's blinking fast.

Łukasz Holetzke

unread,
Aug 16, 2014, 7:40:05 AM8/16/14
to al...@googlegroups.com
Hi, just bought a DN320L and installed Alt-F after an harddisk failure on a DNS320 and loss of data.



OK, please try the new attachment, it was a dns320l-daemon error.
Please attach the System log

This works (web-ui shows temperature/ fan-control works as expected).

Is it normal, when I change the settings in sysctrl do I need to stop/start the daemon?

João Cardoso

unread,
Aug 17, 2014, 5:01:06 PM8/17/14
to al...@googlegroups.com


On Saturday, August 16, 2014 1:06:48 AM UTC+1, Ronaldo Antoni wrote:
I just quit when you quit! 
A pity that I know so little and can not contribute greatly to the project, but I try as far as my knowledge allows!

Segue saída do comando:
while true; do
usleep 
20000
echo value
: $(cat /sys/class/gpio/gpio29/value)
echo power_button
: $(cat /tmp/sys/power_button)
done

confirmed: even holding the button until it starts flashing button, the log does not change

There is nothing I can do. Under Alt-F the DNS320L can't be powered down ore rebooted through the front button.

I will release a RC4.0.1 specially for the DNS-320L probably at September, containing all we accomplished so far.

Thank you very much for your collaboration Ronaldo! It wouldn't be possible without you (and other, less persistent, collaborators)

Obrigado,
João

João Cardoso

unread,
Aug 17, 2014, 5:05:24 PM8/17/14
to al...@googlegroups.com
It shouldn't be needed.

If /etc/sysctrl.conf is changed, either thought the webUI or by direct editing, 'sysctrl' should notice the fact and react accordingly.
If you watch the System Log (System->Utilities, View Logs), you should see a sysctrl message saying: 

Aug 17 22:03:49 DNS-323 daemon.info sysctrl[1776]: reading /etc/sysctrl.conf
 
After the change.

Ronaldo Antoni

unread,
Aug 17, 2014, 7:46:04 PM8/17/14
to Grupo Alt-F
The shutdown software already solves the problem, but it should be possible through the button. The source of the fimware dlink can not contain any clues? 
A pity I did not know enough to assist you until we get to the solution. 
Anyway, I appreciate what already exists and I'm a willingness to help in whatever is within my reach.

Ronaldo Antoni
(54)9979-8920


--

João Cardoso

unread,
Aug 17, 2014, 9:15:47 PM8/17/14
to


On Monday, August 18, 2014 12:46:04 AM UTC+1, Ronaldo Antoni wrote:
The shutdown software already solves the problem, but it should be possible through the button. The source of the fimware dlink can not contain any clues? 

No, because it is closed source, they don't reveal that "trade" secrets, it had to be reverse-engineered by Andreas Böhler.
They only reveal what they are obliged by law (the GPL licence) to reveal.

I use to say that "anything that a man can do another man can can undo (except unbroke an egg)", so I don't know why manufacturers bother to hide such tiny trade secrets -- if interest if big enough they will be uncovered sooner or latter. The "sooner or latter" might be the keywords for manufacturers, as it can give them a small competitive time advantage over their competitors -- but only when the "secret" is really important, that's my view.

The lack of source code for a small number of D-Link programs  was the second motivation for me to write Alt-F (the first being the missing of a proper clean shutdown and fsck at powerup)
 
A pity I did not know enough to assist you until we get to the solution. 
Anyway, I appreciate what already exists and I'm a willingness to help in whatever is within my reach.

Thanks

Gábor Abbas

unread,
Jan 12, 2016, 12:16:48 AM1/12/16
to Alt-F
Hi there!

I don't know of this is the right group for this, but I'm desperately finding a solution. I have set up my DNS-320l and I could use it for 2 years. But after 2 years it could not boot up occasionally and now I can't start up.
Is there any solution for this problem? Thanks!

2014. július 6., vasárnap 0:10:47 UTC+2 időpontban Rafael Ourique a következőt írta:
First, let me quote this topic:

On Saturday, July 5, 2014 10:53:58 AM UTC-3, João Cardoso wrote:



But thanks for reporting back,  there has been 28 downloads of  Alt-F-0.1RC4-DNS-320L-rev-A1.bin and no report at all, so I didn't know if it was working or not!

The minimum needed for a box to work is to have disk and network access. But for me that does not means "supported", much more is need -- system temperature reading, automatic fan control, all buttons and leds working as expected... and from your report none of these seems to be right now!

So, the DNS-320L-rev-A1/A3 is not fully supported, but it works.

There are a lot of things to test, debug and fix, and most means trying and error, as I don't have such a box of my own, so instructions have to be followed, results reported back, doing another try/error cycle... all this taking days or weeks, depending on your technical expertise and linux experience.

Thanks for reporting back,
João




Well... i won't lie to you: i don't understand much of what you're saying BUT, if i can help in any way, just create a thread or mail me with what i should do, what should/shouldn't happen and what files i should send you for you to check if this works and i'll gladly do it next month (it's easier to do this on vacation). for now, i'll revert to the "stock" firmware and try to start over. i messed with so many things that i don't even know what i'm doing on it anymore.

About the examples you used on the last post, here's my impressions of what is happening

Temperature reading: sysctrl service does not recognize the board it seems. the status view, however, seems to detect the HD temperature and fan speed

check the images below

http://i.imgur.com/8Cj0dbY.png
http://i.imgur.com/EYDDTC1.png

Fan control: This one almost drove me nuts last night: basically, the fan is working on "bursts": it plays full rotation (60000) for 10-20 seconds then it returns do 50% rotation (30000) for another 10-20 seconds. the noise is giving me a goddamned headache by the way.
LEDs: the "power" led blinks when it's turning on and after that, all four (five if you count that below the "usb" button both the blue and orange leds are lit) are on 100% of the time. since when the stock d-link firmware "formatted" the HD it created a RAID-something that i'm 90% sure i did NOT asked and do NOT want, the red LEDs seems accurate enough
 haven't tried messing with buttons or led functions. it isn't necessary for what i'm using it for

CPU Issue: the CPU usage also seems to have a problem: from time to time it goes on 100% CPU usage for no actual reason. checking it with a putty terminal (top command, connected via ssh), it has shown that these spikes originated in transmission, but after i killed the process, it STILL gets some spikes now and then for no reason at all.

On a side note, i faced similar problems using transmission on fun_plug and deluged+deluge-web on debian squeeze. i'm a rather heavy torrent user (at least 300GB of data divided into 20 or 30 torrents), but that's too much! specially AFTER the verification for downloaded data has finished long ago. transmission even kept filling a log file with error messages so much it ended up with almost 5gb when i deleted it.
I have bad karma with these things :(

That's about it for now. i'll keep following the project and will return later.

best of luck!

João Cardoso

unread,
Jan 12, 2016, 1:22:12 PM1/12/16
to Alt-F


On Tuesday, 12 January 2016 05:16:48 UTC, Gábor Abbas wrote:
Hi there!

I don't know of this is the right group for this, but I'm desperately finding a solution. I have set up my DNS-320l

Using Alt-F? Or the original D-Link firmware?
 
and I could use it for 2 years. But after 2 years it could not boot up occasionally and now I can't start up.
Is there any solution for this problem?
 
If it can't boot, you have to solder a serial adapter to the box (a delicate procedure) and use the u-boot command line (an expert procedure). And it is not guaranteed that you will succeed.
Reply all
Reply to author
Forward
0 new messages