What's new

[TUTORIAL] Minidlna Media Server through debian-optware-arm

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

How this works for you?


  • Total voters
    10

TeHashX

Very Senior Member
New site with updated guide



v1.1.4 here

ENTWARE version here http://forums.smallnetbuilder.com/showthread.php?t=14573
OPTWARE MIPSEL version http://forums.smallnetbuilder.com/showthread.php?p=110071#post110071

I setup chrooted debian from here, thanks @ryzhov_al and @RMerlin for all the work.
It's only for arm devices, like RT-AC56U and RT-AC68U/R
Advantages: easy to update without waiting for asus, easy to apply patches, very stable with zero crashes at least for me on RT-AC66U, I enabled movie thumbnails with filmstrip (will take a little bit longer to scan db), this version will not rebuild entire database after every router reboot.

Let's start

1 - Turn off Media server from router ui, insert an usb drive in to the router, should be formatted as ext2, ext3 or ext4, if your drive has a label, you have to replace sda1 with your label in all instances in this guide

2 - Install Asus Download Master to activate optware environment, uninstall or disable after if you don't using it, if you need a better download manager use transmission instead

3 - Enable jffs partition (skip to point 5 if was previously enabled)

4 - Reboot router

5 - Open terminal and input the next commands:
Code:
ipkg update
ipkg upgrade
ipkg install nano wget-ssl findutils
Code:
cd /mnt/[COLOR="Red"][B]sda1[/B][/COLOR]/
6 - Download prepared debian with all necesary libs and decompress
Code:
/opt/bin/wget -c -O debian-minidlna-1.1.3-arm.tgz http://goo.gl/6j1oTZ --no-check-certificate
tar -xvzf ./debian-minidlna-1.1.3-arm.tgz
7 - Download start-stop script, in this script is a path EXT_DIR to your media folder witch will be mounted in debian as /mnt, mine is /mnt/sda1/Media and if your disk has a label change sda1 from CHROOT_DIR with your disk label, modify the script to match your settings with vi or nano editor, use this command nano /opt/etc/init.d/S99debian
Code:
/opt/bin/wget -c -O /opt/etc/init.d/S99debian http://goo.gl/tBc4Hz --no-check-certificate
chmod a+rx /opt/etc/init.d/S99debian
8 - Download services-list that will run in chrooted debian, for now is only minidlna but if you want to install another packages in debian like transmission-daemon, you need to add transmission start-stop script name, ex. S50transmission
Code:
/opt/bin/wget -c -O /opt/etc/chroot-services.list http://goo.gl/ACNBEj --no-check-certificate
chmod a+rx /opt/etc/chroot-services.list
9 - Now create this two scripts to start-stop debian together with all other services
Code:
echo "#!/bin/sh" > /jffs/scripts/services-start
echo ""  >> /jffs/scripts/services-start
echo "sleep 10"  >> /jffs/scripts/services-start
echo "/opt/etc/init.d/S99debian start" >> /jffs/scripts/services-start
chmod a+rx /jffs/scripts/services-start
Code:
echo "#!/bin/sh" > /jffs/scripts/services-stop
echo ""  >> /jffs/scripts/services-stop
echo "/opt/etc/init.d/S99debian stop" >> /jffs/scripts/services-stop
chmod a+rx /jffs/scripts/services-stop
10 - Reboot router
Code:
reboot
11 - Go to 192.168.1.1:8200 (this is the default router ip, modify to your router ip if you change it previously) and see how minidlna is creating db, press refresh on your browser for progress.
If all numbers are 0 (zero) after some time, you forget to set the right path to your media folder, read again point 7 carefully

6f8nlh.png


If you want to enter chrooted debian to install other packages or to modify some options, use this commands:
Code:
mount -o bind /dev/ /mnt/[COLOR="Red"]sda1[/COLOR]/debian/dev/
mount -o bind /proc/ /mnt/[COLOR="red"]sda1[/COLOR]/debian/proc/
mount -o bind /sys/ /mnt/[COLOR="red"]sda1[/COLOR]/debian/sys/
chroot /mnt/[COLOR="red"]sda1[/COLOR]/debian /bin/bash
To exit, just type
Code:
exit
 
Last edited:
Example of thumbnails on my tv

wvwyg5.jpg


If you just want to update from v1.1.2 follow this instructions http://forums.smallnetbuilder.com/showpost.php?p=124287&postcount=41

1.1.3 - Released 05-June-2014
--------------------------------
- Enhance log level settings.
- Fix Samsung browsing when root_container is set.
- Add Clang compiling support.
- Fix compiling on systems without iconv.
- Add merge_media_dirs option, to revert to the old behavior.
- Add Asus O!Play client support.
- Fix Broken SSDP multicast membership addition.
- Fix crash bug with an emtpy filter argument.
- Accept SMI subtitles in addition to SRT.
- Add BubbleUPnP detection and enable subtitle support.
- Allow the user to specify an arbitrary root container.
- Add libavcodec > 54 / libav 10 compatibility.
- Get embedded cover art from video files with recent libavformat versions.
- Disable Samsung DCM10 capability, as it breaks compatibility with new models.
- Add subtitle support for NetFront™ Living Connect middleware-based clients.

1.1.2 - Released 06-Mar-2014
--------------------------------
- Show client status on our basic presentation page.
- Add a new force_sort_criteria option, to globally override the SortCriteria value sent by the client.
- Fix a couple resource leaks.
- Add configuration include file support.
- Support DLNA/UPnP-AV searches issued by clients using the Grilo framework.
- Fix some clients playing artwork instead of movie.
- Fix bookmarks on Samsung Series E clients.
- Add an extra folder level if there are multiple media locations.
- Fix some multicast membership issues with changing network settings.
- Make max number of children (connections) configurable.
- Fix choppy playback with some file types on Panasonic clients by increasing the max connection limit.
 
Last edited:
I have debian with owncloud installed already,How do I just install minidlna only to get it work? Thanks for advise.
 
I have debian with owncloud installed already,How do I just install minidlna only to get it work? Thanks for advise.
If you are coming from another debian package like Xerxist's build http://forums.smallnetbuilder.com/showthread.php?t=15528&highlight=debian

Follow all steps without point 6, then

Enter debian
Code:
/mnt/[COLOR="Red"]sda1[/COLOR]/debian/utils/chroot /mnt/[COLOR="red"]sda1[/COLOR]/debian /bin/bash

Install minidlna package

Code:
cd /var/tmp
wget -c -O /var/tmp/minidlna_1.1.2-1_armel.deb http://goo.gl/A4vq6k
dpkg -i minidlna_1.1.2-1_armel.deb

wget -c -O /etc/init.d/S98minidlna http://goo.gl/3lfExE
chmod a+rx /etc/init.d/S98minidlna

wget -c -O /etc/minidlna.conf http://goo.gl/Fz1woY
chmod a+rx /etc/minidlna.conf

You may need some of folowing packages:

Code:
apt-get install autopoint libavutil-dev libavcodec-dev libavformat-dev libjpeg-dev libsqlite3-dev libexif-dev libid3tag-dev libid3tag0-dev libogg- dev libvorbis-dev libFLAC-dev libffmpegthumbnailer-dev ffmpegthumbnailer

To test if minidlna starts fine use this command
Code:
minidlnad -f /etc/minidlna.conf -d
If you don't get any error, just stop process with CTRL-C

Exit debian
Code:
exit
Code:
reboot
 
Last edited:
point7:wget -c -O /opt/etc/init.d/S99debian http://goo.gl/fgKNaC

Connecting to goo.gl (173.194.38.41:80)
Connecting to dl.dropboxusercontent.com (54.243.74.238:80)
wget: server returned error: HTTP/1.1 502 Bad Gateway
:confused:
 
I think I was doing something wrong,
Because I follow these step, I can not get minidlna working:confused:,
Code:

ASUSWRT-Merlin RT-AC68U_3.0.0.4 Fri Jan 31 05:21:52 UTC 2014
wei@RT-AC68U:/tmp/home/root# /mnt/sda1/debian/utils/chroot /mnt/sda1/debian /bin
/bash
root@RT-AC68U:/# minidlnad -f /etc/minidlna.conf -d
bash: minidlnad: command not found
root@RT-AC68U:/#

PS:eek:wncloud working fine.

If you are coming from another debian package like Xerxist's build http://forums.smallnetbuilder.com/showthread.php?t=15528&highlight=debian

Follow all steps without point 6, then

Enter debian
Code:
/mnt/[COLOR="Red"]sda1[/COLOR]/debian/utils/chroot /mnt/[COLOR="red"]sda1[/COLOR]/debian /bin/bash

Install minidlna package

Code:
cd /var/tmp
wget -c -O /var/tmp/minidlna_1.1.2-1_armel.deb http://goo.gl/A4vq6k
dpkg -i minidlna_1.1.2-1_armel.deb

wget -c -O /etc/init.d/S98minidlna http://goo.gl/3lfExE
chmod a+rx /etc/init.d/S98minidlna

wget -c -O /etc/minidlna.conf http://goo.gl/Fz1woY
chmod a+rx /etc/minidlna.conf

You may need some of folowing packages:

Code:
apt-get install autopoint libavutil-dev libavcodec-dev libavformat-dev libjpeg-dev libsqlite3-dev libexif-dev libid3tag-dev libid3tag0-dev libogg- dev libvorbis-dev libFLAC-dev libffmpegthumbnailer-dev ffmpegthumbnailer

To test if minidlna starts fine use this command
Code:
minidlnad -f /etc/minidlna.conf -d
If you don't get any error, just stop process with CTRL-C

Exit debian
Code:
exit
Code:
reboot
 
I think I was doing something wrong,
Because I follow these step, I can not get minidlna working:confused:,
Code:

ASUSWRT-Merlin RT-AC68U_3.0.0.4 Fri Jan 31 05:21:52 UTC 2014
wei@RT-AC68U:/tmp/home/root# /mnt/sda1/debian/utils/chroot /mnt/sda1/debian /bin
/bash
root@RT-AC68U:/# minidlnad -f /etc/minidlna.conf -d
bash: minidlnad: command not found
root@RT-AC68U:/#

PS:eek:wncloud working fine.

Minidlna is not installed.

Code:
cd /var/tmp
wget -c -O /var/tmp/minidlna_1.1.2-1_armel.deb http://goo.gl/A4vq6k
dpkg -i minidlna_1.1.2-1_armel.deb
Any error after this?
 
Thanks for your reply, install minidlna seems no error:

ASUSWRT-Merlin RT-AC68U_3.0.0.4 Fri Jan 31 05:21:52 UTC 2014
wei@RT-AC68U:/tmp/home/root# /mnt/sda1/debian/utils/chroot /mnt/sda1/debian /bin/bash
root@RT-AC68U:/# cd /var/tmp
root@RT-AC68U:/var/tmp# wget -c -O /var/tmp/minidlna_1.1.2-1_armel.deb http://goo.gl/A4vq6k
--2014-03-19 12:16:11-- http://goo.gl/A4vq6k
Resolving goo.gl (goo.gl)... 173.194.126.200, 173.194.126.198, 173.194.126.194, ...
Connecting to goo.gl (goo.gl)|173.194.126.200|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://dl.dropboxusercontent.com/u/47669650/AsusWrtArm/debian/minidlna_1.1.2-1_armel.deb [following]
--2014-03-19 12:16:11-- http://dl.dropboxusercontent.com/u/47669650/AsusWrtArm/debian/minidlna_1.1.2-1_armel.deb
Resolving dl.dropboxusercontent.com (dl.dropboxusercontent.com)... 107.20.251.107, 54.243.174.170, 23.21.61.161, ...
Connecting to dl.dropboxusercontent.com (dl.dropboxusercontent.com)|107.20.251.107|:80... connected.
HTTP request sent, awaiting response... 206 PARTIAL CONTENT
Length: 161646 (158K), 0 remaining [application/x-debian-package]
Saving to: `/var/tmp/minidlna_1.1.2-1_armel.deb'

100%[+++++++++++++++++++++++++++++++++++++++] 161,646 --.-K/s in 0s

2014-03-19 12:16:12 (0.00 B/s) - `/var/tmp/minidlna_1.1.2-1_armel.deb' saved [161646/161646]

root@RT-AC68U:/var/tmp# dpkg -i minidlna_1.1.2-1_armel.deb
(Reading database ... 17311 files and directories currently installed.)
Preparing to replace minidlna 1.1.2-1 (using minidlna_1.1.2-1_armel.deb) ...
Unpacking replacement minidlna ...
Setting up minidlna (1.1.2-1) ...
root@RT-AC68U:/var/tmp# minidlnad -f /etc/minidlna.conf -d
bash: minidlnad: command not found
root@RT-AC68U:/var/tmp#
Minidlna is not installed.

Code:
cd /var/tmp
wget -c -O /var/tmp/minidlna_1.1.2-1_armel.deb http://goo.gl/A4vq6k
dpkg -i minidlna_1.1.2-1_armel.deb
Any error after this?
 
Many thanks for your guide.
OK,minidlna started,go to my router ip 192.168.1.1:8200,minidlna count media file 0,I think that because s99debian not start?(I edited media folder path)
Next,How to get it work?
Try to start with
/etc/init.d/S98minidlna start
 
Many thanks for your guide.
OK,minidlna started,go to my router ip 192.168.1.1:8200,minidlna count media file 0,I think that because s99debian not start?(I edited media folder path)
Next,How to get it work?

/etc/init.d/S98minidlna stop
rm -r /opt/minidlna
Exit Debian
/opt/etc/init.d/S99debian start
 
Not work.
Code:

ASUSWRT-Merlin RT-AC68U_3.0.0.4 Fri Jan 31 05:21:52 UTC 2014
wei@RT-AC68U:/tmp/home/root#/mnt/sda1/debian/utils/chroot/mnt/sda1/debian /bin/bash
root@RT-AC68U:/# /etc/init.d/S98minidlna stop
[ ok ] Stopping minidlna:.
root@RT-AC68U:/# rm -r /opt/minidlna
root@RT-AC68U:/# exit
exit
wei@RT-AC68U:/tmp/home/root# /opt/etc/init.d/S99debian start
Chroot'ed services seems to be already started, exiting...
wei@RT-AC68U:/tmp/home/root#

/etc/init.d/S98minidlna stop
rm -r /opt/minidlna
Exit Debian
/opt/etc/init.d/S99debian start
 
It's ok
/opt/etc/init.d/S99debian stop
Wait 5 seconds
/opt/etc/init.d/S99debian start

If still get error, reboot router and should start automatically. :)
 
Thank you for quick reply.
I am sorry still can not get it work.
I will try using your file of debian with minidlna to set up owncloud.
Anyway thank you so much.

CODE:
ASUSWRT-Merlin RT-AC68U_3.0.0.4 Fri Jan 31 05:21:52 UTC 2014
wei@RT-AC68U:/tmp/home/root# /opt/etc/init.d/S99debian start
Chroot'ed services seems to be already started, exiting...
wei@RT-AC68U:/tmp/home/root# /opt/etc/init.d/S99debian stop
Stopping chroot'ed Debian services...
[FAIL] Stopping minidlna: failed!
/opt/etc/init.d/S99debian: line 70: xargs: not found
Done.
wei@RT-AC68U:/tmp/home/root#

It's ok
/opt/etc/init.d/S99debian stop
Wait 5 seconds
/opt/etc/init.d/S99debian start

If still get error, reboot router and should start automatically. :)
 
Wait, you don't have xargs installed from point 5
Outside debian install findutils
Code:
ipkg install nano http://goo.gl/5Ltmig
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top