Linux Crumbs
Custom Search

Configuring MythTV Backend for Remote Frontends

Summary

This tutorial outlines the steps to configure a stand alone MythTV combined Backend and Frontend to support remote frontends. Remote frontends enable viewing PVR recordings on additional televisions.

Contents

Background

In the Installing Mythbuntu 14.04.1 with MythTV 0.27 tutorial we set up a stand alone MythTV combined Backend and Frontend. Before a MythTV Backend can support remote frontends, it must be configured to enable frontend access. Two commonly used frontends are the MythTV Frontend, and Kodi (previously XBMC) with a MythTV PVR add-on. After completion of this tutorial you will be able to connect either frontend to the MythTV Backend server to watch PVR recordings.

A. Set MythTV Backend Server Static IP Address

See How To and Why Set Up a Static IP Address on GNU/Linux.

On my combined MythTV Backend and Frontend I set the static IP address to 192.168.1.55.

NOTE:   Substitute your static IP address throughout tutorial

In this tutorial I used the following IP address:

192.168.1.55

If you chose a different IP address then be sure to substitute yours in the following tutorial steps.

B. Set MythTV Backend Server BIOS/UEFI to Wake-On-LAN

In order for Wake-On-Lan to work, the motherboard BIOS/UEFI must support this feature and must also be configured to use Wake-On-Lan.

To access the BIOS/UEFI usually involves pressing a key while the computer boots up. In my case I used the Delete key.

On my ASUS P8H61-M motherboard I enabled "Power on PCIE" under the Advanced APM BIOS settings. An Internet search should help reveal how to enable Wake-On-Lan on your specific motherboard.

ASUS P8H61-M enable Power on PCIE for Wake-On-Lan

To use WOL we need to know the Ethernet / Hardware / MAC address of the MythTV Backend server. You can use the ifconfig command on the backend server to get this information.

$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0b:0e:0f:00:ed
          inet addr:192.168.1.55  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20b:eff:fe0f:ed/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:253 errors:0 dropped:0 overruns:0 frame:0
          TX packets:276 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:48558 (48.5 KB)  TX bytes:32464 (32.4 KB)

Make note of the HWaddr number.

On my PVR the number is 00:0b:0e:0f:00:ed. Be sure to use your MythTV Backend server hardware address instead of my value.

TIP:   Testing Wake-On-Lan

On a different computer install wakeonlan command. On Debian/Ubuntu use:

sudo apt-get install wakeonlan

With your MythTV Backend powered down, try to power it up over the network using:

wakeonlan 00:0b:0e:0f:00:ed

Be sure to use the Hardware Address for your MythTV Backend.

C. Acquire MySQL Database Login Information

  1. Start existing MythTV Frontend (Applications -> Multimedia -> MythTV Frontend).

  2. Navigate to Setup -> General.

  3. Make note of the following values.

    Database name:     # should be mythconverg
    Username:          # should be mythtv
    Password:

    MythTV Frontend Setup General Screen

  4. Exit out of MythTV Frontend.

D. Enable MySQL Database Service on Network

  1. Edit /etc/mysql/my.cnf file.

    sudo leafpad /etc/mysql/my.cnf
  2. Under [mysqld] section, comment out bind-address line.

    Change

    bind-address           = 127.0.0.1

    To

    #bind-address           = 127.0.0.1
  3. Save file and exit editor.

  4. Restart MySQL service.

    sudo service mysql restart

E. Enable MySQL Network Service Daemon

  1. Start Applications -> System -> Mythbuntu Control Center.

  2. Select MySQL.

  3. Under Master Backend Role enable the MySQL service on Ethernet interfaces.

    Enable     MySQL service on ethernet interfaces (required for remote Frontend or Backend)
  4. Close Mythbuntu Control Center.

F. Enable MythTV Backend Database Service

  1. Edit /etc/mysql/conf.d/mythtv.cnf file.

    sudo leafpad /etc/mysql/conf.d/mythtv.cnf
  2. Under [mysqld] section make the following edit.

    Change

    bind-address=0.0.0.0

    To

    bind-address=192.168.1.55
  3. Save file and exit editor.

G. Change IP Addresses / PIN in MythTV Backend

  1. Start Applications -> System -> MythTV Backend Setup.

  2. When prompted select Yes to close any currently running mythbackend processes.

  3. When prompted enter your "pvr" password.

  4. Select 1. General to get to Host Address Backend Setup screen.

  5. Under Local Backend (mythpvr) section TRY to change:

    From

    IPv4 address:  127.0.0.1

    To

    IPv4 address:  192.168.1.55

    Note that I say TRY because my MythTV installation would not let me change the value. No worries though because later on I describe how to change this IP address.

  6. Under Master Backend section change:

    From

    IP address:   127.0.0.1

    To

    IP Address:   192.168.1.55
  7. Make note of the current Security PIN value (default value 0000). Optionally you can set the Security PIN on this screen.

    MythTV Backend General Setup Screen

  8. Navigate through all screens to save changes.

    Use Next to move to the next screen. At last screen use Finish to save your changes.

  9. Press Esc until you exit the MythTV Backend Setup.

  10. Enter your "pvr" account password to start mythv-backend.

  11. Select No to skip running mythfilldatabase.

H. Work-around to Change Backend IPv4 Address

If your MythTV Backend prevents you from changing the IPv4 Address as mine did, then you can correct this issue by updating the MySQL database directly.

  1. In a terminal window establish a connection to the MySQL database.

    mysql mythconverg -u mythtv -p

    At the Enter password: prompt enter the database password we noted earlier.

    If you are successfully logged in then the prompt will change to:

    mysql>
  2. Check the current Backend and Master server IP settings.

    select * from settings where value in ("BackendServerIP","MasterServerIP");

    On my system I saw the following output (yours might differ):

    +-----------------+--------------+----------+
    | value           | data         | hostname |
    +-----------------+--------------+----------+
    | BackendServerIP | 127.0.0.1    | mythpvr  |
    | BackendServerIP | 127.0.0.1    | mythpvr  |
    | MasterServerIP  | 192.168.1.55 | NULL     |
    +-----------------+--------------+----------+
    3 rows in set (0.00 sec)

    Since I've worked with many databases in the past I knew something was amiss. There should be only one record for BackendServerIP.

    I deleted only one of the BackendServerIP records with the command:

    delete from settings where value="BackendServerIP" limit 1;
    Query OK, 1 row affected (0.00 sec)
  3. Update the BackendServerIP address to the static IP address.

    update settings set data="192.168.1.55" where value="BackendServerIP";
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1  Changed: 1  Warnings: 0
  4. Exit the MySQL session.
    exit

TIP:   Learning more about MythTV database structure

If you wish to learn more about the structure of the MythTV database you might try the following MySQL commands while connected to the database.

show tables;
describe tablename;
help

I. Reboot MythTV Backend and Test Connectivity

  1. Reboot the MythTV Backend server

  2. Test local MythTV Backend host database connectivity.

    In a terminal window enter the following command:

    mysql mythconverg -u mythtv -p -e "select count(*) from settings;"

    At the Enter password: prompt enter the database password we noted earlier.

    On my system I see the following output (yours might differ):

    +----------+
    | count(*) |
    +----------+
    |      813 |
    +----------+
  3. Test network IP address connectivity.

    mysql mythconverg -u mythtv -h 192.168.1.55 -p -e "select count(*) from settings;"

    If all is working correctly we should see the same output as above because we are selecting the same data from the same database, only via the network interface.

If the above tests worked then the MythTV Backend is now correctly configured for use by remote MythTV Frontends.

If a test failed then re-check all of the steps in this tutorial.

Conclusion

Congratulations on configuring your MythTV Backend to support remote frontends. You should now be ready to set up a remote frontend to enjoy your PVR recordings on additional televisions.

References

While researching how to configure a MythTV Backend for one or more remote MythTV Frontends I found the following references useful:

Future Articles

In future articles, I plan to cover the following topics:

Medusa Deception novel on sale now
News   Documentation     Copyright (c) 2013-2017 Curtis Gedak

Get GParted at SourceForge.net. Fast, secure and Free
	Open Source software downloads Valid HTML 4.01! Correct CSS! Privacy policy