Thursday 10 October 2013

Minidlna server

This works after a few reboots (not sure why) - All info from:

http://www.raspberrypi.org/phpBB3/viewtopic.php?t=16352

I have seen several tutorials about minidlna server but, there was always something missing, so I want to share with you.

The idea is to use the RasPi as a multimedia server (in my case, for my PS3).

Hardware/Network configuration :
RasPi (I an under raspian, I use 2012-08-16-wheezy-raspbian)
External HD, or USB device, where media files are stored. Plug it to RasPi (USB)
PS3 (or any mediacenter to discover to RasPi media files)
(PC, ) RasPi and PS3 under to same sub-network

As I only have 1 screen for PS3 and RasPi, I did the configuration using ssh

[list=]Assuming IP adress table is :
PC : 192.168.0.11
PS3 : 192.168.0.14
RasPi : 192.168.0.16[/list]

In case of using ssh, Connect :

CODE: SELECT ALL
ssh pi@192.168.0.16


Enter password (default "raspberry"), then tty command line appears
CODE: SELECT ALL
pi@raspberrypi~:


I recommend updating everything before intallation :
Update package list:
CODE: SELECT ALL
sudo apt-get update

Update packages:
CODE: SELECT ALL
sudo apt-get upgrade


Mount hard drive automatically :
Use this command to discover UUID :
CODE: SELECT ALL
sudo blkid

You see your drive suck as :
CODE: SELECT ALL
/dev/sda1: LABEL="ExternalHD" UUID="49A1-143B" TYPE="vfat"


Make a directory where to mount the disk and change the autorizations:
CODE: SELECT ALL
sudo mkdir -p /media/HardDrive
sudo chmod 755 /media/HardDrive


Edit the fstab file :
CODE: SELECT ALL
sudo nano /etc/fstab


Add this line (using your UUID and TYPE) :
CODE: SELECT ALL
UUID=49A1-143B  /media/HardDrive   vfat    defaults      0     0


Install minidlna :
CODE: SELECT ALL
sudo apt-get install minidlna

It will warn you about how many disk space it will use and dependencies installation

Now you can configure minidlna:
CODE: SELECT ALL
sudo nano /etc/minidlna.conf


You see many options like :
CODE: SELECT ALL
# Change the Media Dir's to point to the external hard drive, obviously change these to match your directory layout
media_dir=A,/media/HardDrive/Media/Music
media_dir=V,/media/HardDrive/Media/Video
media_dir=P,/media/HardDrive/Media/Photos

# Change db_dir so that the database is saved across reboots
db_dir=/home/pi/.minidlna

# Uncomment log_dir for now in case we hit problems
log_dir=/var/log


You can choose to start minidlna at boot :
CODE: SELECT ALL
sudo update-rc.d minidlna defaults

Or just start it once now :
CODE: SELECT ALL
sudo service minidlna start


MiniDLNA will now begin indexing all of your media files, it's quite quick but folders not COMPLETELY indexed will not appear until they are done.

If you modify minidlna configuration, you have to reload it :
CODE: SELECT ALL
sudo service minidlna force-reload

No comments:

Post a Comment