Headless MythTV backend on RaspberryPi2 and Banana Pro
#1
As a linux newby I spent a long time figuring out how to do this and I could only find information in snippets. This is a chance to give back a little for a change. Note that I make choices which are appropriate for me but may not be for others. I wont bother with any explanations of my hardware/software choices. I also wont bother talking about video sources/tuners because they are different wherever in the world you are.

I used Raspbian on the rpi2 and Bananian for the bpi. Note that both these OSs are debian wheezy derivatives. Also I never connect a monitor or input device to my banana/raspberry. All communication is over ssh. Prepend sudo to most commands.

Mythtv is not supplied in the standard debian distro. We can get the current version from deb-multimedia. If we add wheezy then we get the most recent version of 0.26. The current version of 0.27.5 is available in wheezy-backports.
Add the following lines to /etc/apt/sources.list (or use your closest mirror)
Code:
deb http://deb-multimedia.org wheezy main non-free
deb http://deb-multimedia.org wheezy-backports main

Get and install the keyring and update:
Code:
wget http://deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2015.6.1_all.deb
dpkg -i deb-multimedia-keyring_2015.6.1_all.deb
apt-get update

Now we are ready to install myth backend:
Code:
apt-get install mythtv-backend

On Raspbian you are prompted for a mysql root password (it's a good idea to set this) and then mythtv-database asks for the same password to allow it to create a starter database called mythconverg that mythtv needs to operate.

On Bananian this didn't happen. Mysql doesn't necessarily need to run on the same machine as myth backend. I had to install it explicitly:
Code:
apt-get install mysql-server
Give a root password when prompted. Then:
Code:
apt-get install mythtv-database
Give the same password when prompted.

When we finally get myth backend running, it will run as user mythtv. While it is possible to run myth setup from another account (eg pi or root), it is better to run it from mythtv for a couple of reasons:
- Downloaded channel icons are accessed from the home area of the mythtv user
- When exiting the setup program, checks are made to see if specified storage directories are writable by the user running setup. For this to mean anything it should be run from the mythtv user.
Therefore give the mythtv user a home area and password:
Code:
usermod -m -d /home/mythtv mythtv
passwd mythtv

Having a stand alone backend means mysql needs to be able to be accessed by the front end remotely. Therefore edit /etc/mysql/my.cnf and comment out this line:
Code:
bind-address = 127.0.0.1

I allow the mythconverg database to be accessible by any machine on my subnet. First log into the mysql server and then grant privileges to the mysql mythtv user:
Code:
$ mysql -u root -p mythconverg
mysql> grant all on mythconverg.* to mythtv@'192.168.1.%' identified by 'mythtv';
mysql> flush privileges;

Finally you want to prepare an area for livetv/recording storage. The mythtv user should have ownership. Something like this:
Code:
mkdir /mnt/mythtv/storage
chown mythtv:mythtv /mnt/mythtv/storage

Mythtv setup is a graphical program but it can be run over X Windows. You need to have an X server running on the machine you are running your ssh client on. I do this on a mac. Apple stopped shipping X11 with osx a couple of versions ago so it needs to be installed separately from http://xquartz.macosforge.org. If you are using linux then you probably already have an x server. On Windows I think there are a few choices - try looking at http://x.cygwin.com.
Start the myth setup program something like this:
Code:
ssh -X [email protected] mythtv-setup

With any luck the setup gui launches asking for your location and language. This worked first time for me on Raspbian. On Bananian I got an error that was resolved by installing xauth and then running setup again:
Code:
apt-get install xauth

That's it - you're on your own now. Don't forget to start the backend after setting up:
Code:
service mythtv-backend start

I note that the next bananian release next month will be based upon debian jessie so this procedure may be slightly different.
Reply
#2
Do you need to modify a config file to get MySQL to use the hard disk on a Banana Pro instead of the microSD card?
Reply
#3
When you initially install/setup a MySQL installation you can determine where it stores its files. Often this is set to /var/db/mysql or something similar. The location of this is usually defined in /etc/my.cnf, and you can just point that to whatever mount point you have created for your USB, network or other storage.
Reply

Logout Mark Read Team Forum Stats Members Help
Headless MythTV backend on RaspberryPi2 and Banana Pro0