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
- A. Set MythTV Backend Server Static IP Address
- B. Set MythTV Backend Server BIOS/UEFI to Wake-On-LAN
- C. Acquire MySQL Database Login Information
- D. Enable MySQL Database Service on Network
- E. Enable MySQL Network Service Daemon
- F. Enable MythTV Backend Database Service
- G. Change IP Addresses / PIN in MythTV Backend
- H. Work-around to Change Backend IPv4 Address
- I. Reboot MythTV Backend and Test Connectivity
- Conclusion
- References
- Future Articles
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 |
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.
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 |
C. Acquire MySQL Database Login Information
-
Start existing MythTV Frontend (Applications -> Multimedia -> MythTV Frontend).
-
Navigate to Setup -> General.
-
Make note of the following values.
Database name: # should be mythconverg Username: # should be mythtv Password:
-
Exit out of MythTV Frontend.
D. Enable MySQL Database Service on Network
-
Edit /etc/mysql/my.cnf file.
sudo leafpad /etc/mysql/my.cnf
-
Under [mysqld] section, comment out bind-address line.
Change
bind-address = 127.0.0.1
To
#bind-address = 127.0.0.1
-
Save file and exit editor.
-
Restart MySQL service.
sudo service mysql restart
E. Enable MySQL Network Service Daemon
-
Start Applications -> System -> Mythbuntu Control Center.
-
Select MySQL.
-
Under Master Backend Role enable the MySQL service on Ethernet interfaces.
Enable MySQL service on ethernet interfaces (required for remote Frontend or Backend)
-
Close Mythbuntu Control Center.
F. Enable MythTV Backend Database Service
-
Edit /etc/mysql/conf.d/mythtv.cnf file.
sudo leafpad /etc/mysql/conf.d/mythtv.cnf
-
Under [mysqld] section make the following edit.
Change
bind-address=0.0.0.0
To
bind-address=192.168.1.55
-
Save file and exit editor.
G. Change IP Addresses / PIN in MythTV Backend
-
Start Applications -> System -> MythTV Backend Setup.
-
When prompted select Yes to close any currently running mythbackend processes.
-
When prompted enter your "pvr" password.
-
Select 1. General to get to Host Address Backend Setup screen.
-
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.
-
Under Master Backend section change:
From
IP address: 127.0.0.1
To
IP Address: 192.168.1.55
-
Make note of the current Security PIN value (default value 0000). Optionally you can set the Security PIN on this screen.
-
Navigate through all screens to save changes.
Use Next to move to the next screen. At last screen use Finish to save your changes.
-
Press Esc until you exit the MythTV Backend Setup.
-
Enter your "pvr" account password to start mythv-backend.
-
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.
-
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>
-
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)
-
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
-
Exit the MySQL session.
exit
TIP: Learning more about MythTV database structure |
I. Reboot MythTV Backend and Test Connectivity
-
Reboot the MythTV Backend server
-
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 | +----------+
-
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:
- Mythfrontend
- How to: Setting Up Multiple Remote Frontend for a MythTV Backend
- IP addressing in dedicated backend Myth 0.27 14.04
Future Articles
In future articles, I plan to cover the following topics: