My Raspberry Pi Networked Media/NAS Server Setup

I have come to a very good place with my media server setup using my Raspberry Pi. The whole thing is accessible using the network, over a wide range of devices which is ideal for me and the other people living in my house.

If you don’t need to see any of the installation, the following software is running on the server: SambaMinidlna, Deluge & Deluge-Web and NTFS-3G.

The combination of all of this software allows me to access my media and files on pretty much any device I would want to. This is a great combination of software to run on your Pi if you’re not doing anything with it.

So let’s begin with the install!


I’m using the latest build of Raspian, the download and install of that is pretty simple, instructions here.

Unless you can hold your media on the SD card your Pi’s OS is installed on, you’ll need some kind of external storage. In my case, I’m using a 3TB external HDD.

We’ll need to mount this drive, I’ve already written a post on how to do this, check that out here.


Now we should involve Samba. Again, it’s a pretty simple install.

Once it installs you should already see signs of it working. If you’re on windows, make sure network sharing is on, and browse to the “network” folder. It should show up as “RASPBERRYPI” as seen in this image:

The only real tricky part is configuring it. Here is an untouched version of the samba config file. On your pi, it is found at:

You can edit it like you would any config file. This is the configuration following is the configuration I am running on my Pi, if you want a configuration that will work with no problems without any modifications, replace the existing /etc/samba/smb.conf with this version.

There are only a few differences between the standard version and the version I’m using. The biggest one being the actual “Share” being used seen here:

Basically, this shares the external HDD you just mounted to the network. You can insert this share anywhere in your document and it will work. Once you update your config file, you have to add your user to samba. If you haven’t done anything but install raspbian, your username on the pi should still be “pi” so the following should do the following:

Enter your new samba password twice and then you’re good to go after restarting samba.

In windows you can go to “network” option in My Computer and see your share.

If you’re like me though, you’re going to want multiple users for multiple shares. Samba only can only have users that are members of the system, so in order to add a new user to samba, you have to add a user to the Raspberry Pi. For example, let’s add the user ‘testuser’:

I have written a bash script to do this automatically.

On the share level, the line of valid users = should be set to whichever user you want to be able to use the share.

That’s pretty much it for Samba. I’m probably going to do a guide on accessing your shares via SSH tunneling when the need for me to do so arises. I’ll link that here if it ever happens. Now on to minidlna.


MiniDLNA is a very lightweight DLNA server. DLNA is a protocal specifically for streaming media to a huge array of devices from computers to iOS devices or gaming consoles or smart TV’s. I have spent quite a bit of time using minidlna, and have reached a configuration that works extremely well with the raspberry pi. The install is very easy, much like samba, it’s the configuration that is tricky.

The config file i’m using is found here. There Pi actually handles the streaming really really well, and there only a few things you need to change in the config file, and they are mostly aesthetic. The following lines are examples of media locations for each type of file.

And changing this line will change the name of the DLNA server on the network:

That’s pretty much all there is to it.

You can stream the files all over the place, the following images show it being used on my kindle and another computer. I stream files to my xbox 360 all the time.

The last major component of this media server is Deluge, let’s proceed with that install.


Deluge is a torrent client for linux servers. The coolest part is it has a very good web based GUI for control. The install isn’t too straightforward, but there is no real specific configuration. The following commands will get things up and running.

And there you go! You can now torrent files directly into your Samba shares which is hugely useful and more secure, the following is me doing just that:


The last thing that needs to be done is run a few commands at boot, particularly mount the HDD and start deluge-web. The easiest way to do this crontab. First run:

Then add the following two lines:

So it looks like this:

And everything will start working upon boot!


Thank you very much for reading. If you have any questions, please leave a comment.

Raspberry Pi Media Server | Mounting Hard Drive & Better Minidlna Config

Please note that this is more for my sake. To mount a hard drive in raspbian do the following: Make sure you have ntfs-3g installed by running:

Then mount the drive read/write with the following command:

And it shout be mounted. /dev/sda1 is the location of your hard drive. Now to configuring minidlna. Location of minidlna.conf file and access command:

This is the file I’m running right now. As I type this i’m successfully streaming to my Kindle Fire HD (the reason why I’ve decided to really make this thing work) but I’m not sure if it’s stable. It’s also able to stream to VLC as of now.

Raspberry Pi Media Server | Moving Backwards to go Forwards

It’s time to face facts, minidlna and XBMC won’t run at the same time in Raspbmc. The basic UPNP included in Raspbmc won’t work consistently and Raspmc and is not nearly as stable as minidlna. OpenELEC is fast enough, but does not have the expandability of a full linux OS. I need to restart this project.

 

First thing’s first I’m going to straight up speed this thing up as much as I can. At the base level, this begins with the SD card. I’m going to go from a junk 4gb standard speed SD card to a 8gb SanDisk Ultra 30mb/s SDHC. On this I’m going to install the latest version of Raspian and overclock it to the maximum 1GHz.

 

I’ll keep you posted on how I progress.

Raspberry Pi Media Server | Speeding Up Raspberry Pi [Documentation]

So although I haven’t written about it yet, right now I’ve gotten a Raspbmc Server up and running along with Minidlna. It works great for about an hour at a time and then it really bogs down. This seems to be caused by a combination of Raspbmc and the hard drive spinning down. My solution is to try OpenELEC, overclock the Raspberry Pi, and change out the SD card for one with a faster read/write speed.

Encoding A LOT of video in linux | [Documentation]

For my Raspberry Pi Media Server to be able to stream to mobile (a topic I haven’t yet covered here) I need to convert ALL of the video in my family’s 700+ file, 400+ gb, media collection to H.264/MPEG-4 AVC. I recently acquired a hard drive to consolidate and store all of this hard drive on. For the past week or so I’ve been making some progress in converting the video. On my windows tower I’ve been using the program Format Factory to convert the video. I’m running into a few problems with this. For one, my windows computer is my main machine, and multithread converting really bottlenecks it. It also takes a long time – having to watch it while it does it’s thing waiting for it to convert instead of just going to the next set of files is annoying. I could just convert

So I’ve decided to get back into python and write a program that will perfect the conversion process. Like in my PiScanner project, I’ll be using an existing program within python and my code will automate the process.

Goals are as follows:

1. Convert the video

2. Make sets of folders for the video

3. Have it all done on the external HDD

4. Have it be more “efficient” than the setup I’m running now. I.E be able to be on all the time – which shouldn’t be a problem as the server you’re viewing this website on is on all time time and I can just run the script here.

5. Make the end program useable for anyone.

Raspberry Pi Media Server | Streaming To Any Source Using miniDLNA [Documentation]

I’ve made some progress on the RPi Streaming Server.

To replicate this you’ll need to do the following:

1. Install miniDLNA

2. Edit the config file to how you want it. Edit it using vim

3. Here’s what I’m working with, and it works.

You can grab the file itself here. The only thing that’s different is where I put the media directories. The rest of the instructions are still in the .conf, it’s much simpler than mediatomb for example.

Here’s a video of the whole thing working on 3 devices!

Rpi Media Server | Testing video playback from external data source [Documentation]

So first we need to make sure I can output video files from a usb source.

I’ll be using “usbmount” and omxplayer, to get these packages make sure you’re pi’s setup correctly and run the following commands:

Note: make sure no storage devices are plugged into the usb port when you install “usbmount”

Once those are installed you can start trying to play videos off of the usb drive (eventually the thumb drive  will be replaced with a large hdd

I’ll be using filezilla to transfer to and from the pi.

Check out the video below to see omxplayer in action:

Edit: The upload failed and I forgot to check on it. Come back soon for the video.

I’m choosing to debug my Pi over composite. The reason being is because I’m going to be working a lot with video outputs, and I don’t have a second hdmi ready monitor. I’m going to be using the EasyCAP usb video capture card. This will also give me the ability to record what i’m seeing as well. This 100% better / much more efficient than buying a second monitor and filming on it. Of course when this is ready for implementation, it will be plugged into a television with HDMI so the picture will be amazing.

Rpi Media Server | [Declaration]

The goal of this is to become independent from cable TV while still being able to do all of the same things we would with a cable service – I.E still consume content in the living room on the television.

It should also improve upon the experience. I want to be able to stream content from the Pi to any capable device. That list includes but is not limited to:

I’ll be working on this post most of today, so they’ll be a few posts coming.