creating a RPi slave/remote backend?

For discussion of topics specific to MythTV on Raspberry Pi devices
Post Reply
User avatar
jfabernathy
Senior
Posts: 367
Joined: Wed Feb 18, 2015 2:37 pm
United States of America

creating a RPi slave/remote backend?

Post by jfabernathy » Sat Jul 18, 2020 9:02 pm

I have a mythtv v31 remote backend on Ubuntu Server 18.04 with a PCIe tuner card and mariadb-server instead of mysql.

I thought I'd create a slave backend using a Raspberry Pi 4 4GB and a HDHomerun Quatro.

I have installed mythtv v31 on a RPi4 and used it as a combo and as just a remote backend.

So my question is how to I setup a slave backend on the RPi4. Do I just take the remote backend on the RPi4 and edit the setting using mythtv-setup on both the master and slave?
Last edited by jfabernathy on Tue Jul 21, 2020 11:34 am, edited 1 time in total.

User avatar
jfabernathy
Senior
Posts: 367
Joined: Wed Feb 18, 2015 2:37 pm
United States of America

Re: creating a RPi slave/remote backend?

Post by jfabernathy » Sun Jul 19, 2020 5:42 pm

Okay, I got some help over on the mythtv user mailing list. I thought I'd document what I did.

1. Fresh install or Raspberry Pi OS Desktop on RPi4 4GB
2. Setup repository and install mythty light per: https://www.mythtv.org/wiki/MythTV_Lig ... ory_Setup
3. Install pi-utils per: https://github.com/MikeB2013/pi-utils.git
4. Modify pi-mythbackend-helper.sh to run just part of the functions (just comment out the function calls you don't need):
fn_get_git
fn_setup_mythtv_user
fn_setup_mythtv_backend_service
fn_setup_directories
fn_tidy_up
5. Run modified pi-mythbackend-helper.sh and reboot
Note: MikeB's scripts will create /etc/mythtv/config.xml and then create the symbolic links /home/pi/.mythtv/config.xml and /home/mythtv/.mythtv/config.xml
6. Edit /etc/mythtv/config.xml and put in the Master IP address and password so the remote/slave will find the database.
7. Run mythtv-setup.
8. I added the HDHR tuners.
Note: The Video Source will already have the source from the Master backend.
9. I setup the Input Connections as I would on a regular backend setup and only scan the first tuner. (Not sure if the scan is necessary but it didn't hurt.)
10. I did NOT setup the Storage Groups on the slave backend.
12. The hard part for me was to understand the Storage Groups setup for the slave backend since you don’t do that when you run mythtv-setup on the slave. See this wiki link for help https://www.mythtv.org/wiki/Setup_Stora ... e_Backends.
On my Master Backend for the Storage Group -> Default, I have 2 directories defined:
1. “/mnt/md0/recordings-tv1”
2. “/mnt/md1/recordings-tv2”
(The is because I have 2 sets of RAID mirrors for the recordings.)
13. To make the remote/slave backend record on it's own hard drive I needed to create a directory owned by mythtv:mythtv with permissions 2775. That directory needs to be put into the Master Backend Storage Groups -> Default. Since MikeB's scripts create /srv/mythv/recordings, I used that one.
You can't use mythtv-setup on the Master backend to add the Storage Group directory /srv/mythtv/recordings right now due to a bug in mythtv-setup. I was given a command to run on the master backend. and it work:

Code: Select all

curl --data GroupName=Default --data DirName=/srv/mythtv/recordings --data HostName=mythbuntu localhost:6544/Myth/AddStorageGroupDir
Note that mythbuntu is the hostname of my master backend and /srv/mythtv/recording is a directory on my slave backend that does not exist on my master backend.
Note: if you screw up your can change AddStorageGroupDir to RemoveStorageGroupDir in the curl command above.
14. At this point I used my Shield TV Android mythtv-frontend and I could see all the tuners on both backends and I started recording 8 programs. The recordings worked and were spread out over both backends. And as I wanted the RPI4’s recordings were in /srv/mythtv/recordings on it’s SSD.

Post Reply