Posted: Sun Oct 13, 2013 8:19 Post subject: TP-LINK TL-WDR3600 HDD sharing, OPTWARE, DLNA, Torrent
Hi Guys!
I have got a TP-LINK TL-WDR3600, and I installed the last version of dd-wrt on it.
Until now it is working fine, but i would like to share my 1Tb nfts hdd, i would like to stream the movies from HDD with my Panasonic TV (via DLNA) and also i would like to torrent with the router.
Could anybody help me, with Sharing, DLNA and torrent installation?
Update 28-OCT-2016: Thanks to myself . Script Revision for Build 30731 Update 21-JUN-2016: Big Thanks to petoniano. Script Revision Update 23-MAY-2016: Big Thanks to dejavubr. Script Revision for Build 29739 - New Item: 7 - Alternative Repositories Update 09-MAY-2016: Big Thanks to ArturDent, williamfa and js1662 - Script revision Update 14-DEC-2014: Thanks to "xakep" - Script revision Update 11-DEC-2014: Revision for EXT3 Update 29-NOV-2014: Big Thanks to "DarkGhostHunter", "js1662" and "InfoScav" - Script Revision for Build 25408 Update 01-OCT-2014: Big Thanks to "kkuhle", "InfoScav" and "laurentiu.tns" Update 22-AUG-2014: Script Revision for Build 24118 Update 30-MAY-2014: Versions Update Update 06-APR-2014: Revision and improvements scripting for Build 23838 Update 24-MAR-2014: Thanks to "jirkavy", "Taboganist007" and "roliverio" - Working on build 23503 Update 28-JAN-2014: Thanks to "dulceata33", "andsus" and "peatkoterz" Update 22-OCT-2013: Thanks to "snoop86"
Please read the following instructions before taking any action. That will be good for you getting used to them.
-------------------------------------------------------------------------------------------------
0. Hardware and Prerequisites
-------------------------------------------------------------------------------------------------
0.0 TP-Link WDR3600-N600 - v1.1: Have DD-WRT Build in between 25408 and 30731, flashed and working.
0.0.1 Also Works with the following devices (not tested, but reported):
- TP Link WDR4300
- TP Link Archer C7
- Netgear WNDR3700
0.1 PuTTY and WinSCP: Google, download and make them ready for use.
0.2 Kingston 16GB - DT101/G2: Create two partitions on the USB thumbdrive, using MiniTool Partition Wizard for example.
0.2.1 First Partition
- Partition Size : 14 GB (unallocated space)
- File System : NTFS or EXT3
- Create As : Primary
- Partition Label: Data (or whatever label you want to, but Optware)
0.2.2 Second Partition
- Partition Size : 100 MB
- File System : NTFS or EXT3
- Create As : Primary
- Partition Label: System (or whatever label you want to, but Optware)
0.4 Router: stick the USB thumbdrive on router and reboot it.
0.5 Wait few seconds. Then make sure both [mnt/sda1] and [mnt/sda2] are mounted on the router and shared by Samba (from DD-WRT Web Interface)
-------------------------------------------------------------------------------------------------
1. Optware
-------------------------------------------------------------------------------------------------
1.1 Run the following line-by-line, using PuTTY:
Code:
cd /tmp/mnt/sda1
touch .optware.enable
cd /tmp/mnt/sda2
mkdir etc opt root bin lib usr
touch .optware.enable
chmod 755 etc opt root bin lib usr
mkdir opt/lib
chmod 755 opt/lib
cp -a /etc/* /tmp/mnt/sda2/etc/
cp -a /bin/* /tmp/mnt/sda2/bin/
cp -a /lib/* /tmp/mnt/sda2/lib/
cp -a /usr/* /tmp/mnt/sda2/usr/
sleep 5
mount -o bind /tmp/mnt/sda2/etc /etc
mount -o bind /tmp/mnt/sda2/bin /bin
mount -o bind /tmp/mnt/sda2/lib /lib
mount -o bind /tmp/mnt/sda2/usr /usr
mount -o bind /tmp/mnt/sda2/opt /jffs
1.1.1 Download, extract the following "functions.zip" file and copy "functions.sh" file to [/tmp/mnt/sda2/lib/] directory:
[Note] If a "Read-only file system" error occours, you'll have either rename the existing "functions.sh" to "functions.sh_" or delete it before copying your downloaded file.
1.1.2 Run the following line-by-line, using PuTTY:
Code:
cd /tmp
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/uclibcxx_0.2.4-2_ar71xx.ipk
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/libc_1.1.14-1_ar71xx.ipk
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base/opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-12_ar71xx.ipk
Connecting to downloads.openwrt.org (78.24.191.177:80)
uclibcxx_0.2.4-2_ar7 100% |*******************************| 70627 0:00:00 ETA
Connecting to downloads.openwrt.org (78.24.191.177:80)
libc_1.1.14-1_ar71xx 100% |*******************************| 268k 0:00:00 ETA
Connecting to downloads.openwrt.org (78.24.191.177:80)
opkg_9c97d5ecd795709 100% |*******************************| 55699 0:00:00 ETA
ipkg_depends: ERROR: Package name uclibcxx_0.2.4-2_ar71xx.ipk contains illegal characters (should be [a-z0-9.+-])
Unpacking uclibcxx_0.2.4-2_ar71xx.ipk...Done.
Configuring uclibcxx_0.2.4-2_ar71xx.ipk...Done.
ipkg_depends: ERROR: Package name libc_1.1.14-1_ar71xx.ipk contains illegal characters (should be [a-z0-9.+-])
Unpacking libc_1.1.14-1_ar71xx.ipk...Done.
Configuring libc_1.1.14-1_ar71xx.ipk...Done.
ERROR: File not found: //usr/local/lib/ipkg/lists/barrier_breaker
You probably want to run `ipkg update'
Unpacking opkg...Done.
Configuring opkg...Done.
Code:
cat > /etc/opkg.conf << EOF
src/gz packages http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/packages
src/gz base http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/base
dest root /opt
dest ram /opt/tmp
lists_dir ext /opt/tmp/var/opkg-lists
EOF
Code:
umount /jffs
mount -o bind /tmp/mnt/sda2/opt /opt
mount -o bind /tmp/mnt/sda2/root /tmp/root
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
opkg update
1.2 Paste the following on DD-WRT Web interface, Administration - Commands. Click "Save Startup".
Code:
#! /bin/sh
sleep 10
if [ -f /mnt/sda1/.optware.enable ]; then
if [ -f /mnt/sda2/.optware.enable ]; then
mount -o bind /tmp/mnt/sda2/bin /bin
mount -o bind /tmp/mnt/sda2/etc /etc
mount -o bind /tmp/mnt/sda2/lib /lib
mount -o bind /tmp/mnt/sda2/opt /opt
mount -o bind /tmp/mnt/sda2/usr /usr
mount -o bind /tmp/mnt/sda2/root /tmp/root
sleep 2
else
exit
fi
else
exit
fi
if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
else
exit
fi
1.3 Reboot the router.
1.4 Using PuTTY, you should see a colorful prompt (in red and blue). Run the following:
2.2 You need to create a new [/opt/etc/config/minidlna.conf] file, with WinSCP, using the following content:
Code:
#port for HTTP (descriptions, SOAP, media transfer) traffic
port=8200
# network interface to bind to (this is the only interface that will serve files)
network_interface=br0
# set this to the directory you want scanned.
# * if have multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to a specific content type, you
# can prepend the type, followed by a comma, to the directory:
# + "A" for audio (eg. media_dir=A,/home/jmaggard/Music)
# + "V" for video (eg. media_dir=V,/home/jmaggard/Videos)
# + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
media_dir=A,/mnt/sda1/dlna/Music
media_dir=V,/mnt/sda1/dlna/Videos
media_dir=P,/mnt/sda1/dlna/Pictures
# set this if you want to customize the name that shows up on your clients
friendly_name=Media Server
# set this if you would like to specify the directory where you want MiniDLNA to store its database and alb
db_dir=/mnt/sda1/dlna
#/mnt/tmp/minidlna
# this should be a list of file names to check for when searching for album art
# note: names should be delimited with a forward slash ("/")
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg
# set this to no to disable inotify monitoring to automatically discover new files
# note: the default is yes
inotify=yes
# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
enable_tivo=no
# set this to strictly adhere to DLNA standards.
# * This will allow server-side downscaling of very large JPEG images,
# which may hurt JPEG serving performance on (at least) Sony DLNA products.
strict_dlna=no
# default presentation url is http address on port 80
presentation_url=http://192.168.1.1:8200/
# notify interval in seconds. default is 895 seconds.
notify_interval=895
# serial and model number the daemon will report to clients
# in its XML description
serial=12345678
model_number=1
2.3 Test it, running the following, using PuTTY:
Code:
minidlna -f /opt/etc/config/minidlna.conf -R
You should see your DLNA client (e.g. Samsung TV) connected to your router in seconds.
2.4 Paste the following on DD-WRT Web interface, Administration - Commands. Click "Save Startup".
Code:
#! /bin/sh
sleep 10
if [ -f /mnt/sda1/.optware.enable ]; then
if [ -f /mnt/sda2/.optware.enable ]; then
mount -o bind /tmp/mnt/sda2/bin /bin
mount -o bind /tmp/mnt/sda2/etc /etc
mount -o bind /tmp/mnt/sda2/lib /lib
mount -o bind /tmp/mnt/sda2/opt /opt
mount -o bind /tmp/mnt/sda2/usr /usr
mount -o bind /tmp/mnt/sda2/root /tmp/root
sleep 2
else
exit
fi
else
exit
fi
if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
if [ -f /tmp/mnt/sda1/.minidlna.enable ]; then
sleep 2
minidlna -f /opt/etc/config/minidlna.conf
else
exit
fi
else
exit
fi
2.5 Reboot the router.
You should see your DLNA client (e.g. Samsung TV) connected to your router in 60 seconds.
3.5 Paste the following on DD-WRT Web interface, Administration - Commands. Click "Save Startup".
Code:
#! /bin/sh
sleep 10
if [ -f /mnt/sda1/.optware.enable ]; then
if [ -f /mnt/sda2/.optware.enable ]; then
mount -o bind /tmp/mnt/sda2/bin /bin
mount -o bind /tmp/mnt/sda2/etc /etc
mount -o bind /tmp/mnt/sda2/lib /lib
mount -o bind /tmp/mnt/sda2/opt /opt
mount -o bind /tmp/mnt/sda2/usr /usr
mount -o bind /tmp/mnt/sda2/root /tmp/root
sleep 2
else
exit
fi
else
exit
fi
if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
export TRANSMISSION_WEB_HOME='/opt/usr/share/transmission/web/'
if [ -f /tmp/mnt/sda1/.minidlna.enable ]; then
sleep 2
minidlna -f /opt/etc/config/minidlna.conf
sleep 4
transmission-daemon -g /mnt/sda2/root/.config/transmission-daemon/
else
exit
fi
else
exit
fi
3.6 You can allow Transmission be accessible over Internet (protected by user/password defined on step 3.3.2).
3.6.1 Paste the following on DD-WRT Web interface, Administration - Commands. Click "Save Firewall".
Code:
iptables -I INPUT -p TCP --dport 9091 -j ACCEPT
3.7 Reboot the router.
-------------------------------------------------------------------------------------------------
4. Troubleshooting: Web Interface misconfigured after DD-WRT Upgrade
-------------------------------------------------------------------------------------------------
Usually, the DD-WRT Web interface gets misconfigured and it becomes unaccessible, when Optware is installed and enabled. Then, you have to follow a procedure in order to fix it.
If your router have Optware and you are planning to upgrade DD-WRT Firmware, you can go through the folloing steps in order to prevent such undesired behavior, easily:
4.1 Please get access to the DD-WRT Web interface. Go to Services, USB;
4.2 Disable "Core USB Support". Hit [Save] and then [Apply Settings];
4.3 Proceed upgrading DD-WRT with the latest firmware, previously downloaded. The router will reboot automatically, as usual;
4.4 Please get access to the DD-WRT Web interface again. Go to Services, USB;
4.5 Enable "Core USB Support" back. Hit [Save] and then [Apply Settings]. Disk info will be displayed in few seconds;
4.6 Login PuTTY and WinSCP;
4.7 Delete /etc on /mnt/sda2/ directory;
4.7.1 It's less effective, but you can also remove /etc with PuTTY, running:
Code:
rm -R /mnt/sda2/etc/*
4.8 Run the following, using PuTTY:
Code:
cd /tmp/mnt/sda2
mkdir etc
chmod 755 etc
cp -a /etc/* /tmp/mnt/sda2/etc/
4.9 Wait to finish the copy and then run:
Code:
reboot
It will load the DD-WRT Web interface right way.
-------------------------------------------------------------------------------------------------
5. Known Issues and improvements
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
6. Backup and Restore - DO NOT SHARE your archive files!
-------------------------------------------------------------------------------------------------
Do not share your archive files. It might contain all your personal configuration, users and passwords, domains, IP and so on. Associate your DD-WRT revision by naming your archive file accordingly. Once all DD-WRT files and directories are on the archive file, you will encounter a webinterface issue, if you extract it on top of other DD-WRT build.
6.1 Backup - Creating an archive name "bkp_optware_ddwrt_r24118.tgz" on "/tmp". It will be available as long as your router is powered up ("/tmp" is RAM). Use WinSCP
to get a copy on your computer.
6.1.1 Run the following, using PuTTY:
Code:
cd /mnt/sda2/
tar -cv -f /tmp/bkp_optware_ddwrt_r24118.tgz .
6.2 Restore - Use WinSCP to copy an archive from your computer to "/tmp".
6.2.1 Run the following, using PuTTY:
Code:
cd /mnt/sda2
tar -xv -f /tmp/bkp_optware_ddwrt_r24118.tgz
6.2.2 If the partition for Media, "/tmp/mnt/sda1", needs to be recreated, please run the following, using PuTTY:
-------------------------------------------------------------------------------------------------
7. Alternative Repositories
-------------------------------------------------------------------------------------------------
Sometimes some repositories became temporally unavailable or script brings us weird errors. We can aways make use of others repositories from OpenWRT. Changes on the above script have to be made by replacing only the Item 1.1.2, as follows:
7.1 Chaos Calmer
Code:
cd /tmp
wget http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/uclibcxx_0.2.4-1_ar71xx.ipk
wget http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/libc_0.9.33.2-1_ar71xx.ipk
wget http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/packages/base/opkg_9c97d5ecd795709c8584e972bfdf3aee3a5b846d-7_ar71xx.ipk
Posted: Tue Oct 15, 2013 13:46 Post subject: Thanks for your feedback.
I feel pleased for your success.
About Printer Driver: once you have build 22118 you should enable it on DD-WRT Web Interface only. No installation is required at all.
About Torrent Client: instructions allow you to manage torrents from an Android device (Remote Transmission, available on Google Play). You should open Port 9091 (NAT/QoS - Port Forwarding) if you want to manage it out of your LAN (3G for instance).
Posted: Tue Oct 15, 2013 16:50 Post subject: Re: Thanks for your feedback.
msantos2007 wrote:
I feel pleased for your success.
About Printer Driver: once you have build 22118 you should enable it on DD-WRT Web Interface only. No installation is required at all.
About Torrent Client: instructions allow you to manage torrents from an Android device (Remote Transmission, available on Google Play). You should open Port 9091 (NAT/QoS - Port Forwarding) if you want to manage it out of your LAN (3G for instance).
Thanks for your feedback!
Marcelo.
Thanks for advice on transmission didn't know about it until u pointed it out.
I'm experiencing a lot of signal drops on 2.4GHZ band which is a pretty common question anyway, but still can you suggest any tweaks to stabilize the signal and improve range?
Posted: Tue Oct 15, 2013 19:16 Post subject: Not happening
I'm sorry to hear that and I'm positive it is not related to Optware. For instance, I'm not experiencing that, so I can't suggest anything other than reset your router (30-30-30) and start over.
I wanna thank you very much for this instructions!
I installed Optware, minidlna and transmission today succesfully on TP-Link WDR4300 and also on TP-Link WR1043ND, so i can confirm that it works!
I use on both my Routers dd-wrt Build 22118
I just wanna point two things out which occurred during my installation, so it may help others...
1. the url for the opkg package changed a lil bit, so intead of opkg_618-3_.... it is now opkg_618-6...
correct version looks like this:
2. when I installed Transmission on the wr1043nd, after reboot it didnt start transmisson deamon automatically. I found out that the sleeping time between minidlna start and transmisson deamon was set a lil to short (2 sec) in the startup command... I think its because of the wr1043nd's hardware (400Mhz, 32MB Ram), so I increased the sleeping to 4 and since then, the deamon starts automatically after reboot!
correct version for startup command:
Code:
#! /bin/sh
sleep 6
if [ -f /mnt/sda1/optware.enable ]; then
if [ -f /mnt/sda2/optware.enable ]; then
mount -o bind /tmp/mnt/sda2/etc /etc
sleep 1
mount -o bind /tmp/mnt/sda2/root /tmp/root
sleep 1
mount -o bind /tmp/mnt/sda2/opt /opt
sleep 2
else
exit
fi
else
exit
fi
if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH='/opt/lib:/opt/usr/lib:/lib:/usr/lib'
export PATH='/opt/bin:/opt/usr/bin:/opt/sbin:/opt/usr/sbin:/bin:/sbin:/usr/sbin:/usr/bin'
export TRANSMISSION_WEB_HOME='/opt/usr/share/transmission/web/'
if [ -f /tmp/mnt/sda1/minidlna.enable ]; then
sleep 2
minidlna -f /opt/etc/config/minidlna.conf -R
sleep 4
transmission-daemon -g /mnt/sda2/root/.config/transmission-daemon/
else
exit
fi
else
exit
fi
Next I'm gonna try to install pyload on my routers...
I wanna thank you very much for this instructions!
I installed Optware, minidlna and transmission today succesfully on TP-Link WDR4300 and also on TP-Link WR1043ND, so i can confirm that it works!
[...]
Next I'm gonna try to install pyload on my routers...
Absolutely! You can always install, setup and run everything on the same partition, but you ought to replace every mount point from "/mnt/sda2" to "/mnt/sda1" in above script.
No, unfortunately it is not possible. AFAICT, those 99MB you are seeing must be RAM (total 128MB). Anything installed on it should be lost on the next reboot.
Remember, you can aways install OPKG and its packages on the same partitition of your USB attached HDD.