Thursday, February 16, 2017

Creating a Raspberry Pi Media Center

I was first introduced to the wonders of media centers with the previously-mentioned PirateBox. Being able to power up a little router, then stream music from it on my phone while cooking was rather convenient. This led to the idea that maybe a centralized media center on a Raspberry Pi would be a great idea. Ideally, I would be able to navigate to an IP address on the home network and stream music on any computer, without having to install an app.

The actual first thing I tried was installing MusicBox, but that only works on a Raspberry Pi 2 and I'd just bought two Pi 3s. Maybe if the next solutions don't work, I'll revert.

The next thing I've tried is installing OSMC on a Raspberry Pi, following this guide. I created a script with the following lines which seem to need to be run each time for the VNC Server to start.

cd /home/osmc/dispmanx_vnc-master/
sudo modprobe uinput
sudo  chmod 666 /dev/uinput
./dispman_vncserver

Had to use the following to make sure input was accepted from the keyboard and mouse (which is attached using a 4 port KVM Switch):

https://github.com/patrikolausson/dispmanx_vnc#if-the-keyboard-or-mouse-does-not-work

 But this wasn't quite what I wanted. I need a device very much like the Piratebox, that contains the files, that could then be played, preferably via a web interface or an application, on a client device such as a phone or laptop. The Raspberry Pi should not be playing any music or video itself, and there's no need to control any interface on the RPi itself via any external remotes or VNC installs.

I remembered the Piratebox used DLNA or UPnP and found this guide:

https://www.s-config.com/minidlna-server-raspberry-pi/

Followed the guide, but apparently DLNA requires a certain directory structure, which none of my phone apps could discover properly.

So I'm moving on to this guide:

https://www.element14.com/community/community/raspberry-pi/raspberrypi_projects/blog/2016/03/11/a-more-powerful-plex-media-server-using-raspberry-pi-3

This is to set up Plex media server on the Raspberry Pi 3.

At last it worked. Lots of features, and all accessible over a powerful web interface. Too bad you need to register to get HTTPS.

This link was also useful to properly mount the USB drive.

No comments: