Setting Up A MiniDLNA Server On A TonidoPlug

MiniDLNA is an alternative to the Tonido’s built-in media server. It is open source and fully DLNA compliant. It is not available in the Debian Squeeze repositories and must be built from the source.

This guide adapted from the postings of pmcallihan in the Tonido Tips & Tricks Forum: http://www.tonido.com/forum/viewtopic.php?f=37&t=4193

Do not do this on a Tonido Plug booting from the internal flash. It will void your warranty.
Boot from a USB or SATA drive before you attempt this or any other other modification.

Installation and Setup

1. SSH into the plug.

2. Setup a build environment on the plug.

3. Install the MiniDLNA prerequisites.

 apt-get update
 apt-get upgrade
 apt-get install libexif-dev libjpeg8-dev libid3tag0-dev libflac-dev libvorbis-dev libsqlite3-dev libavcodec-dev libavformat-dev

4. Create a working directory.

 cd /
 mkdir /src
 cd /src

5. Get the source code.

 wget http://sourceforge.net/projects/minidlna/files/minidlna/1.0.22/minidlna_1.0.22_src.tar.gz
 tar xvfz  minidlna_1.0.22_src.tar.gz

6. Build and install MiniDLNA.

 cd minidlna-1.0.22
 make
 make install

7. Create directories to store your media if you do not already have them.

 Simple Example:
 cd /
 mkdir /home/media
 chmod –R 775 /home/media
 
 Detailed Example:
 cd /
 mkdir /home/media
 mkdir /home/media/music
 mkdir /home/media/video
 mkdir /home/media/photos
 chmod –R 775 /home/media

8. Open the config file in nano.

 nano /etc/minidlna.conf

9. Change the following settings:

 Uncomment friendly_name (remove the # sign) and add your own name.
 friendly_name=Plug2 DLNA Server
 
 Uncomment media_dir.
 Set the paths to your media. Ex: /home/media
 Set it to whatever works for you.
 
 Simple: (one big folder for everything)
 media_dir= /home/media
 
 Detailed:
 media_dir=A,/home/media/music
 media_dir=V,/home/media/videos
 media_dir=P,/home/media/pictures
 
 If you connecting to your plug using the wireless network interface:
 - uncomment network_interface
 - change the settings to include the wireless adapter.
 
 network_interface=eth0,mlan0

10. Save and close.

 CTRL-o
 ENTER
 CTRL-x

11. Copy the startup file to the startup directory and rename.

  cp /src/minidlna-1.0.22/linux/minidlna.init.d.script /etc/init.d/minidlna
  chmod 755 /etc/init.d/minidlna

12. Start the MiniDLNA server.

  /etc/init.d/minidlna start

13. Test the install by looking for the process.

  ps aux | grep minidlna
  
  It should show something like:
  root 2960 0.0 0.3 40484 2016 ? Ssl 17:22 0:00 /usr/sbin/minidlna -f /etc/minidlna.conf

14. Set MiniDLNA to start on boot.

  update-rc.d minidlna defaults