Sunday, June 2, 2013

Building a Media Center to work with Raspbmc hooked to TV.

Now that I have a proper media center using UPnP to play videos from a laptop computer, I want to free up that laptop again and create a much more robust solution that uses much less power and is dedicated to just sharing files on my network.

My hardware I choose to use is a now ancient Mini-ITX board by Via, called the EPIA-M.  I had bought this board 8 or 9 years ago, added a 12v powered DC-DC power block, and then threw it in a box and ignored it for all these years.  It only draws 10 watts, and has no fan or moving parts to wear out.   It has 256MB or RAM, but I am going to expand this out to 1GB.

I ran into one hold up, the built in networking had been turned off which made me pass on FreeNAS without giving it a shot at first, but when I began to install Debian, it also could not see the built in networking on the motherboard, so I knew it was a problem and was able to reboot again, change the setting and try out FreeNAS.


I gave this a shot.  I had known of the system for many years and was interested in checking it out.

  • Very powerful.
  • Can do just about anything and is extendable using plugins.
  • Looks like once it is set up it would work for even large divisions.
  • Beautiful web interface gives you access to everything.
  • Very complicated and has a steep learning curve
  • Even something as simple as installing plugins is not pre-setup for the user.
  • Takes a higher end system with a lot of RAM

If FreeNAS wants me as a user they need to make a version that is meant to be used on low end devices with just a little RAM.  I am a home user that just wants to serve files that are on external usb hard drives, things should just work and transmission and dnla should be built-in.

When I plug in a drive things should "just work".  The drive should be shared to the network as a windows file share and the media file tree it contains should be indexed and shared using UPnP.  Plus, the system kept crashing because evidently I need a base 6GB of RAM, plus 1 GB of RAM for each TB I wanted to serve.   I couldn't install the plug-in jail system properly and after I messed it up I couldn't modify the settings anymore.


Failed to load, needed a newer motherboard than I had.


That's right, I fell back to Debian 7.0 and I got it all working in just a few hours.  Even though in some ways this is harder than just learning FreeNAS, because I already am comfortable using Debian and UNIX in general on the command line this was easy for me to get everything installed and working. 

I had to do a base install, then modify the apt-repository list to stop looking at the usb drive for packages, and added in the main Debian repository, then apt-get a bunch of packages to give me samba, minidlna, and other services I wanted to run on the box.  I just googled for help with each part in turn.  These are all just normal Debian things, and you can find a lot of info on every step.

One thing that I had always wondered how to do was to mount disks by label.

And how to assign the label to a DOS disk in Debian?  Mtools!

Work left to do?  Add all the USB drives so they auto mount to the right place.  Configure Samba to share all the directories read/write.

I went with mounting the drives by UUID, here is the relevant section I added to the end of /etc/fstab:

UUID=58212b6a-dc48-45e7-8e9f-1f360d765985 /media/SciFi  auto rw,user,auto 0 2
UUID=beb927ca-4da4-4fc9-b222-be343c4fec38 /media/Text   auto rw,user,auto 0 2
UUID=c7980548-7182-404b-b32d-02c5accd8963 /media/3D     auto rw,user,auto 0 0
UUID=f25eaad0-5896-499c-b476-f57ed12bd49c /media/Comedy auto rw,user,auto 0 2
At boot up this mounts 4 usb drives that are configured with either ext3 or ext4 to the same place each time.

I shared my media directory, where all the drives are mounted with the following section in /etc/samba/smb.conf :

[media] ; user="root"
   force user = root
   comment = Media Directory
   read only = no
   locking = no
   path = /media
   guest ok = yes
   public = yes
This gives full read/write access to all the drives I mounted under the media directory.  I know, I know, "oh you gave root access to these directories" but I am the only one that has access to these folders on my local network and the machine never executes anything from these folders, so no problem.

UPnP Remote Control

I found an application called BubbleUPnP that runs on my android Pad over Wifi and sits between what they call a library and a renderer.    You can even play things locally.  But the amazing thing happens when I selected the new NAS I just built as the librar and Raspbmc as the renderer, and a second later my TV was playing what I had told it to play on my pad computer. As the media plays you have full control of the player, able to pause, fast forward, change the volume and you can read the title and see where you are in the media timewise. All in all a truly amazing thing.  I did have to check a single box on the XBMC settings to advertise my Raspi as a rendering device. So now I can almost get by without having a direct link to XBMC at all.

I noticed another app that can do everything my wireless keyboard/mouse can do, which is also interesting, will have to give that a try.

3D Printed Case

Right now I am trying to find a case I can print that will fit the mini-ITX motherboard with a nice big 120mm fan for cooling of the mother board and the usb drives I plan to place on top of the case.  If I can't find one I will work on designing one that will work for me.  The board is about 17×17 cm (or 6.7×6.7 inches) wide and deep and about 3 inches tall.   Unfortunately the build place on my Replicator 2 is just 6.3 inches deep, so I am short .4 inches.  Will have to figure out how to make something work.

Physical Setup

Current setup on bookshelf until I can get it in a case.

I had to buy an extension cord and a set of orange extenders to allow me to plug in the 6 power bricks.  This is all plugged into a backup power supply.   Then I wired up the power and the usb connections to a 7 port powered hub that I was using on the laptop machine.    The beauty of this is that I can easily shut this system down and test a Raspi model A computer I am working on to act as a NAS and file sharer as well.  I am not sure how good the power supply is going to be for the mini-itx board.

No comments:

Post a Comment