Can someone help me understand how TVHeadEnd imports XML guide data at a basic level?

Added by K Shea over 7 years ago

I am just starting to use TVHeadEnd, which is running on a device that uses an ARM-based version of Linux. I don't know much about it but it seems to be a rather lightweight version of Linux. TVHeadEnd is one of two backend software choices on this system (the other is VDR). The TVHeadEnd version is "HTS Tvheadend 3.9.636~g03a69ff" and the Linux version is "armv5tel GNU/Linux".

So far TVHeadEnd seems to be working well but I am having trouble understanding the process by which guide data is imported. I have some previous experience with both Mythbuntu and MediaPortal, and in both cases, once you have an xmltv.xml file containing your guide data there is a way to import it. In Mythbuntu you run a program called mythfilldatabase and it imports the xml file. In MediaPortal you tell it which directory to look in for a tvguide.xml file, then once you have your xmltv.xml file you rename it to tvguide.xml and MediaPortal will see it and import it. But I have no idea how you do it in TVHeadEnd. I see that under "External Interfaces" there is a selection for XMLTV, so I assume there is a way to do it, but I can't seem to find any instructions on how to use it, other than a couple of pages that mention running netcat or nc with the -U option. But this system runs busybox, and its version of nc only has these options:

Usage: nc [-iN] [-wN] [-l] [-p PORT] [-f FILE|IPADDR PORT] [-e PROG]

Open a pipe to IP:PORT or FILE

    -e PROG    Run PROG after connect
    -l    Listen mode, for inbound connects
        (use -l twice with -e for persistent server)
    -p PORT    Local port
    -w SEC    Timeout for connect
    -i SEC    Delay interval for lines sent
    -f FILE    Use file (ala /dev/ttyS0) instead of network

Also it does not have the bash shell, only sh, and I note that the tv_grab_file script suggested in some posts is a bash script (EDIT: Since posting this I have obtained a version that works under the ash shell, which is apparently what busybox uses, but for some reason no guide data is imported). Because this is such a lightweight version of Linux, I cannot install any software that's not already there (other than perhaps shell scripts that work under sh), because there doesn't appear to be any kind of package management system available, as there would be on a full Linux version such as Ubuntu. So I think what I am going to need to do is create my xmltv.xml file on another computer and then copy it over to this device. So all I really need TVHeadEnd to do is slurp up the pre-created xmltv.xml file. Is that possible and if so, what is the easiest way to accomplish that?

My first encounter with TVHeadEnd was only a couple of days ago but this is really the first thing that has stopped me cold. There is still a lot I don't understand, for example I see a lot of talk about "grabbers" but don't understand exactly how they fit into the scheme of things, but if they are written in bash they won't work on this system anyway. I just really need to get a good grasp of how this all works in TVHeadEnd 3.9. Is there any documentation that explains it in a way that someone just starting out with TVHeadEnd can understand it?

On the help screen for the EPG Grabber page, all it says about XMLTV is "XMLTV/PyEPG - if you are using the internal versions of these modules then you must first configure them externally as Tvheadend provides no support for this. Nor does it provide the ability to pass command line options (for this use the external interface)." Could anyone perhaps shed a bit more light on the process, please?

EDIT: As noted above I got a version of the tv_grab_file script that runs on the MOI+ but for some reason TVHeadEnd still won't read in the file. It sees that there are three channels in the file, but refuses to actually import any of the data. It appears to be the same issue reported in this thread:

EDIT 2: And for some reason that I do not fully understand, after leaving it alone for several hours, suddenly the guide data became available under Configuration | Channel / EPG | Channels and then selecting a channel, clicking Edit, and using the EPG Source dropdown menu. I had tried this before several times and nothing was there, but today I just happened to try it again and all the channels in the guide somehow magically appeared. I am sooooo confused!

TL;DR Is there an easy way I can place an XMLTV.XML file pre-created on another machine in a specific directory, and have TVHeadEnd import it, without the use of any bash scripts or other added software?