Can anyone hep me understand how TVHeadEnd imports guide data?
#1
I am in the process of setting up a TBS MOI+ which is a free-to-air satellite TV tuner box that includes the TVHeadEnd software. It runs on a ARM-based processor and runs a fairly lightweight version of Linux with busybox. Of particular note is that is does not include bash (just sh), so bash scripts apparently don't run correctly (at least not without modification), and as far as I can tell there is no package management system like apt or yum, so installing new software is a no-go (perhaps someone with a lot more Linux experience than I could do it, but I would have no idea where to start). There's also no perl or python interpreters that I can find. Yet somehow they have managed to include TVHeadEnd (3.9 branch) and it works surprisingly well, both in streaming Live TV to XBMC and in recording signals (using TVHeadEnd's web interface to set the start and stop times of recordings) and sending those recordings to XBMC.

What I have not been able to figure out is how to get EPG data into the device. I know how to create an xmltv.xml file containing the channels I want, but I do not know how to get TVHeadEnd to read it in. Much of what I see online talks about "grabbers", including one called tv_grab_file which turns out to be a bash script. But nowhere have a I found a real overview of how the process works in TVHeadEnd, so I'm having trouble conceptualizing the process by which TVHeadEnd might take a xmltv.xml file and import it into its database.

To be clear, as far as I know it is not possible to install software on this device, so the actual .xml file will need to be created on another machine on the local network and then dropped into a directory on this device. In other software such as MediaPortal I could just drop the file into a specific directory (and in the specific case of MediaPortal, rename it to tvguide.xml) and the software would see that a new file is available and import it. But as far as I have been able to determine, TVHeadEnd doesn't appear to work that way, unless I have totally missed something.

Even though it's a bash script, I did try putting the tv_grab_file script into /usr/bin as a couple posts I found suggested, and changing the permission using chmod 777. From what I read, I should have then been able to go into TVHeadEnd (to Configuration | Channel/EPG | EPG Grabber) and under "Internal Grabber" a new module should have appeared in the "Module" dropdown, but it didn't - the only choice there is "Disabled". I even rebooted the box and still no go. I also found that on that same page, under "External Interface", there is a selection for XMLTV but checking that doesn't seem to do anything. I read somewhere that with that enabled, you can use "netcat" with the -u option to send an xml file to TVHeadEnd (at least I think that's how it's supposed to work), but the version of netcat provided by busybox (called nc) doesn't include a -u option (-u sets "UDP mode" and there is no equivalent in the busybox version). So no matter what I have looked at I seem to run up against another wall. I keep thinking there has got to be some way to get schedule data into TVHeadEnd, and this is the last thing I need to figure out in order to have a truly functional system and get guide data into XBMC. Any ideas on how I might be able to get TVHeadEnd to import a pre-made xmltv.xml file?

In case it matters, running uname -a on this device returns the following:
Linux moi 2.6.35.14 #57 Mon Aug 4 03:00:56 SGT 2014 armv5tel GNU/Linux
The version of TVHeadEnd is: HTS Tvheadend 3.9.636~g03a69ff
Reply
#2
Has the version of TVH you have got not got any 'over the air' grabber options ? I do grab using XMLTV but this only gives me info for 46 channels, the other 40 or so are grabbed directly from the DVB-T feed.
Learning Linux the hard way !!
Reply
#3
(2014-08-26, 20:32)black_eagle Wrote: Has the version of TVH you have got not got any 'over the air' grabber options ? I do grab using XMLTV but this only gives me info for 46 channels, the other 40 or so are grabbed directly from the DVB-T feed.

Well that is the thing, I don't even understand how this whole "grabber" system works - it's like every document I've found sort of assumes you already know how to set that up. But in any case, this device only receives DVB-S and DVB-S2 satellite signals - no terrestrial at all (you can get versions with cards that have a DVB-T tuner, but that's not what I have - it depends on the tuner card installed, and mine only has two DVB-S2 tuners).

Still, you say that you are grabbing using XMLTV, so exactly how are you doing that? 46 channels is 46 more than I have now, and as I say I already know how to create a xmltv.xml file, so all I need to know is how to get it into TVHeadEnd. I don't need TVHeadEnd to do ANYTHING with regard to the creation of that file, I only need it to grab the schedule data in that file and get it into its database. I assume that at some point in the process you must have an xmltv.xml file or similar .xml file, so how are you getting TVHeadEnd to read it in?
Reply
#4
If you use openelec its very easy, just point out xmltv in tvheadend service addon settings in xbmc. It can be from www or file
Reply
#5
WhatI am configuring is a backend server. It does not even have an HDMI port and there would be no way to run openelec on it. Also, even if that were a solution, it would not at all help me understand how this works. I was able to get the tv_grab_file bash script converted to sh but still it will not pull in the guide data. I'm beginning to think it might be a bug in TVHeadEnd because I see other reports of people having a similar issue.
Reply
#6
It's a long time since I used XMLTV (I use OTA grabbers now), but I seem to recall that you had to run the grabber file as the user under which you run tvheadend. The first run sets up the channels you want to import, creates config files, etc. - after that, tvheadend can see the external grabber and call it as required. Similarly, there's a "find grabbers" script that you need to run if you add any new grabbers, e.g. if you've adapted/renamed anything.
Reply
#7
I got it to work. I was able to get the tv_grab_file script converted to a busybox "ash" shell script and after some delay that I don't quite understand, it now works.

In case anyone else needs it, here is the "ash" script version of the tv_grab_file script (thanks to Harald Becker for this). Be sure to change the location in the line that starts with "cat" to point to the correct path and filename of the xmltv.xml file you are trying to import. You can test your "cat" line by running it from the terminal; it should display all the lines of the xml file.

Code:
#!/bin/sh

if [ $# -lt 1 ]
then
  cat /mnt/disk/.xmltv/tv_grab_file.xmltv
  exit 0
fi

while [ $# -gt 0 ]
do case "$1" in
   -d | --description )
     printf "tv_grab_file is a simple grabber that just read the ~/.xmltv/tv_grab_file.xmltv file\n"
     ;;

   -v | --version )
     printf "0.1\n"
     ;;

   -c | --capabilities )
     printf "baseline\n"
     ;;

    -* )
      printf "unknown option: %s\n" "$1"
      printf "Usage: %s: [--description] [--version] [--capabilities]\n" ${0##*/}
      exit 2
      ;;

esac; shift
done

exit 0
Reply
#8
You could have googled my repository… it's especially for use on devices with ASH/Busybox shell instead of ANSI bash Wink

https://github.com/nurtext/tv_grab_file_synology
Reply
#9
I use now WebGrab++ on debian system to generate the xmltv file and it works well (very fast, processing 30 channels in 50 seconds)

http://webgrabplus.com/documentation/int.../tvheadend
Reply
#10
(2014-09-01, 18:03)Meindert Wrote: I use now WebGrab++ on debian system to generate the xmltv file and it works well (very fast, processing 30 channels in 50 seconds)

http://webgrabplus.com/documentation/int.../tvheadend

Hello!

I have also installed Webgrab+. I have the installation on Ubuntu 14.04 to have EPG data in TVHeadend (HTS Tvheadend 3.4.28~geb79aee~trusty).
The installation was OK following the guide here: http://webgrabplus.com/documentation/int.../tvheadend

I installed the most recent files (including the patch). Everything worked fine (after some troubles - but this was due to my limited Linux knowledgeBlush) and now I was able to test the grab file in /usr/bin and it works. The guide.xml file seemed to be properly built. Now I was checking the TVHeadend settings and I was able see the tv_grab_file (the wg++ one) in the configuration (dropdown and selected it) in TVHeadend.

After selection of that and save changes I cannot see or select the EPG channels in the channel view in TVHeadend (it worked with mc2xml). Huh

I have no clue what I could have missed. The direction I am going now is if any permissions are not correct. do you have had a similar issue so far?

One fact I was doing is that I installed the files and modified them remotely on my MAC. So config files edited with notepad and copied back with FTP. the command line commands I made with an SSH connection to my linux machine. the fact I mean is that most of the files are now written with the root user. could this be a problem?
Or do I need to place the /wg++ folder inside the root folder of HTS? HuhConfused

Any help would be appreciated! Nod
thanks
/krijeck
rebuilding ....
Reply
#11
(2014-09-03, 21:17)krijeck Wrote:
(2014-09-01, 18:03)Meindert Wrote: I use now WebGrab++ on debian system to generate the xmltv file and it works well (very fast, processing 30 channels in 50 seconds)

http://webgrabplus.com/documentation/int.../tvheadend

Hello!

I have also installed Webgrab+. I have the installation on Ubuntu 14.04 to have EPG data in TVHeadend (HTS Tvheadend 3.4.28~geb79aee~trusty).
The installation was OK following the guide here: http://webgrabplus.com/documentation/int.../tvheadend

I installed the most recent files (including the patch). Everything worked fine (after some troubles - but this was due to my limited Linux knowledgeBlush) and now I was able to test the grab file in /usr/bin and it works. The guide.xml file seemed to be properly built. Now I was checking the TVHeadend settings and I was able see the tv_grab_file (the wg++ one) in the configuration (dropdown and selected it) in TVHeadend.

After selection of that and save changes I cannot see or select the EPG channels in the channel view in TVHeadend (it worked with mc2xml). Huh

I have no clue what I could have missed. The direction I am going now is if any permissions are not correct. do you have had a similar issue so far?

One fact I was doing is that I installed the files and modified them remotely on my MAC. So config files edited with notepad and copied back with FTP. the command line commands I made with an SSH connection to my linux machine. the fact I mean is that most of the files are now written with the root user. could this be a problem?
Or do I need to place the /wg++ folder inside the root folder of HTS? HuhConfused

Any help would be appreciated! Nod
thanks
/krijeck

found the solution: http://forum.xbmc.org/showthread.php?tid=203597
/krijeck
rebuilding ....
Reply

Logout Mark Read Team Forum Stats Members Help
Can anyone hep me understand how TVHeadEnd imports guide data?0