Support for D-Link 320 revB

3,260 views
Skip to first unread message

Peter M. Clausen

unread,
Oct 17, 2014, 5:50:48 PM10/17/14
to al...@googlegroups.com
Hi

If I understand correctly D-Link 320 revB is not yet supported. I would volunteer to try to make it work as I have one. But I would need quite some assistance from this group. I have never done kernel work, nor hardware, but I'm a fairly experienced C++ programmer and can read and do minor modifications to C-code. I've been using Ubuntu and Debian for over 5 years now and know most of the standard stuff.

How do you suggest to proceed? Is there a way to connect to the thing other than Ethernet? I've read about a serial cable but dont know exactly which cable you mean.

Do I need a Debian machine to compile? I have Ubuntu 14 running, but I can setup Debian also if needed for compilation. Any docs to do this would be helpful. 

Best regards

Peter

João Cardoso

unread,
Oct 18, 2014, 2:44:48 PM10/18/14
to al...@googlegroups.com


On Friday, October 17, 2014 10:50:48 PM UTC+1, Peter M. Clausen wrote:
Hi

If I understand correctly D-Link 320 revB is not yet supported. I would volunteer to try to make it work as I have one. But I would need quite some assistance from this group. I have never done kernel work, nor hardware,

You have to solder three wires on the board, and its a delicate procedure, better ask a friend.

 
but I'm a fairly experienced C++ programmer and can read and do minor modifications to C-code. I've been using Ubuntu and Debian for over 5 years now and know most of the standard stuff.

How do you suggest to proceed? Is there a way to connect to the thing other than Ethernet? I've read about a serial cable but dont know exactly which cable you mean.

To have access to the box at boot time you have to use RC-232C. I think the most simple procedure is to buy an USB to serial (RS-232-c 3.3volts) adapter. The USB side is connected to you computer using the kermit program, and the serial connection is soldered in the box.

see:


There are also some other clues in this forum.


Do I need a Debian machine to compile? I have Ubuntu 14 running,

That's OK.

There is also an extensive topic on how to build RC4 Alt-F in this forum.
But when you have the serial adapter working ask for further assistance.

One user, against my advice, flashed a 320-revB with the firmware for the revA, and as he had no soldering experience the box becomes useless.

Recent u-boot bootloaders allows one to load and run new firmware into memory *without* flashing it. That's the safest approach and the one I use, as the original fw will always be available. After gaining access to u-boot you can use, e.g. tftp to transfer firmware to the box and try it before flashing.
By reading the boot messages is sometimes enough to diagnose and fix the problem, so you might not even need to be able to compile Alt-F yourself.

I believe that the 320-revB must be very similar to other boxes. I have a 325 and a 320L myself , and the differences to the 320 are minimal.
The circuit board on my 320L-revA has printed:  "1NS320L...A1G/1NS320BM...A1g, 2 bay iscsi/NAS storage enclosure", what does yours says? Perhaps a picture of the circuit boar will help -- they must even be identical.

I'm definitely interested on this subject and ready to provide further assistance.

Peter M. Clausen

unread,
Oct 19, 2014, 9:45:07 PM10/19/14
to al...@googlegroups.com
thanks for the advice. I wont have much time this week, but I will look into this fairly soon. I think that my Dlink 320revB is very similar to Dlink 320L depicted in:


Here is mine (sorry for the horrible pic quality - digicam is broken and my phone... well, I use it to call people, not as camera...)

Inline-Bild 2


Inline-Bild 1

Processor in 320L:
Marvell
88F6-LG02 NAN5960.6 1210 A1P TW 88F6702-A1

My processor (320revB) reads:
Marvell
88F6-LG02 NFR4900.4 1316 A1P TW 88F6702-A1

So it seems to me that both boards are very similar, if not actually the same. But I guess we will know more when I get the thing hooked up. To be continued....

/Peter



--
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.
Visit this group at http://groups.google.com/group/alt-f.
For more options, visit https://groups.google.com/d/optout.

Andrew G

unread,
Dec 3, 2014, 8:07:03 PM12/3/14
to al...@googlegroups.com
I also noticed the similarity between DNS-320L and DNS-320 rev B1/B2 and posted a reply to another topic.

I can confirm the DNS-320 rev B1/B2 boards both have the text:-

1NS320L...A1G
1NS320BM..A1G
2-Bay iSCSI/NAS Storage Enclosure
REV-A1

So the "boards" would appear to be identical with DNS-320L. But there may be differences in the chips soldered onto the board and there is obviously a difference in the firmware that D-Link installs.

Does DNS-320L have larger RAM chips?

Is there a safe way to try the DNS-320L version of Alt-F on a DNS-320 rev B2 board without risking a bricking?


João Cardoso

unread,
Dec 4, 2014, 10:25:36 AM12/4/14
to al...@googlegroups.com


On Thursday, December 4, 2014 1:07:03 AM UTC, Andrew G wrote:
I also noticed the similarity between DNS-320L and DNS-320 rev B1/B2 and posted a reply to another topic.

I can confirm the DNS-320 rev B1/B2 boards both have the text:-

1NS320L...A1G
1NS320BM..A1G
2-Bay iSCSI/NAS Storage Enclosure
REV-A1

So the "boards" would appear to be identical with DNS-320L. But there may be differences in the chips soldered onto the board and there is obviously a difference in the firmware that D-Link installs.

The user-level firmware might be different, but the firmware hardware-level support must be very similar, as the circuit boards are identical.
Of course there must exists circuit tracks that are made active/inactive on the different models by means of solder bridges, and that will made the difference -- leds/buttons/fan might be addressed in different ways.
 

Does DNS-320L have larger RAM chips?

256MB total, but that isn't important, memory is detected automatically (the u-boot bootloader tells the kernel the address and amount of memory)


Is there a safe way to try the DNS-320L version of Alt-F on a DNS-320 rev B2 board without risking a bricking?

Yes, but you have to solder a serial adapter on the box board, which is a somewhat delicate task for the inexperienced. You will then gain access to the boot loader command line, and you can then load firmware into memory and execute it directly without the need to flash it -- that's what I do on my DNS-325/320L during development. This depends on the supported bootloader commands, for the DNS-323 the procedure is a bit more complex.

 

Andrew G

unread,
Dec 4, 2014, 1:06:23 PM12/4/14
to

I am messing around with spare DNS-320 rev B2 and spare HDD.
D-Link firmware updated to 1.02 2014/04/23
Temporarily installed fun_plug, so I could take backup copies of nand partitions mtd0 - mtd6
Serial adapter fitted and u-boot command line accessed.

I have been playing around a bit with u-boot to try to understand it, never used it before.
Managed to boot from the backup copies of nand mtd1 and mtd2 on usb memory stick:-

usb start
usb info
usb storage
usb dev
usb part
fatinfo usb 0:1
fatls usb 0:1 /dns-320/mtd_dump_b2/
fatload usb 0:1 0xa00000 /dns-320/mtd_dump_b2/mtd1 0x300000
fatload usb 0:1 0xf00000 /dns-320/mtd_dump_b2/mtd2 0x300000
bootm 0xa00000 0xf00000

So I think it should be possible to restore mtd1 - mtd6 from usb memory stick, provided mtd0 still contains working u-boot. I assume that I just need to "fatload" each backup into memory then use "nand write" to copy to nand device. But, for safety, I have not tried any nand writing yet.

Exactly which firmware files should I test, and what u-boot commands to load them to memory and boot?

João Cardoso

unread,
Dec 4, 2014, 2:01:53 PM12/4/14
to al...@googlegroups.com


On Thursday, December 4, 2014 6:06:23 PM UTC, Andrew G wrote:


On Thursday, 4 December 2014 15:25:36 UTC, João Cardoso wrote:
I am messing around with spare DNS-320 rev B2 and spare HDD.
D-Link firmware updated to 1.02 2014/04/23
Temporarily installed fun_plug, so I could take backup copies of nand partitions mtd0 - mtd6

Please post the output of 'cat /proc/mtd'. The full log from power up will also be useful, as there might exists differences from other board revisions.
 
Serial adapter fitted and u-boot command line accessed.

I have been playing around a bit with u-boot to try to understand it, never used it before.
Managed to boot from the backup copies of nand mtd1 and mtd2 on usb memory stick:-

usb start
usb info
usb storage
usb dev
usb part
fatinfo usb 0:1
fatls usb 0:1 /dns-320/mtd_dump_b2/
fatload usb 0:1 0xa00000 /dns-320/mtd_dump_b2/mtd1 0x300000
fatload usb 0:1 0xf00000 /dns-320/mtd_dump_b2/mtd2 0x300000
bootm 0xa00000 0xf00000


So it looks like that mtd1/mtd2 are the kernel/rootfs images and using 0xa00000/0xf00000 as load address works.
The DNS-320L/325 uses another (huge) flash partition for most user level programs. It is not needed for boot or simple command line usage.
For the DNS-325:

[root@DNS-325]# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00500000 00020000 "uImage"
mtd2: 00500000 00020000 "ramdisk"
mtd3: 06600000 00020000 "image" # huge 107MB with most programs
mtd4: 00a00000 00020000 "mini firmware"
mtd5: 00500000 00020000 "config"

for the DNS-320L:

[root@dns-320l]# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00500000 00020000 "uImage"
mtd2: 00500000 00020000 "ramdisk"
mtd3: 06400000 00020000 "image" # huge 104MB with most programs
mtd4: 00a00000 00020000 "rescue firmware"
mtd5: 00500000 00020000 "config"
mtd6: 00200000 00020000 "my-dlink"

You will have to create the Alt-F kernel/rootfs images from an Alt-F firmware file. You can use any D-Link firmware splitter that you find, but Alt-F has its own, 'dns323-fw':

[root@DNS-325]# dns323-fw 
-Split a vendor firmware file into its components:
        dns323-fw -s [-q (quiet)]
        [-k kernel_file] [-i initramfs_file] [-a sqimage_file] [-d defaults_file] firmware_file
-Merge a kernel and initramfs into a firmware compatible vendor firmware file:
        dns323-fw -m [-q (quiet)]
        -k kernel_file -i initramfs_file [-a sqimage_file] [-d defaults_file]
        [-p product_id]  [-c custom_id] [-l model_id ] [-u sub_id] [-v new_version]
        [-t type (0-FrodoII, 1-Chopper, 2-Gandolf, 3-DNS-325-A1A2, 4-DNS-320-A1A2, 5-DNS-320-B 6-DNS-320L] firmware_file
-Print information from a firmware file:
        dns323-fw -f firmware_file

Do you have a linux computer? I attach two binaries, one for a linux-x86 PC, the other for the box.

It is tempting to use a usb pen for this, it's ok, but the turn-around time (plug/unplug) is not the better for development. I setup a tftpserver and issue the following commands at u-boot:

setenv bootargs console=ttyS0,115200 root=/dev/ram0 init=/init
setenv ipaddr 192.168.1.100 # the box IP
setenv serverip 192.168.1.1 # the tftp server IP
tftp 0xa00000 uImage # load the kernel image in u-boot format into memory at 0xa00000
tftp 0xf00000 urootfs # the rootfs image in u-boot format into memory at  0xf00000
bootm 0xa00000 0xf00000 # run it from memory. DON'T flash it

As a matter of fact I defined a u-boot command for that, see eg Setting up U-BOOT or Jamie's Lentin site
Your DNS-320-rev-B u-boot might not support the tftp client mode, could you please post the available u-boot commands?

To get the uImage and urootfs, use 'dns323-fw -s <Alt-F-*.bin>' firmware files, it will create a kernel and initramfs files in u-boot format.
You can start with the fw files for the DNS320L. Please post the boot logs.
dns323-fw-linux-x86.gz
dns323-fw-box-arm.gz

Andrew G

unread,
Dec 4, 2014, 2:47:26 PM12/4/14
to al...@googlegroups.com
On Thursday, 4 December 2014 19:01:53 UTC, João Cardoso wrote:

Please post the output of 'cat /proc/mtd'. The full log from power up will also be useful, as there might exists differences from other board revisions.
 

/proc/mtd FOR DNS-320 rev B2, I think this is identical to DNS-320L

dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00500000 00020000 "uImage"
mtd2: 00500000 00020000 "ramdisk"
mtd3: 06400000 00020000 "image"
mtd4: 00a00000 00020000 "rescue firmware"
mtd5: 00500000 00020000 "config"
mtd6: 00200000 00020000 "my-dlink"

Attached is help output from u-boot, could not see in it commands for tftp transfer (just tftpboot) or serial transfer, so fat formatted usb stick seemed simplest.

Also attached is serial console output from boot up.

 
To get the uImage and urootfs, use 'dns323-fw -s <Alt-F-*.bin>' firmware files, it will create a kernel and initramfs files in u-boot format.
You can start with the fw files for the DNS320L. Please post the boot logs.


Will try to split the firmware and boot it, will post the results.

I also have some DNS-320 rev B1, they use exactly the same D-Link firmware update as rev B2 and contents of nand partitions mtd0/1/2/6 are identical. So hopefully any success on rev B2 will also work on rev B1.
DNS-320 rev B2 u-boot help.txt
DNS-320 rev B2 boot output.txt

Andrew G

unread,
Dec 4, 2014, 5:31:04 PM12/4/14
to al...@googlegroups.com


On Thursday, 4 December 2014 19:47:26 UTC, Andrew G wrote:
On Thursday, 4 December 2014 19:01:53 UTC, João Cardoso wrote:
 
To get the uImage and urootfs, use 'dns323-fw -s <Alt-F-*.bin>' firmware files, it will create a kernel and initramfs files in u-boot format.
You can start with the fw files for the DNS320L. Please post the boot logs.


 
Splitting firmware worked on box (stock firmware + fun_plug), but had to create link to library used by dns323-fw-box-arm:-
ln -s /ffp/lib/ld-uClibc.so.0 /lib/ld-uClibc.so.0

Copied files to usb memory stick, copied kernel/ramdisk to memory, booted from memory, log attached.

BOOTS!!!

All lights on: power=blue, usb=
white, L=orange, R=orange

serial console working
telnet working
web interface - non working stock firmware login page - then showing Alt-F 0.1RC4 Status Page

I think it is a bit confused, with just Alt-F kernel/ramdisk and rest is stock-firmware plus ffp.

Could you please check attached boot log.

What is next thing to try?
Flash whole Alt-F to nand using stock web ui, or possibly use u-boot to flash sqimage to mtd3 so Alt-F has all its own files?
boot log RC4 DNS-320L.txt

João Cardoso

unread,
Dec 4, 2014, 11:41:28 PM12/4/14
to al...@googlegroups.com


On Thursday, December 4, 2014 10:31:04 PM UTC, Andrew G wrote:


On Thursday, 4 December 2014 19:47:26 UTC, Andrew G wrote:
On Thursday, 4 December 2014 19:01:53 UTC, João Cardoso wrote:
 
To get the uImage and urootfs, use 'dns323-fw -s <Alt-F-*.bin>' firmware files, it will create a kernel and initramfs files in u-boot format.
You can start with the fw files for the DNS320L. Please post the boot logs.


 
Splitting firmware worked on box (stock firmware + fun_plug), but had to create link to library used by dns323-fw-box-arm:-
ln -s /ffp/lib/ld-uClibc.so.0 /lib/ld-uClibc.so.0

Copied files to usb memory stick, copied kernel/ramdisk to memory, booted from memory, log attached.

BOOTS!!!

Great!
 

All lights on: power=blue, usb=
white, L=orange, R=orange

There are some issues even for the 320L-rev-Ax boxes, the top-posted topic addresses some of them.
 

serial console working
telnet working
web interface - non working stock firmware login page - then showing Alt-F 0.1RC4 Status Page

browser cache
 

I think it is a bit confused, with just Alt-F kernel/ramdisk and rest is stock-firmware plus ffp.

You can try mounting the 'sqimage' file produced by the dns323-fw split procedure, for further testing Alt-F (together with the DNS-320L top-posted topic fixes)

dd if=sqimage of=/tmp/sqimage.xz bs=2048 skip=1
mkdir -p /rootmnt/sqimage
mount -o loop /tmp/sqimage.xz /rootmnt/sqimage
mount -t aufs -o remount,append:/rootmnt/sqimage=rr /
 
You now have an identical environment to the DNS320L. If you understand sh, read /etc/init.d/rcS, looking for DNS-320L
 
Could you please check attached boot log.

Just took a glimpse over it, and it looks OK.
 
What is next thing to try?
Flash whole Alt-F to nand using stock web ui,

It should not accept the 320L-rev-Ax firmware file
 
or possibly use u-boot to flash sqimage to mtd3 so Alt-F has all its own files?

The same result is safely obtained with the above 'dd/mount -o loop/aufs mount' procedure'

I don't have the time now, I still have some checks to do and that needs time and calm, which I don't have now. Please wait till the weekend finish :-)
 
Thanks

João Cardoso

unread,
Dec 4, 2014, 11:47:39 PM12/4/14
to al...@googlegroups.com


On Friday, December 5, 2014 4:41:28 AM UTC, João Cardoso wrote:


On Thursday, December 4, 2014 10:31:04 PM UTC, Andrew G wrote:


On Thursday, 4 December 2014 19:47:26 UTC, Andrew G wrote:
On Thursday, 4 December 2014 19:01:53 UTC, João Cardoso wrote:
 
To get the uImage and urootfs, use 'dns323-fw -s <Alt-F-*.bin>' firmware files, it will create a kernel and initramfs files in u-boot format.
You can start with the fw files for the DNS320L. Please post the boot logs.


 
Splitting firmware worked on box (stock firmware + fun_plug), but had to create link to library used by dns323-fw-box-arm:-
ln -s /ffp/lib/ld-uClibc.so.0 /lib/ld-uClibc.so.0

Copied files to usb memory stick, copied kernel/ramdisk to memory, booted from memory, log attached.

BOOTS!!!

Great!
 

All lights on: power=blue, usb=
white, L=orange, R=orange

There are some issues even for the 320L-rev-Ax boxes, the top-posted topic addresses some of them.
 

serial console working
telnet working
web interface - non working stock firmware login page - then showing Alt-F 0.1RC4 Status Page

browser cache
 

I think it is a bit confused, with just Alt-F kernel/ramdisk and rest is stock-firmware plus ffp.

You should verify that inetd is running, use 'rcinetd status', verify that you can ssh the box, and then disable the ffp telnet service, that might interfere with Alt-F inetd.
From the log it is active:

root: Starting ffp: * /ffp/start/SERVERS.sh inactive
* /ffp/start/portmap.sh inactive
* /ffp/start/nfsd.sh inactive
* /ffp/start/LOGIN.sh inactive
* /ffp/start/telnetd.sh ...
Starting /ffp/sbin/telnetd -l /ffp/bin/sh

João Cardoso

unread,
Dec 5, 2014, 9:33:50 AM12/5/14
to al...@googlegroups.com
You can also determine what's not working (leds, fan, buttons, temperature reading...) and try to follow A. Böhlr indications (Hacking around the GPIO Registers) on how to discover what is missing.

You can also exercise the dns320l-daemon (contained in the DNS-320L fixes post) and see what functions are working, if any. The dns320-temp.sh script, used in the dns-320, only reads the system temperature, while the dns320l-daemon controls many other things. Try 'dns320l-daemon -x help' (dns320l-daemon is based on A. Böhlr work, but it is heavily modified). As you are using the DNS-320L firmware, it's the dns320l-daemon program and not the dns320-temp.sh script that is being executed.
 

Andrew G

unread,
Dec 6, 2014, 11:41:33 PM12/6/14
to al...@googlegroups.com
Unusable, continuously resetting.
Took a while to remember that the reset button is on the bottom side of the board, where it gets pressed against the table.
Put board back into bottom part of case, now ok.


On Friday, 5 December 2014 04:41:28 UTC, João Cardoso wrote:
You can try mounting the 'sqimage' file produced by the dns323-fw split procedure, for further testing Alt-F (together with the DNS-320L top-posted topic fixes)

dd if=sqimage of=/tmp/sqimage.xz bs=2048 skip=1
mkdir -p /rootmnt/sqimage
mount -o loop /tmp/sqimage.xz /rootmnt/sqimage
mount -t aufs -o remount,append:/rootmnt/sqimage=rr /

Disabled ffp, successfully mounted sqimage, web ui working, inetd running, telnet working.

Samba not working, get following error when click "StartNow" in "Network Services":-
services_proc.cgi: line 66: rcsmb: not found

Manual start of samba with "/etc/init.d/S61smb start" seems to work.

Looks like dns320l-daemon is running, I will have a look at the suggested DNS-320L posts and see if I can get leds/switches/fans working.

Andrew G

unread,
Dec 7, 2014, 5:41:38 PM12/7/14
to al...@googlegroups.com
Checking dns320l-daemon and leds.

dns320l-daemon -x GetTemperature
Works and same temperatures in status page

dns320l-daemon -x SetFanFull
dns320l-daemon -x SetFanHalf
dns320l-daemon -x SetFanStop
All work and status page shows fan speed 6000/3000/0
Half/Stop seem to be permanent (temp is 30ºC-34ºC).
Full drops to Half after few seconds then drops to Stop 30 seconds later. I think a 30 second background task must be adjusting it. But this does not seem to happen when set to Half, fan just keeps going. Don't know what happens when hot.

dns320l-daemon -x PowerLedOff
dns320l-daemon -x PowerLedOn
dns320l-daemon -x PowerLedBlink
All work, Off only last few seconds before reappearing.

dns320l-daemon -x ReadRtc
dns320l-daemon -x hctosys
dns320l-daemon -x systohc
All work, time changes copied both ways as expected.

dns320l-daemon -x EnablePowerRecovery
dns320l-daemon -x DisablePowerRecovery
Return "OK", have not actually tested effect after power loss.
dns320l-daemon -x GetPowerRecoveryState
Returns (0=disabled/128=enabled) as appropriate.

dns320l-daemon -x EnableWOL
dns320l-daemon -x DisableWOL
Return "OK", have not actually tested wake up.
dns320l-daemon -x GetWOLState
Returns (0=disabled/1=enabled) as appropriate.

dns320l-daemon -x ShutdownDaemon
daemon process disappears, and is replaced by another with different pid

dns320l-daemon -x quit
just says "Bye" no obvious effect.

dns320l-daemon -x DeviceReady
Returns "OK".

Status page shows one hard disk in "left", it is actually in "right".
I think I might have seen a post about this, but could not find it again.
Both disk leds are orange, another post says this means degraded raid. Agrees with status page.
This disk was formatted by stock firmware, I presume Alt-F can be told that it is not raid.

echo 1 > /tmp/sys/usb_led/brightness
echo 0 > /tmp/sys/usb_led/brightness
cat /tmp/sys/usb_led/brightness
turn "usb orange" led on/off and report state
off only lasts few seconds before reappearing (usb stick is plugged in)

echo 1 > /tmp/sys/usb2_led/brightness
echo 0 > /tmp/sys/usb2_led/brightness
cat /tmp/sys/usb2_led/brightness
turn "usb blue" led on/off and report state

echo 1 > /tmp/sys/left_led/brightness
echo 0 > /tmp/sys/left_led/brightness
cat /tmp/sys/left_led/brightness
echo 1 > /tmp/sys/right_led/brightness
echo 0 > /tmp/sys/right_led/brightness
cat /tmp/sys/right_led/brightness
seem to correctly control the left/right hard disk orange leds.
off only lasts few seconds before reappearing
Do not know how to test the hard disk blue leds.

Trying shutdown by invoking the \sbin\poweroff script
    #!/bin/sh
    nohup rcall stop &
    dns320l-daemon -x DeviceShutdown
    busybox poweroff
Seems to shutdown fairly cleanly, filesystem was still in use, probably due to mounting sqimage from hard disk.
Suggest change nohup command line in \sbin\poweroff to:-
    nohup rcall stop >/dev/null 2>&1 &
to prevent it creating a nohup.out file in the current directory.

That's enough for today.

So far does not seem to be any difference between DNS-320L rev A? and DNS-320 rev B?, except for:-
1) DNS-320L has more ram. 256MB instead of 128MB.
2) Stock firmware installed by D-Link.
3) Label.
4) Slightly higher price for DNS-320L

Suggest build DNS-320 rev B? version of Alt-F which is identical to DNS-320L except for necessary tweaks to get stock firmware to accept it. Could possibly also include a ram size check to enable correct model no to be displayed (unless better way to distinguish them is found).

João Cardoso

unread,
Dec 8, 2014, 11:21:41 AM12/8/14
to al...@googlegroups.com

Good job Andrew!

So the DNS-320-rev-Bx is in reality a DNS-320L-rev-Ax with half the memory, both having the same CPU running at the same frequency:

DNS-320L-rev-A1:
U-Boot 1.1.4 (Apr 17 2012 - 19:36:21) Marvell version: 3.6.0.DNS-320L.01
Soc: 88F6702 A1 CPU running @ 1000Mhz L2 running @ 500Mhz
SysClock = 400Mhz , TClock = 166Mhz 

DNS-320-rev-B:
U-Boot 1.1.4 (Apr 19 2012 - 11:21:19) Marvell version: 3.6.0.DNS-320B.01
Soc: 88F6702 A1 CPU running @ 1000Mhz L2 running @ 500Mhz
SysClock = 400Mhz , TClock = 166Mhz

Most odd things in your dns320l-daemon testing are due to 'sysctrl' (fan/temp/led/button/... daemon) being executed and restore the fan/led to their "proper" values.
More comments bellow.

On Sunday, December 7, 2014 10:41:38 PM UTC, Andrew G wrote:
Checking dns320l-daemon and leds.

dns320l-daemon -x GetTemperature
Works and same temperatures in status page

dns320l-daemon -x SetFanFull
dns320l-daemon -x SetFanHalf
dns320l-daemon -x SetFanStop
All work and status page shows fan speed 6000/3000/0
Half/Stop seem to be permanent (temp is 30ºC-34ºC).
Full drops to Half after few seconds then drops to Stop 30 seconds later. I think a 30 second background task must be adjusting it. But this does not seem to happen when set to Half, fan just keeps going. Don't know what happens when hot.

sysctrl resets the proper values
 

dns320l-daemon -x PowerLedOff
dns320l-daemon -x PowerLedOn
dns320l-daemon -x PowerLedBlink
All work, Off only last few seconds before reappearing.

Again sysctrl 

dns320l-daemon -x ReadRtc
dns320l-daemon -x hctosys
dns320l-daemon -x systohc
All work, time changes copied both ways as expected.

dns320l-daemon -x EnablePowerRecovery
dns320l-daemon -x DisablePowerRecovery
Return "OK", have not actually tested effect after power loss.
dns320l-daemon -x GetPowerRecoveryState
Returns (0=disabled/128=enabled) as appropriate.

dns320l-daemon -x EnableWOL
dns320l-daemon -x DisableWOL
Return "OK", have not actually tested wake up.
dns320l-daemon -x GetWOLState
Returns (0=disabled/1=enabled) as appropriate.

dns320l-daemon -x ShutdownDaemon
daemon process disappears, and is replaced by another with different pid

That's 'init' that noticed it was terminated and relaunches it.
 

dns320l-daemon -x quit
just says "Bye" no obvious effect.

dns320l-daemon -x DeviceReady
Returns "OK".

That's needed at initialization/boot time


Status page shows one hard disk in "left", it is actually in "right".
I think I might have seen a post about this, but could not find it again.

There is a fix for that (System->Utilities->Fixes)
 
Both disk leds are orange, another post says this means degraded raid. Agrees with status page.
This disk was formatted by stock firmware, I presume Alt-F can be told that it is not raid.

It is not RAID? Can you please post the output of 'mdadm --examine --scan --verbose'
 
echo 1 > /tmp/sys/usb_led/brightness
echo 0 > /tmp/sys/usb_led/brightness
cat /tmp/sys/usb_led/brightness
turn "usb orange" led on/off and report state
off only lasts few seconds before reappearing (usb stick is plugged in)

sysctrl
 

echo 1 > /tmp/sys/usb2_led/brightness
echo 0 > /tmp/sys/usb2_led/brightness
cat /tmp/sys/usb2_led/brightness
turn "usb blue" led on/off and report state

echo 1 > /tmp/sys/left_led/brightness
echo 0 > /tmp/sys/left_led/brightness
cat /tmp/sys/left_led/brightness
echo 1 > /tmp/sys/right_led/brightness
echo 0 > /tmp/sys/right_led/brightness
cat /tmp/sys/right_led/brightness
seem to correctly control the left/right hard disk orange leds.
off only lasts few seconds before reappearing

sysctrl
 
Do not know how to test the hard disk blue leds.

it's not user controllable, that's the SATA driver job. I managed to make the blue leds blink at disk access, that will be available at the next release.


Trying shutdown by invoking the \sbin\poweroff script
    #!/bin/sh
    nohup rcall stop &
    dns320l-daemon -x DeviceShutdown
    busybox poweroff
Seems to shutdown fairly cleanly, filesystem was still in use, probably due to mounting sqimage from hard disk.

Ah, better to copy it to /tmp using the "user boot script", Services->user
 
Suggest change nohup command line in \sbin\poweroff to:-
    nohup rcall stop >/dev/null 2>&1 &
to prevent it creating a nohup.out file in the current directory.

That's enough for today.

And that's enough!
 

So far does not seem to be any difference between DNS-320L rev A? and DNS-320 rev B?, except for:-
1) DNS-320L has more ram. 256MB instead of 128MB.
2) Stock firmware installed by D-Link. 
3) Label.
4) Slightly higher price for DNS-320L

Suggest build DNS-320 rev B? version of Alt-F which is identical to DNS-320L except for necessary tweaks to get stock firmware to accept it. Could possibly also include a ram size check to enable correct model no to be displayed (unless better way to distinguish them is found).

Yes, I will do that soon.

Can you please post the output of 'cat /proc/cpuinfo'? The 320L-rev-A1 says:

processor       : 0
model name      : Feroceon 88FR131 rev 1 (v5l)
BogoMIPS        : 996.14
Features        : swp half fastmult edsp 
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant     : 0x2
CPU part        : 0x131
CPU revision    : 1

Hardware        : DNS-320L-A1
Revision        : 0000
Serial          : 0000000000000000

I guess that the 320-rev-B will report the same.

I don't know what happened with Luca Avalle 320-rev-B flash attempt, as nothing has changed meanwhile: https://groups.google.com/d/msg/alt-f/FPBtrvhMZAU/O1fFGgG_b6IJ

You can try to make you own firmware file using dns323-fw using the '-m' option, and supplying the values that it reports on a D-Link fw files when using '-s'

dns323-fw -s D-Link-fw-for-the-320-rev-B

should report:

product_id=0;
custom_id=8;
model_id=c; # this is hexadecimal, 12 decimal
sub_id=1;
NewVersion=1;
signature="DNS320B";

and produce a kernel/initramfs/sqimage files.

You can then use  'dns323-fw -m -t 5 ...' supplying the above values and the extracted files. The type argument, '-t 5' should be used to create fw for the DNS-320-B.
The resulting file should be exactly equal to the D-Link-fw-for-the-320-rev-B original file. Don't be fooled by file size, use 'cmp' on both the original and the reconstructed fw file

After being reassured that you know how to create a fw file, use the same procedure to create a Alt-F fw file using the kernel/initramfs/sqimage extracted from a Alt-F fw file for the 320L -- it should be accepted by the D-Link fw updater.

Notice that you must use the sqimage file produced by 'dns323-fw -s', *NOT* the one that you use to mount it, as it doesn't has the first 2048 bytes (you removed them when you used 'dd if=sqimage of=/tmp/sqimage.xz bs=2048 skip=1')

Thanks!

Andrew G

unread,
Dec 8, 2014, 9:37:53 PM12/8/14
to al...@googlegroups.com


On Monday, 8 December 2014 16:21:41 UTC, João Cardoso wrote:
Most odd things in your dns320l-daemon testing are due to 'sysctrl' (fan/temp/led/button/... daemon) being executed and restore the fan/led to their "proper" values.
What surprised me about the fan was that after setting half speed the fan stayed running, temperature only 34ºC so would have expected 'sysctrl' to stop it the next time it checked, which is what seemed to happen when set to full speed.

 
Status page shows one hard disk in "left", it is actually in "right".
 
There is a fix for that (System->Utilities->Fixes)
 
Thanks, did not know enough about Alt-F to realise such a useful facility existed.
Unfortunately seemed to have no effect, maybe needs restart, not very important anyway.
 
Both disk leds are orange, another post says this means degraded raid. Agrees with status page.
This disk was formatted by stock firmware, I presume Alt-F can be told that it is not raid.

It is not RAID? Can you please post the output of 'mdadm --examine --scan --verbose'
 
Done a bit of checking, looks like stock firmware combines sda1 and sdb1 partitions in raid 1 mirror and uses it for swap space, even if user partitions are not raided or only one disk. So Alt-F status page is correct to say:-
md0     0.5GB     raid1     clean     degraded     idle

/ # mdadm --examine --scan --verbose
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b34c5e15:198c22ee:a8d0ca14:859520a8
   devices=/dev/sda1
/ # cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/md0                                partition       524220  0       1

Minor tweak to DNS-320L fixes





Suggest change nohup command line in \sbin\poweroff to:-
    nohup rcall stop >/dev/null 2>&1 &
to prevent it creating a nohup.out file in the current directory.

Can you please post the output of 'cat /proc/cpuinfo'? The 320L-rev-A1 says:

/ # cat /proc/cpuinfo

processor       : 0
model name      : Feroceon 88FR131 rev 1 (v5l)
BogoMIPS        : 996.14
Features        : swp half fastmult edsp
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant     : 0x2
CPU part        : 0x131
CPU revision    : 1

Hardware        : DNS-320L-A1
Revision        : 0000
Serial          : 0000000000000000

Identical to DNS-320L rev A1.


I don't know what happened with Luca Avalle 320-rev-B flash attempt, as nothing has changed meanwhile: https://groups.google.com/d/msg/alt-f/FPBtrvhMZAU/O1fFGgG_b6IJ

Only activity since Nov 18 seems to be me, I posted on that thread because it was first I found. The similarity with DNS-320L means this is obviously the way to go. I already added a link to end of other thread to point readers to this thread.


You can try to make you own firmware file using dns323-fw

Will try this next and report back.

Shutdown from web ui worked, log attached.
Looks like it is trying to stop raid before swap (which is on raid), maybe stop swap should be done earlier.
The ejecting sda failure still there, wonder if it could be due to raid still running.
Will try adding manual swapoff to the /sbin/poweroff script next time.
shutdown DNS-320 2014-12-08.txt

Andrew G

unread,
Dec 9, 2014, 11:38:16 AM12/9/14
to al...@googlegroups.com
On Monday, 8 December 2014 16:21:41 UTC, João Cardoso wrote:
You can try to make you own firmware file using dns323-fw using the '-m' option, and supplying the values that it reports on a D-Link fw files when using '-s'

D-Link and Alt-F Firmware remerged as suggested, log attached.
Only two bytes changed, 'L' =>'B' and 11=>12.
# cmp -l Alt-F-0.1RC4-DNS-320L-rev-A1.bin altf-remerged-dns320b
57 114 102
63  13  14

Disabled ffp and rebooted to stock firmware.
Flashed the remerged Alt-F firmware through stock web ui.

Booted.
Applied tweaked version of DNS-320L patches.
Shutdown from Alt-F web ui.
Log attached.

Earlier swapoff (in /sbin/poweroff) prevented raid in use error.
Still getting in use errors for aufs and sda2, the sda2 may be related to the line:-
Unmounting /mnt/sda2/Alt-F aufs branch failed, stop all services first.
so maybe only problem is aufs, which I do not understand yet, just that it is some weird form of mount.

All this work for a two byte change!

I purchased DNS-320 rev B's because slightly cheaper than L's and I did not want the 'cloud' features of L.
But for Alt-F the L is probably better just for the extra ram, wish I had known that earlier.
Wonder if that dns323-fw split/remerge would work well on the stock firmware, to load stock L firmware on B hardware or vice versa.
firmware remerge log.txt
log DNS-320 rev B 2014-12-09.txt

João Cardoso

unread,
Dec 9, 2014, 2:19:01 PM12/9/14
to al...@googlegroups.com


On Tuesday, December 9, 2014 4:38:16 PM UTC, Andrew G wrote:
On Monday, 8 December 2014 16:21:41 UTC, João Cardoso wrote:
You can try to make you own firmware file using dns323-fw using the '-m' option, and supplying the values that it reports on a D-Link fw files when using '-s'

D-Link and Alt-F Firmware remerged as suggested, log attached.
Only two bytes changed, 'L' =>'B' and 11=>12.
# cmp -l Alt-F-0.1RC4-DNS-320L-rev-A1.bin altf-remerged-dns320b
57 114 102
63  13  14


Yes, that's like a different t-shirt for the same body.
As a matter of fact all Alt-F fw files are in reality only two, one for the DNS-323/321 (using the orion SoC) and other for the DNS-320/320L/325 (using the Kirkwood SoC), then they are "dressed" in a form suitable for the D-Link fw upgrade page to accept it.

 
Disabled ffp and rebooted to stock firmware.
Flashed the remerged Alt-F firmware through stock web ui.

Booted.

Great! Does it works on your B1 and B2 boards?

I will make an Experimental release for the DNS-320-rev-Bx and the DNS320L-rev-Ax tomorrow, with all fixes applied (and no need for the DNS-320L fixes)
 

Applied tweaked version of DNS-320L patches.
Shutdown from Alt-F web ui.
Log attached.

Earlier swapoff (in /sbin/poweroff) prevented raid in use error.

I think the best is for users to break the RAID1 and use a standard swap partition, see the Purple leds, can't access to my NAS webpage post

Still getting in use errors for aufs and sda2, the sda2 may be related to the line:-
Unmounting /mnt/sda2/Alt-F aufs branch failed, stop all services first.

Yes. That will sometime happens even if no open files are reported by 'lsof'. But the filesystems are mounted read-only if unmounting fails, so there is no read danger.
 

so maybe only problem is aufs, which I do not understand yet, just that it is some weird form of mount.

All this work for a two byte change! 


I purchased DNS-320 rev B's because slightly cheaper than L's and I did not want the 'cloud' features of L.
But for Alt-F the L is probably better just for the extra ram, wish I had known that earlier.
Wonder if that dns323-fw split/remerge would work well on the stock firmware, to load stock L firmware on B hardware or vice versa.

I think it will work.

As I told above (almost) everything is identical for the DNS-320/320L/325 Alt-F. The "almost"  is some code appended/prepended to the linux kernel that enables it to boot even when the bootloader says that the hardware platform is different.
You can split the 320L fw file and load it on the 320-rev-B using u-boot commands, just to see if it boots; if it does, I'm certain that re-dressing and flashing it will also works.
 

Andrew G

unread,
Dec 9, 2014, 6:17:57 PM12/9/14
to al...@googlegroups.com
On Tuesday, 9 December 2014 19:19:01 UTC, João Cardoso wrote:
Great! Does it works on your B1 and B2 boards?

Sorry the DNS-320 rev B2 is only spare at the moment, all others holding important data and backups. Will stay with stock firmware until absolutely sure Alt-F is better and stable.
 
I will make an Experimental release for the DNS-320-rev-Bx and the DNS320L-rev-Ax tomorrow, with all fixes applied (and no need for the DNS-320L fixes)

Good, will look forward to trying it.
I tried to build RC4 myself, but failed (ticket #356 raised), two source tars could not be downloaded, probably deleted by site owners, plus I think there is some other problem that I do not understand yet.

I think the best is for users to break the RAID1 and use a standard swap partition, see the Purple leds, can't access to my NAS webpage post

Partly agree, maybe d-link did it to prevent crash when hdd fails, swapped data should still work. But as this is d-link's standard partitioning there may be several less knowledgable users who end up with raided swap, or people who want to keep partitioning compatible with stock firmware. I added swapoff to /sbin/poweroff because it was an easy place to change, actually suggesting just moving slightly earlier in shutdown sequence, just before raid is closed. I do not like seeing unnecessary errors in logs, makes it much harder to trace other errors when they occur.

D-Link's partitioning is one reason I want to try Alt-F, would like to create a system which has no system data on the hard disks, everthing in nand or ram, or maybe usb. So that hard disks can be present/missing and the partitioning/formatting can be changed in any way without the operating system being effected.
Do not think Alt-F can do that yet, but all its design/code is accessible to be tweaked. Using D-Link because cheapest way to get board/case/power-supply with support for 2 sata disks and gigabit networking.

João Cardoso

unread,
Dec 10, 2014, 2:43:01 PM12/10/14
to al...@googlegroups.com


On Tuesday, December 9, 2014 11:17:57 PM UTC, Andrew G wrote:
On Tuesday, 9 December 2014 19:19:01 UTC, João Cardoso wrote:
Great! Does it works on your B1 and B2 boards?

Sorry the DNS-320 rev B2 is only spare at the moment, all others holding important data and backups. Will stay with stock firmware until absolutely sure Alt-F is better and stable.

OK, please let me know when you use it in your B1 box.
 
 
I will make an Experimental release for the DNS-320-rev-Bx and the DNS320L-rev-Ax tomorrow, with all fixes applied (and no need for the DNS-320L fixes)

Good, will look forward to trying it.

Please read the page README and execute the script.

I tried to build RC4 myself, but failed (ticket #356 raised), two source tars could not be downloaded, probably deleted by site owners, plus I think there is some other problem that I do not understand yet.

There is an extensive forum thread about compiling RC4. Unfortunately every linux distribution has its own peculiarities.


I think the best is for users to break the RAID1 and use a standard swap partition, see the Purple leds, can't access to my NAS webpage post

Partly agree, maybe d-link did it to prevent crash when hdd fails, swapped data should still work.

I understand that. But currently Alt-F does not support that in a clean way.
 
But as this is d-link's standard partitioning there may be several less knowledgable users who end up with raided swap, or people who want to keep partitioning compatible with stock firmware. I added swapoff to /sbin/poweroff because it was an easy place to change, actually suggesting just moving slightly earlier in shutdown sequence, just before raid is closed.

I have changes that as for your suggestion, and it seems to work fine.
 
I do not like seeing unnecessary errors in logs, makes it much harder to trace other errors when they occur. 

D-Link's partitioning is one reason I want to try Alt-F, would like to create a system which has no system data on the hard disks, everthing in nand or ram, or maybe usb. So that hard disks can be present/missing and the partitioning/formatting can be changed in any way without the operating system being effected.
Do not think Alt-F can do that yet,

Yes it can.
Just don't install any Alt-F package (or hit the "RemoveAll" button in Alt-F Package Manager) and the disk will not be used at all.
Of course you can only use pre-installed (on flash) packages and can't use pre-installed packages that need the disk, such as minidlna, that needs to create huge databases.
Even if you have Alt-F packages installed, they will be active only when the Alt-F directory is found; if the disk is removed they will not be used and the system will work fine.

Matthew

unread,
Jan 11, 2015, 4:46:06 AM1/11/15
to
I flashed the B2 build to a DNS-320 B1 that I had sitting in a draw doing nothing, Seems to have worked fine and was able to go through the setup wizard ok

Alt-F 0.1RC4.1 Status Page help

Checking this will refresh different sections in the page every 10 to 20 seconds.
This consumes CPU, so if you are waiting for something lengthly to accomplish
it will actually take more time if autorefresh is enabled.
System
Temperature
34.0°C/93.2°F
Fan speed
0
Load
0.11
CPU
37%
Memory
33% of 128MB
Swap
0% of 511MB
Name: dns320
Model: DNS-320L-A1
Date: Sun Jan 11 09:40:41 GMT 2015Uptime: 0 day(s) 0 hour(s)
Network Speed:1000Mbps Duplex:full MTU:1500 TX:268.5KiB Rx:319.7KiB IP:172.23.197.88
Disks
BayDev.ModelCapacityPower StatusTempHealth
rightsdaWDC WD1600JS-75NCB3 160.0GB active or idle 28°C/82.4°F passed
RAID
Dev.CapacityLevelStateStatusActionDoneETA
md00.0GB
clear



Mounted Filesystems
Dev.LabelCapacityAvailableFSModeDirtyAutomatic FSCK in
sda2
146.1GB
146.0GB
ext4RW
32 mounts or 179 days


If I decide to use the Nas properly then I'll replace that 160GB drive with something larger, it was just a spare drive I had laying about.

João Cardoso

unread,
Jan 11, 2015, 1:31:55 PM1/11/15
to


On Sunday, January 11, 2015 at 9:46:06 AM UTC, Matthew wrote:
I flashed the B2 build to a DNS-320 B1 that I had sitting in a draw doing nothing, Seems to have worked fine and was able to go through the setup wizard ok

Thanks for reporting.

So the DNS-320 with hardware boards rev-A1/A2/B1/B2 are supported.
The DNS-320-rev-B1/B2 are in effect DNS-320L-rev-A1/A1/A3 with half the RAM.
Message has been deleted

Ioan Atudosie

unread,
Dec 23, 2019, 2:14:07 AM12/23/19
to al...@googlegroups.com
Hello guys,

I do have a DNS-320 Ver B2 (see photo). I am not able to run any firmware on it, so it's stuck to v 1.0
Is there any way to "upgrade" it with a firmware so that it becomes a "cloud" 320L?

Any help appreciated,
Thank you!

Ioan.


Ioan Atudosie

unread,
Dec 23, 2019, 4:39:43 AM12/23/19
to Alt-F
Update: i have used the Alt-F-1.0-DNS-320-rev-Bx, the firmware upgrade went OK.
Unfortunately, i cannot do anything now with my DNS-320, since it isn't shown anymore on my local LAN.

Is there a way to REVERT the firmware upgrade?
Resetting it from the bottom button of the device gives only red lashing on both HDD led, but it doesn't give the expected result.

Any help appreciated, thanks.
Ioan

Joao Cardoso

unread,
Dec 23, 2019, 9:11:23 PM12/23/19
to Alt-F


On Monday, December 23, 2019 at 9:39:43 AM UTC, Ioan Atudosie wrote:
Update: i have used the Alt-F-1.0-DNS-320-rev-Bx, the firmware upgrade went OK.
Unfortunately, i cannot do anything now with my DNS-320, since it isn't shown anymore on my local LAN.

Is there a way to REVERT the firmware upgrade?
Resetting it from the bottom button of the device gives only red lashing on both HDD led,

Try pressing the reset button for more than 20 seconds. Does the box does a reboot after that? If it reboots, Alt-F is working and there is some network issue. 
But try this first: if the the power button is pressed for more than 4-6 seconds, does any led starts blinking and the box powers off? If it powers off, Alt-F is working and there is some network issue.
At power up, does the power led starts blinking and then stops blinking and turned on, or does it keeps blinking?

As there is not beeper or display on the box, the blinking leds are the only possible diagnostic source, so observe its response to power up and buttons pressing (short, long press, how long, etc)  and report accurately how does it response.
There is an "about buttons and leds" alt-F wiki, but I'm afraid that it is outdated and that it only applies to the dns-323/325.
That's better to perform those tests without disks.

but it doesn't give the expected result.

Any help appreciated, thanks.
Ioan



On Monday, December 23, 2019 at 9:14:07 AM UTC+2, Ioan Atudosie wrote:
Hello guys,

I do have a DNS-320 Ver B2 (see photo). I am not able to run any firmware on it, so it's stuck to v 1.0
Is there any way to "upgrade" it with a firmware so that it becomes a "cloud" 320L?

You have to make Alt-F work first, than try to flash the D-Link DNS-320L firmware, that should be accepted.
The DNS-320-revB has the same main board  that a DNS-320L-revA, except half the memory.

Ioan Atudosie

unread,
Dec 24, 2019, 6:28:36 AM12/24/19
to Alt-F
Thank you, Joao,

The situation is now much better: after multiple reset attempts while connected to internet and without the drives inside, the unit started to act "normally". Unfortunately, i had to completely remove Alt-F, even though it gave me an unexpected result: the firmware version displayed now on the D-Link webapp is no longer 1.0, but 1.11, dating from 2018. Also, the booting starts in the first 3 seconds while pressing the power, as reported by others as well.

Thank you for your help; i would like to remain like this for the moment, i'm quite satisfied with it. Given that B2 comes with half memory compared to Ax, there isn't too much to ask, right? :)

Once again, thank you for your response.
If i will decide later to go for the 320L version (the so-called "cloud-version", i will let you know.

Best wishes for the upcoming Holidays! :)

Ioan.
Reply all
Reply to author
Forward
0 new messages