Differences

This shows you the differences between the selected revision and the current version of the page.

dns-320 2012/01/14 19:00 dns-320 2021/01/06 20:56 current
Line 1: Line 1:
====== DNS-320 ====== ====== DNS-320 ======
This page will share some more information about the [[http://www.dlink.co.uk/cs/Satellite?c=Product_C&childpagename=DLinkEurope-GB/DLProductCarouselMultiple&cid=1197388178398&p=1197318962342&packedargs=ProductParentID%3D1195808623796%26category%3DQuickProductFinder%26locale%3D1195806691854%26term%3DShareCenter%2BPulse%2B%2528DNS-320%2529&pagename=DLinkEurope-GB/DLWrapper|ShareCenter Pulse (DNS-320)]].\\ This page will share some more information about the [[http://www.dlink.co.uk/cs/Satellite?c=Product_C&childpagename=DLinkEurope-GB/DLProductCarouselMultiple&cid=1197388178398&p=1197318962342&packedargs=ProductParentID%3D1195808623796%26category%3DQuickProductFinder%26locale%3D1195806691854%26term%3DShareCenter%2BPulse%2B%2528DNS-320%2529&pagename=DLinkEurope-GB/DLWrapper|ShareCenter Pulse (DNS-320)]].\\
-Take a look at the [[http://nas-tweaks.net/devices/d-link-dns-320/|DNS-320-Page]] on NAS-Tweaks for further Pictures.\\ 
-\\ 
-//Note: This page is in progress, as of today (November 22nd 2010) the device is still pretty new.// 
- 
-//Note: Last edited on October 1st 2011 by [[Zane Chua]]// 
- 
- 
- 
- 
===== Hardware ===== ===== Hardware =====
Line 23: Line 14:
^ C library | gcc-4.2-glibc-2.5 | ^ C library | gcc-4.2-glibc-2.5 |
\\ \\
 +
 +== Reviews & Tutorials ==
 +
 +  * [[http://nas-tweaks.net/devices/d-link-dns-320/|DNS-320-Page on NAS-Tweaks with further Pictures]]
 +  * [[http://jamie.lentin.co.uk/devices/dlink-dns325/|Replacing firmware with Debian Linux]]
 +
== /proc/cpuinfo == == /proc/cpuinfo ==
<code>Processor      : ARM926EJ-S rev 1 (v5l) <code>Processor      : ARM926EJ-S rev 1 (v5l)
Line 50: Line 47:
</code> </code>
\\ \\
 +
Line 56: Line 54:
===== Serial PIN Layout ===== ===== Serial PIN Layout =====
-BusyBox break-in code is still 5784468+BusyBox break-in code is 5784468 for Firmware before v2.03. Starting with v2.03 it is set by the ui [http://forums.dlink.com/index.php?topic=42483.msg149905#msg149905].
Jumper: JP3\\ Jumper: JP3\\
Line 270: Line 268:
[...] [...]
</code> </code>
 +
===== Setting up ffp ===== ===== Setting up ffp =====
There is a complete Tutorial on the Installation of ffp available on NAS-Tweaks: [[http://nas-tweaks.net/40/installation-of-the-fonz-funplug-0-5-for-ch3snas-ch3mnas-dns-323-and-many-more/|Installation of fun_plug 0.5]]. If you want to do everything yourself instead, just follow the instructions below. There is a complete Tutorial on the Installation of ffp available on NAS-Tweaks: [[http://nas-tweaks.net/40/installation-of-the-fonz-funplug-0-5-for-ch3snas-ch3mnas-dns-323-and-many-more/|Installation of fun_plug 0.5]]. If you want to do everything yourself instead, just follow the instructions below.
-To get the [[http://wiki.dns323.info/howto:ffp|fonz fun_plug]] running some small changes to the available ffp ''fun_plug'' file are needed.+To get the [[howto:ffp|fonz fun_plug]] running some small changes to the available ffp ''fun_plug'' file are needed.
Search and replace all entries of ''/mnt/HD_a2/'' with ''/mnt/HD/HD_a2/''.\\ Search and replace all entries of ''/mnt/HD_a2/'' with ''/mnt/HD/HD_a2/''.\\
Line 301: Line 300:
cp -f /etc/samba/smbpasswd /usr/local/config/. cp -f /etc/samba/smbpasswd /usr/local/config/.
</code> </code>
 +
 +
Line 313: Line 314:
<code> <code>
wget http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz wget http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz
-wget http://kylek.is-a-geek.org:31337/files/Transmission-2.31-1.tgz+wget http://kylek.is-a-geek.org:31337/files/Transmission-2.42-1.tgz
funpkg -i curl-7.18.1.tgz funpkg -i curl-7.18.1.tgz
-funpkg -i Transmission-2.31-1.tgz+funpkg -i Transmission-2.42-1.tgz
</code> </code>
\\ \\
Line 328: Line 329:
</code> </code>
Edit the line from Edit the line from
-<code> +<code>
TRANSMISSION_HOME=/mnt/HD_a2/.transmission-daemon TRANSMISSION_HOME=/mnt/HD_a2/.transmission-daemon
</code> </code>
Line 478: Line 479:
TRANS_REMOTE="$BASE_SYS/bin/transmission-remote port --auth username:password" TRANS_REMOTE="$BASE_SYS/bin/transmission-remote port --auth username:password"
</code> </code>
- 
That should work. Theoretically. If something is wrong with my commands, can someone please edit. That should work. Theoretically. If something is wrong with my commands, can someone please edit.
- +\\ 
 +Configuration of Automatic. 
 +\\ 
 +I just recently decided to test out Automatic again, i had issues the last time but it seems everything works perfectly now so i'm including this here. 
 +\\ 
 +SSH into your NAS via PuTTY and make sure you're in /mnt/HD/HD_a2 
 +<code> 
 +wget http://kylek.is-a-geek.org:31337/files/Automatic-0.7.1-1.tgz 
 +wget http://www.inreto.de/dns323/fun-plug/0.5/packages/libxml2-2.6.31-2.tgz 
 +wget http://www.inreto.de/dns323/fun-plug/0.5/packages/pcre-7.7-1.tgz 
 +funpkg -i libxml2-2.6.31-2.tgz 
 +funpkg -i pcre-7.7-1.tgz 
 +funpkg -i Automatic-0.7.1-1.tgz 
 +</code> 
 +\\ 
 +You then need to edit the automatic.sh located in /ffp/start. 
 +<code> 
 +cd /ffp/start/ 
 +nano automatic.sh 
 +</code> 
 +Edit the line from 
 +<code> 
 +automatic_flags="-c /ffp/etc/automatic.conf -l /mnt/HD_a2/.transmission-daemon/automatic.log" 
 +</code> 
 +to 
 +<code> 
 +automatic_flags="-c /ffp/etc/automatic.conf -l /mnt/HD/HD_a2/.transmission-daemon/automatic.log -v 2" 
 +</code> 
 +Press Ctrl + O and Ctrl + X 
 +\\ 
 +\\ 
 +Now you need to create a automatic configuration file. We'll use the sample file. 
 +<code> 
 +cd /ffp/etc/ 
 +nano automatic.conf-sample 
 +</code> 
 +Remove the # from rpc-host and rpc-port.  
 +\\ 
 +If you need #rpc-auth means you've configured a username and password for Transmission. 
 +\\ 
 +Change the line from 
 +<code> 
 +torrent-folder = "/tmp" 
 +</code> 
 +to 
 +<code> 
 +torrent-folder = "/mnt/HD/HD_a2/.transmission-daemon/autotorrents" 
 +</code> 
 +and the line from 
 +<code> 
 +statefile = "~/.config/automatic.state" 
 +</code> 
 +to 
 +<code> 
 +statefile = "/mnt/HD/HD_a2/.transmission-daemon/automatic.state" 
 +</code> 
 +Edit in your RSS Feeds and filters 
 +\\ 
 +Press Ctrl + O when you're done and save it as automatic.conf 
 +then Press Ctrl + X 
 +\\ 
 +Now we need to go create the folders and state file for automatic. Fire up PuTTY again and do these commands: 
 +<code> 
 +cd /mnt/HD/HD_a2/.transmission-daemon 
 +mkdir autotorrents 
 +touch automatic.state 
 +chmod 777 automatic.state 
 +</code> 
 +\\ 
 +Now you can start automatic.sh by typing 
 +<code> 
 +/ffp/start/automatic.sh start 
 +</code> 
 +If you want to stop automatic 
 +<code> 
 +/ffp/start/automatic.sh stop 
 +</code> 
 +\\ 
 +Just some tips for the Filters. My RSS Feeds are basically sorted out so I used this section for filters 
 +<code> 
 +filter = {  pattern => "(?!.*.)"  
 +        } 
 +</code> 
 +It basically means that it applies to all RSS Feeds. 
 +\\ 
 +All my commands should be correct, someone edit em if they're wrong. Have fun!
===== Changing the port of Web Configuration Utility ===== ===== Changing the port of Web Configuration Utility =====
Line 546: Line 630:
\\ \\
\\ \\
 +
 +
 +
===== Setting up Debian in chrooted enviroment ===== ===== Setting up Debian in chrooted enviroment =====
-D-Link has recently put a prebuilt Debian Squeeze package on their [[ftp://ftp.dlink.pl/dns/dns-320/driver_software/DNS-320%26325_linuxDebian_revA_Squeeze_all_en_20110111.zip|ftp]] site. The package size is approximately 150 MB. Read the instruction inside.+D-Link put a prebuilt Debian Squeeze package on their [[ftp://ftp.dlink.pl/dns/dns-320/driver_software/DNS-320%26325_linuxDebian_revA_Squeeze_all_en_20110111.zip|ftp]] site, in 2011. The package size is approximately 150 MB. Read the instruction inside. You may have to modify ''--bind'' (dash-dash-bind) to ''--rbind'' (dash-dash-rbind) for the ''/proc'' (and possibly ''/dev'') mounts in fun_plug.debian to get some usb devices (e.g. the DS9490R USB-1wire adapter) to work properly in squeeze. 
 + 
 +The prebuilt Debian Squeeze package is NO LONGER available through the D-Link FTP, as of july 2014, but a backup is listed on this [[https://code.google.com/archive/p/funplug-dns320-dns325/downloads|Google Code]] page.
===== Source code for firmware ==== ===== Source code for firmware ====
Dlink have release source code for firmware 1.0 on their [[ftp://ftp.dlink.fr/DNS/DNS-320/GPL/dns-320_a1_fw_v1.00_gpl(0216101012).tgz|ftp]] site. The source code size is approximate 25 MB Dlink have release source code for firmware 1.0 on their [[ftp://ftp.dlink.fr/DNS/DNS-320/GPL/dns-320_a1_fw_v1.00_gpl(0216101012).tgz|ftp]] site. The source code size is approximate 25 MB
 +
Line 558: Line 648:
===== U-BOOT Configuration ==== ===== U-BOOT Configuration ====
You can access the boot console (for trying to run your own kernel) via a netconsole. You can access the boot console (for trying to run your own kernel) via a netconsole.
-To interrupt the U-Boot startup, press SPACE and 1 before the one-second timeout.+To interrupt the U-Boot startup, press SPACE and 1 before the one-second timeout. You should get a Marvell_DNS320>> prompt immediately. If the kernel starts to boot, you missed the timeout window. Starting ahead of the timeout and pressing SPACE-1-SPACE-1, etc. will increase you chances of hitting the window.
The full U-Boot environment (MAC addresses hidden) is: The full U-Boot environment (MAC addresses hidden) is:
Line 615: Line 705:
-===== Building a Custom Firwmware ("ROM") =====+===== Building a Custom Firmware ("ROM") =====
D-Link provides a complete build environment on its [[ftp://ftp.dlink.de/dns/dns-320/driver_software/DNS-320_GPL_code_revA.tgz|ftp server]] that lets you create your own firmware images easily. Untar it and run D-Link provides a complete build environment on its [[ftp://ftp.dlink.de/dns/dns-320/driver_software/DNS-320_GPL_code_revA.tgz|ftp server]] that lets you create your own firmware images easily. Untar it and run
<code> source build_fw </code> <code> source build_fw </code>
this will result in a file "DNS320-firmware" in the merge folder, which can be flashed to the unit via the webinterface (firmware update). this will result in a file "DNS320-firmware" in the merge folder, which can be flashed to the unit via the webinterface (firmware update).
-Right now the build_fw script does not do a full rebuild of the complete firmware, it rather puts together precompiled binaries that come with the built environment. [[http://forum.dsmg600.info/viewtopic.php?pid=41860#p41860|Here]] is an attempt at rebuilding the build script. [[http://curvedbrain.org/2008/06/09/building-firmware-binary-image-d-link-dns-323/|This]] blog post describes how to assemble a firmware image for the [[http://wiki.dns323.info/start|DNS-323]] and will probably helpful for the DNS-320 as well.+Right now the build_fw script does not do a full rebuild of the complete firmware, it rather puts together precompiled binaries that come with the built environment. [[http://dns323.kood.org/forum/viewtopic.php?pid=41860#p41860|Here]] is an attempt at rebuilding the build script. [[http://curvedbrain.org/2008/06/09/building-firmware-binary-image-d-link-dns-323/|This]] blog post describes how to assemble a firmware image for the [[http://wiki.dns323.info/start|DNS-323]] and will probably helpful for the DNS-320 as well.
Use this  custom build_fw to make a custom settings for the kernel Use this  custom build_fw to make a custom settings for the kernel
Line 1193: Line 1283:
===== Other info ===== ===== Other info =====
-The following [[http://forum.dsmg600.info/viewtopic.php?id=6094|thread]] handles some DNS-320 initial conversation, request there if you want some specific info here, or add yourself.+The following [[http://dns323.kood.org/forum/viewtopic.php?id=6094|thread]] handles some DNS-320 initial conversation, request there if you want some specific info here, or add yourself.
Line 1222: Line 1312:
and kill this process and kill this process
-or <code>killall fan_control</code>, and run <code>FT_testing -S</code>+or <code>killall fan_control</code>, and run <code>FT_testing -S</code>/code 
 + 
 + 
 + 
 + 
 +===== SSH Access ===== 
 +This is just a quick n' dirty way to get root access to the device. This configuration is __not__ recommended as permanent. 
 + 
 +  - Create fun_plug 
 +  - Create sshd_config 
 +  - reboot dns-320 
 + 
 + 
 +**File 1 fun_plug * ** 
 +<code> 
 +#!/bin/sh 
 +# credit to 
 +# http://webapps.itcs.umich.edu/radmind/index.php/Generate_ssh_host_keys 
 +# for the scripted ssh-keygen 
 + 
 +ssh-keygen -q -t dsa -f /mnt/HD/HD_a2/ssh_host_dsa_key -N ""\ 
 +    -C "" < /dev/null > /dev/null 2> /dev/null 
 + 
 +/usr/sbin/sshd -f /mnt/HD/HD_a2/sshd_config 
 +</code> 
 + 
 +**File 2 sshd_config * ** 
 +<code> 
 +Port 22 
 +Protocol 2 
 +HostKey /mnt/HD/HD_a2/ssh_host_dsa_key 
 +PermitEmptyPasswords yes 
 +PasswordAuthentication yes 
 +ChallengeResponseAuthentication no 
 +TCPKeepAlive yes 
 +</code> 
 + 
 +* Create the files with a Linux compatible text editor (Like [[http://notepad-plus.sourceforge.net/uk/site.htm|Notepad++]]) 
 + 
 +Connect: ''ssh root@dns_ip'' 
 + 
 + 
 + 
 + 
 +===== Detect USB button pressure ===== 
 +I wanted to replace the 8 seconds pressure on the power button by a simple pressure on the usb button. 
 +So, i've analysed the chk_io program while it seemed to be the one which does the job for the usb copy. 
 +The chk_io is not gpl, so only the binary is available. I used strace and LD_PRELOAD on ioctl to analyse it, 
 +and finally found a similar program for the dns-323. 
 + 
 +I'm not sure it's required to open /dev/REG each time, but it's what the official program does. 
 +Idem for the open attributes. 
 + 
 +I've created : 
 + 
 +* ffp/extra/shutdown/chkbutton (gcc -static -s chkbutton.c -o chkbutton) 
 + 
 +* /ffp/extra/shutdown/shutdown_ffp.sh 
 + 
 +* /ffp/extra/shutdown/usbOff.sh 
 + 
 +* /ffp/etc/fun_plug.local 
 + 
 +Just copy these files or feel free to modify them. 
 + 
 +Files are available here : http://nadenislamarre.free.fr/dns320 
 + 
 +<code> 
 +# chkbutton.c 
 + 
 +#define _GNU_SOURCE 1 
 +#include <stdio.h> 
 +#include <stdlib.h> 
 +#include <fcntl.h> 
 + 
 +#define DEVICE "/dev/REG" 
 +#define REQUEST 0x65 
 +#define REGISTER 0x10110 
 +#define BTN_NOTUSB 0x08000000 
 +  
 +int main (int argc, char *argv[]) { 
 +  int fd; 
 +  unsigned long data[2]; 
 + 
 +  while(1) { 
 +    if ((fd = open (DEVICE, O_RDWR|O_LARGEFILE)) == -1) { 
 +      exit(1); 
 +    } 
 + 
 +    data[0] = REGISTER; 
 +    data[1] = 0; 
 + 
 +    if(ioctl(fd, REQUEST, &data) == 0) { 
 +      if(! ((data[1] & BTN_NOTUSB) == BTN_NOTUSB)) { 
 +        printf("USB\n"); 
 +        fflush(stdout); 
 +        usleep(1000 * 1000 * 3); 
 +      } 
 +    } 
 +     
 +    close(fd); 
 +    usleep(1000*30); 
 +  } 
 +  
 +  return 0; 
 +
 +</code> 
 + 
 +The following script called in the /ffp/etc/fun_plug.local make the dns-320 reboot just by pressing on the usb button. 
 +The redirection to /dev/null is required because the shutdown.sh script kill processes on some conditions. 
 + 
 +<code> 
 +#!/bin/sh 
 + 
 +# /ffp/extra/shutdown/usbOff.sh 
 + 
 +export PATH=$PATH:/bin:/sbin 
 + 
 +chkbutton | 
 +while read BTN 
 +do 
 +  if test "$BTN" = "USB" 
 +  then 
 +    led usb blue blinking 
 +    shutdown_ffp.sh >/dev/null 2>/dev/null 
 +    exit 0 
 +  fi 
 +done 
 +</code> 
 + 
 +<code> 
 +#!/bin/sh 
 + 
 +# /ffp/etc/fun_plug.local 
 + 
 +# replacement for shutdown ; must not be on a mounted device 
 +cp /ffp/extra/shutdown/* /sbin 
 +usbOff.sh& 
 +</code> 
 + 
 +The shutdown script is the same as the official one except that i've added a proper shutdown for ffp : /ffp/etc/rc stop 
 + 
 +<code> 
 +#!/bin/sh 
 + 
 +# /ffp/extra/shutdown/shutdown_ffp.sh 
 + 
 +source /usr/local/modules/files/project_features 
 + 
 +/ffp/etc/rc stop 
 + 
 +kill_running_process 
 +#kill -9 -1 
 + 
 +# remove link file 
 +rm /usr/local/upload 
 +sync 
 + 
 +umount_dev.sh all 
 + 
 +umount /usr/local/config 
 + 
 +sleep 1 
 +# shutdown device 
 + 
 +MODEL=$(cat "/usr/local/modules/files/model") 
 +echo "MODEL:$MODEL" 
 + 
 +if [ "$PROJECT_FEATURE_MCU_CHIP_WT693P" = "1" ]; then 
 + echo "device shutdown" 
 + up_send_ctl DeviceShutdown 0 
 + 
 +elif [ "$PROJECT_FEATURE_MCU_CHIP_69P803" = "1" ]; then 
 + echo "send cmd to micro-p to shutdown" 
 + up_send_ctl DeviceShutdown 1 
 +else 
 + poweroff 
 +fi 
 +</code> 
 + 

Navigation

Personal Tools