Project

General

Profile

[HOWTO] Guide to openelec, tvheadend, XMLTV, and a working PVR with hdhomerun

Added by Triple D over 12 years ago

I found setting this up agonizing. Dozens of forum threads, lots of questions about this, a tiny crumb of a clue here and there, but no real answers! So after finally getting it working, I feel obliged to write down what I did so that those that are next looking for these answer might find this post. I would have posted this in the openelec forum, but the registration process there wouldn’t work for me. This forum doesn't use rich formatting, so it ended up looking a bit clunky. Oh well.

The best post was probably this one by M B in this forum: https://www.lonelycoder.com/redmine/boards/14/topics/3368

You will need a second computer for this. Let’s call the openelec machine computer 1. Unless stated otherwise, almost everything is done on the non-openelec machine (computer 2). Computers 1 and 2 should be on the same LAN.

My openelec machine (computer 1):
Asus m2npv-vm (a repurposed Captiveworks 3000HD)
openelec 1.95.5 running on a 4GB Kingston USB stick
tvheadend 0.90.0.5265.ga257d
HDhomerun connected to same router, ATSC antenna in Toronto Canada

My Computer 2:
Ubuntu 12.04

1. in XBMC (computer 1):
System > Settings > Addons > openelec mediacenter os addons > Program Addons > hdhomerun (if you don’t have a HDHomerun, just skip this step)
install if needed
consider a reboot if just installing this now
consider checking on HDhomerun status by running “HDHomerun Config GUI” on computer 2.
System > Settings > Addons > Get Addons > All Addons > Services > hts-tvheadend
install
then once installed configure
under XMLTV, change location to “/storage/xmltv.xml”
System > Settings > Addons > installed Addons > PVR clients > Tvheadend HTSP Client
install
then once installed configure
just make sure that the IP address is the same as the openelec machine (Settings > system info)

2. to enable SSH access on Computer 1:
on Computer 2, look for the networked SMB share on machine “openelec”
create a blank file called “ssh_enable” in folder “configfiles”

3. to access settings for tvheadend (computer 2):
in a browser: http://<ip_address_of_computer_1>:9981
Configuration > TV Adapters > Select TV Adapter >
Choose the first one from the drop-down
if your drop-down is blank, you will need to follow a different guide first!
Click “Add DVB Network by location”
for me I chose “United States > ATSC-center-frequencies-8VSB”
on the right side it should find some muxes... wait until the “muxes awaiting initial scan” falls to 0
Now click “Map DVB services to channels”
after awhile, there should be a list of channels under the tab “Services”, with stuff filled in the “Service Name” column that must have come from the ATSC stream
the stuff under the “Channel Name” column is blank, but we’ll come back to that later

4. to get an XML file with EPG data in it, there are 2 ways that worked for me:
option 1, go to http://mc2xml.hosterbox.net/
download the mc2xml file for your OS. Check out the examples down the page
for Windows, I says it brings up a GUI to ask your postal code
for Linux, from a terminal type “mc2xml -c ca -g X1X1X1” (I’m in Canada, use your own postal code)
this should create a file called xmltv.xml in the same folder that mc2xml was run on Computer 2
option 2, use “tv_grab_na_dd”, which requires a subscription to SchedulesDirect
on Ubuntu, for me this required installing “xmltv-util” from the software centre
from a terminal type “tv_grab_na_dd --configure”
you can enter your username and password for SchedulesDirect
you can choose the ATSC lineup from your SchedulesDirect account
now type “tv_grab_na_dd --out ~/xmltv.xml”
this will put a file xmltv.xml in your Home folder on Computer 2
neither method worked for me trying to run it from Computer 1

5. to get at the channels found in step #3 to show up in XBMC, they need names in the “Channel Name” column in TVheadend. But the exact names are also important to populating the EPG data, so:
open up the xmltv.xml file in a text editor, and look at the labels for each display name. ie for me the first one is “12 CHEX”. I always used the first listed name for each channel.
look in tvheadend under the Services tab at the Service Names
So firstly there is no CHEX in tvheadend. For me the first one in BOTH xmltv.xml and tvheadend is “4-1 WIVBDT”, so in tvheadend for service named WIVB-HD double-click the cell under the Services column, and enter in “4-1 WIVBDT”. Don’t forget to “Save changes”
keep going until you have all the ones entered that you want. Some may not be tunable channels, and you may want to delete them later. Yes, all this is tedious.

6. to get EPG data to populate within tvheadend (and XBMC):
copy the xmltv.xml from Computer 2 to Computer 1 into the folder “/storage/” (or you can try somewhere else, it should match what was in Step #1, but this is what worked for me)
within tvheadend, go to “Configuration > XMLTV”
click “Save configuration”
this launches the script “tv_grab_file” which will now look for the xmltv.xml file that you put in /storage/, and if the Channel Names match the data, the EPG will be populated. Look at the log at bottom of screen, it should be a number more than 0 for entries into EPG

7. in XBMC (Computer 1):
LiveTV > TV channels
every channel you manually entered in Step #5 should be listed there! Select one and if it's tunable you should be watching TV!

8. in TVheadend (computer 2):
Configuration > Digital Video Recorder
consider changing the location to record TV (since if you’re like me and running openelec off of a USB key, it won’t hold very much)
every hard drive that is mounted in XBMC should be listed on computer 1 in folder /media/
ie. “/media/500GB/TV/recordings”

choosing programs to record works from either XBMC or tvheadend

That’s it!
Happy TV watching!
III_D


Replies (2)

RE: [HOWTO] Guide to openelec, tvheadend, XMLTV, and a working PVR with hdhomerun - Added by K Shea almost 10 years ago

I'm not the OP but since the original post was posted two years ago, I'll just say that you can place it anywhere you want, as long as you (or whatever shell script you want to use with it) have permission to run it. So if you are going to run it manually, or via a cron job owned by you, then you could put it in your home directory or in a subdirectory off of your home directory. But if you are going to run a cron job as the "hts" user (or whatever user "owns" TVHeadEnd) then you may wish to put it in the home directory, or a subdirectory off the home directory, for the hts user. It's entirely up to you but personally I'd keep it in its own subdirectory, along with any bash scripts or other files you may need to run it and to rename the xmltv.xml file to tv_grab_file.xmltv. Note that you may need to modify the path in the tv-grab-file script to point to the location where your tv_grab_file.xmltv file will be.

The only advantage of running it as the hts user is that then you know for certain there will not be any permissions issue when reading the xml file. There shouldn't be anyway, since TVHeadEnd only reads the file.

I found a somewhat useful commentary on using mc2xml and another program called zap2xml here: http://freetoairamerica.wordpress.com/2014/12/03/some-hints-for-getting-free-to-air-satellite-channels-into-the-electronic-program-guide-in-kodi-or-xbmc-or-another-frontend/

While that article is primarily directed toward C-band and Ku-band satellite viewers that use TVHeadEnd with satellite tuner cards, it does contain some information on mc2xml that may be useful to HDHomeRun users, particularly if you can receive signals from more than one TV market area and therefore need to combine listings from a couple of different zip/postal codes in order to show listings for all the channels you can receive.

    (1-2/2)