Zoyinc
  • Home
  • Contact
  • Categories
    • CD Archiving
    • GIMP
    • Linux
    • MythTV
    • Open Media Vault
    • Technology
    • VMware
    • WordPress
    • YouTube
  • About


MythTV, EPG, Terrestrial and HDHomeRun

By

Tony

,

July 7, 2014

MythTVRecently we switched our MythTV system from using satellite to terrestrial reception using the HDHomeRun by SiliconDust. Unfortunately what had been a perfectly working EPG under satellite turned into a one day wonder under terrestrial – I could only see one days listing.

I should point out that we live in New Zealand and the problems may be influenced by the particular setup we have here. I am running MythTV 0.25, Fedora 16, Intel core i7 , 6GB RAM with an HDHomeRun.

I have tried to get EPG, Electronic Program Guide, working for a while without much success and gave up. Recently though I gave it another go with more sucess. Now it seems to be fine, albeit without the all the detail like categories and this is my story on what I did. It’s written in hindsight and so possible there are some mistakes.

Resources

MythTV NZ mailing list:
mythtvnz@lists.linuxnut.co.nz

Post to MythTV NZ mailing list by Paulgir
http://lists.ourshack.com/pipermail/mythtvnz/2012-January/012377.html

Hans from Nice Technology
http://nice.net.nz/

Background

Getting the EPG from New Zealand terrestrial in MythTV has been a problem for a while with various theories about why.

After trying for sometime to get the EPG from the DVB-T broadcast I reluctantly decided to get my listings from http://www.epg.org.nz/ – the pragmatic solution. At epg.org.nz they produce an xml file containing most of TV channels in NZ and their tv listings for the next 8 days. The MythTV grabber downloads the listings and inserts the listings into MythTV.

Steps

Having a combination of satellite and terrestrial receivers seems to cause problems it certainly did for me. My suggestion would be to stick to one or the other if possible. This post assumes you are only using terrestrial and in my case a HDHomeRun.

To make things simpler we will refer to the user that runs mythbackend as the “mythtv user”.

1. Download a copy of ‘tv_grab_nz-py’ from http://nice.net.nz/tv_grab_nz-py/
2.

Some people have reported problems with the script and in the process of trying to get it working for me, I took these suggestions and edited the script:

 a. Change the script to use python 2, so change:

#!/usr/bin/python

to

#!/usr/bin/python2

b. To get the encoding right search for:

doc = ElementTree.parse(StringIO(text)).getroot()

and replace it with

parser = ElementTree.XMLParser(encoding=”ISO-8859-1″)
doc = ElementTree.parse(StringIO(text), parser=parser).getroot()

c. Sometimes the script doesn’t like certain characters in the channel name so search for:

use = raw_input(‘Use channel %s (%s)? [y/N]’ % (channel[1], channel[0]))

and replace with

use = raw_input(‘Use channel %s (%s)? [y/N]’ % (channel[1].encode(‘ascii’, ‘ignore’), channel[0]))

3. The above changes aren’t a perfect solution but made it work for me. So there is a good chance you might be able to enhance it further.With many thanks to Hans from Nice Technology, my version of the script can be found here: tv_grab_nz-py_tp.zip (Obviously it will need to be unzipped)
4. You need to put this script somewhere in the PATH of the mythtv user. So just run “env” to find the path and copy this script to somewhere in the path and give it execute rights and full permissions to themythtv user. I have tested this point and it does appears that “mythtvtv-setup” searches the path of the mythtv user.Also the filename must start with “tv_grab_” you can have what you want after that.

Recently I have found that it worked for me to put it in the “HOME” folder for the user that runs mythbackend. In my case this was “/var/lib/mythtv”

5. Login to your MythTV backend server and login as the mythtv user. then start the “mythtv-setup”.
6.

Go to “Video Sources”MythTV Main Menu

7. Then select or create your video source and edit it.

MythTV Video Sources

8.  In the drop-down for “Listings grabber” you should select “New Zealand”:MythTV EPG
9. Next you need to create a config file in the home directory of the mythtv user. This needs to have exactly the same name as the “Video source name” you choose. In our case our source above is “HDHomeRun” so our config file is:

~/.mythtv/HDHomeRun.xmltv

I haven’t tested it but I suspect you need to get the capitalization correct too.

There are a number of ways to do this.

  1. You can click on “Configure” in the above screenshot.
  2. You can run the “tv_grab_nz_py” script as the mythtv user
  3. You can create the config file manually.

I did mine by running the script as the mythtv user. I tend to suspect creating the config file by hand might actually be the easiest, but then you need to know how to construct it.

The “*.xmltv” is a list of channels. To give you an idea this is part of the contents of my HDHomeRun.xmltv:

channel=aljazeera.freeviewnz.tv
channel=tv1.freeviewnz.tv
channel=tv-rotorua.freeviewnz.tv
channel=tv2.freeviewnz.tv
channel=tv2-plus1.freeviewnz.tv
channel=tv2-plus1.freeviewnz.tv
channel=tv3.freeviewnz.tv
channel=tv33.freeviewnz.tv
channel=tv3-plus1.freeviewnz.tv
channel=tv9.freeviewnz.tv
channel=tv-central.freeviewnz.tv
channel=tvnz7.freeviewnz.tv
channel=tv1-plus1.freeviewnz.tv
channel=tvsn-shopping-channel.freeviewnz.tv
channel=u.freeviewnz.tv
10. Now you need to map the channels in the “tv_grab_nz_py” script with the channels that you receive from your terrestrial broadcast.

So from the backend setup select “Channel Editor”:

MythTV Channel Editor

11. Once you are in the editor you should probably sort the list. Click on the “Sort Mode” input box and use the left and right arrows to select “Channel Number::

MythTV Channel Editor Sort

12. Highlight the channel you wish to edit and push “Enter”:MythTV Select ChannelAs an aside one thing that eluded me for ages was how to delete one channel – simply select it and press “D”.
13. Once you are in the “Channel Options | Common” screen look for the field “XMLTV ID” field. You need to edit this so it matches you “*.xmltv” file (in my case “HDHomeRun.xmltv”).So in the below example, I am editing the TV3 channel and in my “HDHomeRun.xmltv” file I have:

channel=tv3.freeviewnz.tv

 So you need to put in “tv3.freeviewnz.tv” as below:

MythTV Edit A Channel Screen

 

Troubleshooting

It’s really handy to run “mythfilldatabase” from a terminal and look at the output. For example if you see:

No channels are configured to use grabber.

Then this means you have probably not edited the channels, as per the last few steps above or you have made a mistake in this area. Possibly the *.xmltv file is incorrect in some way.

You may also see:

Unknown xmltv channel identifier: c4.freeviewnz.tv - Skipping channel.

Which indicates that while “c4.freeviewnz.tv” exists in your *.xmltv file it is not configured in any of the channels in the channel editor.

 

Related

MythTV on CentOS 7
Miscellaneous MythTV bits of info
Kodi MythTV addon fails to load
Fedora, Linux, IR Remotes, LiRC and MythTV
Recent

  • AlmaLinux GUI – no taskbar or application shortcuts

    AlmaLinux GUI – no taskbar or application shortcuts

  • AlmaLinux 9.5 base VM

    AlmaLinux 9.5 base VM

  • Reset Kodi thumbnails

    Reset Kodi thumbnails

  • Set default settings values in Kodi skins

    Set default settings values in Kodi skins

  • Add/Remove/Reset music/video libraries in Kodi

    Add/Remove/Reset music/video libraries in Kodi

  • Zoyinc Kodi skin on Sony TV

    Zoyinc Kodi skin on Sony TV

  • [L] – WordPress UAM Locked Post

    [L] – WordPress UAM Locked Post

  • Import Pictures and Videos – images not previewed

    Import Pictures and Videos – images not previewed

  • Find My Train

    Find My Train

  • WordPress style name not visible

    WordPress style name not visible

About Zoyinc

  • Contact Us
  • Zoyinc Disclaimer
  • Google Search Console
  • Privacy Policy
  • Site Statistics
  • Login

Apache Auckland Backup CD CentOS Centos7 Children Configuration Debian Error ESX ESXi Fedora Firewall Install Josh Kids Kodi Linux MariaDB MySQL MythTV New Zealand OKD OMV Open Media Vault OpenShift PHP Player Python RAID RedHat Red Hat Rip School Setup SMB SonicWALL Spark tags Train Trains VLAN VM VMware Weaver Windows WordPress YouTube

Powered by

This site is licensed under a Creative Commons Attribution 4.0 International License.