Mailing List Archive

No EPG - need temp solution
Greetings all

I'm in the process of updating my system from DVB cards to an HD Homerun
(along with major updates to my backend server) so I haven't rescanned the
channels to get the change from a couple of weeks ago.

All has been fine until a lot of my EPG data has stopped working - in
particular Prime. I really need something to tide me over until I can
finish my updates so I can deliver Bake Off for the next couple of weeks.
I have been downloading from epg.org.nz, using epgsnoop on the DVBS card
and mhegepgsnoop on the DVBT card and merging them using tv_cat and its
all worked fine for years but now epg.org.nz stops at 22 March, DVBS
doesn't seem to have Prime and mhegepgsnoop errors with "IOError: [Errno
75] Value too large for defined data type"

Does anyone have a generic EPG file they can send me I can manually import
with mythfilldatabase that covers the next week or so, so I'm still alive
on Friday morning!!

Cheers

--
Robin Gilks zl3rob/g8ecj
Internet: g8ecj@gilks.org http://www.gilks.org




_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
Hi Robin,
I use NZXMLTV because it has all of the channels - just note the channel IDs won't match what you have, but since you are doing a manual import it should work.
https://nzxmltv.github.io/xmltv/guide.xml

Cheers
Wayne
[sent from my phone - please excuse any mistakes]
________________________________
From: mythtvnz <mythtvnz-bounces@lists.ourshack.com> on behalf of Robin Gilks <g8ecj@gilks.org>
Sent: Wednesday, April 13, 2022 2:05:02 PM
To: MythTV in NZ <mythtvnz@lists.linuxnut.co.nz>
Subject: [mythtvnz] No EPG - need temp solution

Greetings all

I'm in the process of updating my system from DVB cards to an HD Homerun
(along with major updates to my backend server) so I haven't rescanned the
channels to get the change from a couple of weeks ago.

All has been fine until a lot of my EPG data has stopped working - in
particular Prime. I really need something to tide me over until I can
finish my updates so I can deliver Bake Off for the next couple of weeks.
I have been downloading from epg.org.nz, using epgsnoop on the DVBS card
and mhegepgsnoop on the DVBT card and merging them using tv_cat and its
all worked fine for years but now epg.org.nz stops at 22 March, DVBS
doesn't seem to have Prime and mhegepgsnoop errors with "IOError: [Errno
75] Value too large for defined data type"

Does anyone have a generic EPG file they can send me I can manually import
with mythfilldatabase that covers the next week or so, so I'm still alive
on Friday morning!!

Cheers

--
Robin Gilks zl3rob/g8ecj
Internet: g8ecj@gilks.org http://www.gilks.org




_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
Hi Robin,
I use NZXMLTV because it has all of the channels - just note the channel IDs won't match what you have, but since you are doing a manual import it should work.
https://nzxmltv.github.io/xmltv/guide.xml

Cheers
Wayne
[sent from my phone - please excuse any mistakes]
________________________________
From: mythtvnz <mythtvnz-bounces@lists.ourshack.com> on behalf of Robin Gilks <g8ecj@gilks.org>
Sent: Wednesday, April 13, 2022 2:05:02 PM
To: MythTV in NZ <mythtvnz@lists.linuxnut.co.nz>
Subject: [mythtvnz] No EPG - need temp solution

Greetings all

I'm in the process of updating my system from DVB cards to an HD Homerun
(along with major updates to my backend server) so I haven't rescanned the
channels to get the change from a couple of weeks ago.

All has been fine until a lot of my EPG data has stopped working - in
particular Prime. I really need something to tide me over until I can
finish my updates so I can deliver Bake Off for the next couple of weeks.
I have been downloading from epg.org.nz, using epgsnoop on the DVBS card
and mhegepgsnoop on the DVBT card and merging them using tv_cat and its
all worked fine for years but now epg.org.nz stops at 22 March, DVBS
doesn't seem to have Prime and mhegepgsnoop errors with "IOError: [Errno
75] Value too large for defined data type"

Does anyone have a generic EPG file they can send me I can manually import
with mythfilldatabase that covers the next week or so, so I'm still alive
on Friday morning!!

Cheers

--
Robin Gilks zl3rob/g8ecj
Internet: g8ecj@gilks.org http://www.gilks.org




_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
On Wed, 13 Apr 2022 14:05:02 +1200, you wrote:

>Greetings all
>
>I'm in the process of updating my system from DVB cards to an HD Homerun
>(along with major updates to my backend server) so I haven't rescanned the
>channels to get the change from a couple of weeks ago.
>
>All has been fine until a lot of my EPG data has stopped working - in
>particular Prime. I really need something to tide me over until I can
>finish my updates so I can deliver Bake Off for the next couple of weeks.
>I have been downloading from epg.org.nz, using epgsnoop on the DVBS card
>and mhegepgsnoop on the DVBT card and merging them using tv_cat and its
>all worked fine for years but now epg.org.nz stops at 22 March, DVBS
>doesn't seem to have Prime and mhegepgsnoop errors with "IOError: [Errno
>75] Value too large for defined data type"
>
>Does anyone have a generic EPG file they can send me I can manually import
>with mythfilldatabase that covers the next week or so, so I'm still alive
>on Friday morning!!
>
>Cheers

You might like to get the updated Python 3 version of mhegepgsnoop and
see if that helps:

http://www.jsw.gen.nz/mythtv/mhegepgshoop-0.7.2.py

As well as new features, it has had fixes for a number of things, and
I seem to remember a message like yours was one of them.

Also, the downloaded data from egp.org.nz was having xmltv-proc-nz run
on it before it was loaded on the web server. So to get the same
processing from your own data from mhegepgsnoop.py, you will also want
to set up the new Python 3 version of xmltv-proc-nz. See my post from
yesterday on this list for how to get it.

Note that mhegepgsnoop.py can not (yet) fetch EPG directly from
HDHomerun tuners. See Mike Brady's scripts posted on the "No EPG,
what am i doing wrong" thread on 7/4/22 at 21:39 for his workaround
where you capture to a .ts file and get mhegepgsnoop.py to use
dvbsnoop to process the EPG from the .ts file.

I have put a copy of my today's MHEG5 EPG on my web server for you (it
has had xmltv-proc-nz run on it):

http://www.jsw.gen.nz/mythtv/freeview.xml.gz

But it is not generic - mhegepgshoop.py gets the xmltvid values from
the MythTV database and uses them in its output. So it has my xmltvid
values. To see how they are mapped to the channel callsigns from a
current scan, see this file:

http://www.jsw.gen.nz/mythtv/sourceid1.txt

So you would need to make up a sed file to change all the xmltvids to
match yours. If you can send me the /tmp/xmltvids.sql file created by
these commands, I can create the necessary sed file for you with a bit
of SQL magic:

sudo su
cd /tmp
mysql mythconverg
create table xmltvids as select callsign,xmltvid from channel where
sourceid=1;
quit
mysqldump mythconverg xmltvids >xmltvids.sql
mysql mythconverg
drop table xmltvids;
quit
exit

Change the sourceid=1 to the correct number for your DVB-T source.

The above presumes that you have done a full channel scan since the
March channel rearrangements and so will have the callsigns set to the
currently broadcast values.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
On Wed, 13 Apr 2022 22:21:48 +1200, you wrote:

>create table xmltvids as select callsign,xmltvid from channel where
>sourceid=1;

Oops, this should be:

create table xmltvids as select callsign,xmltvid from channel where
sourceid=1 and deleted is null;

I keep on forgetting about the new feature of deleted channels.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
On Wed, 13 Apr 2022 22:21:48 +1200, you wrote:

>http://www.jsw.gen.nz/mythtv/mhegepgshoop-0.7.2.py

And there is a typo in there. Try this:

http://www.jsw.gen.nz/mythtv/mhegepgsnoop-0.7.2.py

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
I do not fully understand how XMLTV works and do not feel confident to
get it working with the recent grabbers being discussed on this thread.

I wonder if a "how-to" could be created similar to the notes I made when
I first set up my system to use Had's grabber?

Here are my original notes:-

1) Download tv_grab_nz-py from http://nice.net.nz/tv_grab_nz-py/

2) Copy tv_grab_nz-py to /usr/local/bin.  Make sure that it
is executable. (sudo chmod +x tv_grab_nz-py)

3) Configure it. Note that the configuration file name must match that
name of the video source configured in mythtv-setup for the
mythbackend/mythfilldatabase to use this grabber.
tv_grab_nz-py –configure –config-file ~/.mythtv/<video sources
name>.xmltv
Step 3 had some problems for me but it was overcome by copying and editing
another <video sources name>.xmltv

You also need to symlink otherwise mythfilldatabase will not work
automatically (it uses the user mythtv)
sudo ln -s /home/yourusername/.mythtv/Freeview.xmltv
/home/mythtv/.mythtv/Freeview.xmltv

4) To see if the xmltv side of things works run
tv_find_grabbers

This should return a list of all the installed grabbers, which should
include tv_grab_nz-py.

5) To see if the myth side of things works run
mythfilldatabase
Pay close attention to the output of this. If it looks like it worked,
the MythWeb status page should also show a successful run.

6) On the master backend run mythsetup and
a) In Video Sources set “New Zealand (py)” as the grabber for your
Video Source.
b) In General, on the Mythfilldatabase page (its the last page) enable
“Automatically run mythfilldatabase”. Configure time, frequency, etc
to suite. Now Myth should use tv_grab_nz-py to update EPG
periodically. The MythWeb status page shows when it was last run and
what the results were.


_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
On Wed, 13 Apr 2022 at 20:04, Wayne Thomas <waynethomas69@hotmail.com> wrote:
>
> Hi Robin,
> I use NZXMLTV because it has all of the channels - just note the channel IDs won't match what you have, but since you are doing a manual import it should work.
> https://nzxmltv.github.io/xmltv/guide.xml
>
> Cheers
> Wayne
> [sent from my phone - please excuse any mistakes]

Nice! I didn't know about this xml EPG source before.

I'm now trialling it & it looks good, having just also successfully
set up do_mhegepgsnoop and Stephen Worthington's other excellent
scripts.

Very nice to have a choice of good data these days, including using
mhegEPGsnoop, which gives us independence from external sources,
nicely massaged by Stephen's clean up.

Curtis

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
On Wed, 13 Apr 2022 at 20:04, Wayne Thomas <waynethomas69@hotmail.com> wrote:
>
> Hi Robin,
> I use NZXMLTV because it has all of the channels - just note the channel IDs won't match what you have, but since you are doing a manual import it should work.
> https://nzxmltv.github.io/xmltv/guide.xml
>
> Cheers
> Wayne
> [sent from my phone - please excuse any mistakes]

Nice! I didn't know about this xml EPG source before.

I'm now trialling it & it looks good, having just also successfully
set up do_mhegepgsnoop and Stephen Worthington's other excellent
scripts.

Very nice to have a choice of good data these days, including using
mhegEPGsnoop, which gives us independence from external sources,
nicely massaged by Stephen's clean up.

Curtis

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
On Thu, 14 Apr 2022 09:29:44 +1200, you wrote:

>I do not fully understand how XMLTV works and do not feel confident to
>get it working with the recent grabbers being discussed on this thread.
>
>I wonder if a "how-to" could be created similar to the notes I made when
>I first set up my system to use Had's grabber?
>
>Here are my original notes:-
>
>1) Download tv_grab_nz-py from http://nice.net.nz/tv_grab_nz-py/
>
>2) Copy tv_grab_nz-py to /usr/local/bin.  Make sure that it
>is executable. (sudo chmod +x tv_grab_nz-py)
>
>3) Configure it. Note that the configuration file name must match that
>name of the video source configured in mythtv-setup for the
>mythbackend/mythfilldatabase to use this grabber.
>tv_grab_nz-py ?configure ?config-file ~/.mythtv/<video sources
>name>.xmltv
>Step 3 had some problems for me but it was overcome by copying and editing
>another <video sources name>.xmltv
>
>You also need to symlink otherwise mythfilldatabase will not work
>automatically (it uses the user mythtv)
>sudo ln -s /home/yourusername/.mythtv/Freeview.xmltv
>/home/mythtv/.mythtv/Freeview.xmltv
>
>4) To see if the xmltv side of things works run
>tv_find_grabbers
>
>This should return a list of all the installed grabbers, which should
>include tv_grab_nz-py.
>
>5) To see if the myth side of things works run
>mythfilldatabase
>Pay close attention to the output of this. If it looks like it worked,
>the MythWeb status page should also show a successful run.
>
>6) On the master backend run mythsetup and
>a) In Video Sources set ?New Zealand (py)? as the grabber for your
>Video Source.
>b) In General, on the Mythfilldatabase page (its the last page) enable
>?Automatically run mythfilldatabase?. Configure time, frequency, etc
>to suite. Now Myth should use tv_grab_nz-py to update EPG
>periodically. The MythWeb status page shows when it was last run and
>what the results were.

Using mhegepgsnoop.py is a bit different. You can still use
tv_grab_nz-py if you want to, but it is probably easier not to. So
here is a full set of instructions (I hope) for getting set up to use
mhepgsnoop and xmltv-proc-nz.

In mythtv-setup, select "No grabber" for the EPG source and disable
EIT. Disable the automatic running of mythfilldatabase. Note down
the time you currently have mythfilldatabase running at. Exit
mythtv-setup.

Then run these commands:

sudo su
cd /usr/local/bin
wget http://www.jsw.gen.nz/mythtv/mhegepgsnoop-0.7.2.py
mv -v mhegepgsnoop-0.7.2.py mhegepgsnoop.py
wget http://www.jsw.gen.nz/mythtv/do_mhegepgsnoop3.sh
wget http://www.jsw.gen.nz/mythtv/xmltv-proc-nz
mv -v do_mhegepgsnoop3.sh do_mhegepgsnoop.sh
mkdir -p /home/mythtv/.mythtv
chown mythtv:mythtv /home/mythtv/.mythtv

Ignore any error or warning messages that occur in the last two
commands above if you already have a .mythtv directory.

Now edit do_mhegepgsnoop.sh (as root) and check the configuration at
the top of the file. The SOURCEID needs to be set to the sourceid of
your FreeviewHD DVB-T channels, and the ADAPTER needs to be set to the
adapter number (the x in /dev/dvb/adapter<x>) of one of your DVB-T(2)
adapters. It is probably best to choose the one that is used least
often, which will normally be the one with the highest number, but it
depends on how you have your tuner priority and schedorder values set
up. Of course, if you have a spare tuner not being used (ie > 5
DVB-T(2) tuners), select that to be used for mhegepgsnoop.

These commands will show you your sourceid values:

mysql mythconverg
select sourceid,name,xmltvgrabber,useeit from videosource order by
sourceid;
quit

And these commands should show you the tuners configured in MythTV:

mysql mythconverg
select
cardid,parentid,videodevice,cardtype,inputname,sourceid,displayname,schedorder,livetvorder
from capturecard order by videodevice,cardid;
quit

Now continue running these commands as root:

cd /usr/local/bin
chmod u=rwx,g=rx,o=rx mhegepgsnoop.py do_mhegepgsnoop.sh
chmod u=rwx,g=rx,o=rx xmltv-proc-nz
cd /var/www/html
wget http://www.jsw.gen.nz/mythtv/xmltv-proc-nz-json.tgz
tar xvf xmltv-proc-nz-json.tgz

Now check the three +json files in the subdirectories under the
/var/www/html/json directory. Make sure they are using the same
xmltvid values that you have on your system. These commands will
show your current xmltvid values:

mysql mythconverg
select chanid,channum,name,callsign,xmltvid,serviceid from channel
where sourceid=<x> order by channum+0;
quit

Replace <x> with the correct sourceid. If your xmltvid values are
different from the +json ones, you can choose to change either the
ones in the channel table, or the ones in the +json files, so that
they match. If you are not using Sky EPG as well as FreeviewHD EPG,
you can ignore the xmltvid values in the sky-movies-xmltvids/+json
file.

Now continue running these commands as root:

cd /etc/systemd/system
wget http://www.jsw.gen.nz/mythtv/epg.service
wget http://www.jsw.gen.nz/mythtv/epg.timer

Now you need to edit the epg.timer file and change the two places
where it says "15:10" to be whatever time you normally run
mythfilldatabase.

Now continue running these commands as root:

cd /etc/systemd/system
chmod u=rw,g=r,o=r epg.service epg.timer
systemctl daemon-reload
systemctl enable epg.timer
exit

At this point everything should be set up and EPG will be
automatically downloaded from MHEG5, processed by xmltv-proc-nz and
loaded into the database by mythfilldatabase, at the time specified.

To test if it is working, or if you ever want to run EPG collection
manually for some reason, do this:

sudo systemctl start epg

To see the status of EPG collection, this command will show you when
the next automatic EPG collection will be done:

systemctl status epg.timer

and this will show you the result of the last EPG run:

systemctl status epg

and this will show you the full output from epg.service, including the
full output of do_mhegepgsnoop.sh, mhegepgsnoop.py, xmltv-proc-nz and
mythfilldatabase:

journalctl -eu epg

You will be in a "less" command showing the end of the systemd journal
for epg.service - page up to see more.

Should you want to check it, the last downloaded EPG will always be
stored here:

/home/mythtv/.mythtv/freeview.xml

This is the version after xmltv-proc-nz processing. If you also want
to keep a copy of the raw MHEG5 data as downloaded, edit
do_mhegepgsnoop and change the TEMP_FILE= line to:

TEMP_FILE=/home/mythtv/.mythtv/freeview-raw.xml

Or you can just look at the /tmp/xmltv.xml file (if you have not
rebooted since EPG was last run.

I do not have a system I can test the above on, so please let me know
if I have done a typo somewhere or if something does not work.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
This looks very thorough Stephen. ThanksI will let you know how I get on (but it might not be for a few days.
Re: No EPG - need temp solution [ In reply to ]
I think that after following Stephen's instructions I am nearly there
but I get the following when I run

*journalctl -eu epg*

Apr 16 11:27:27 FishMyth systemd[1]: Started Get MHEG5 EPG for MythTV.
Apr 16 11:27:27 FishMyth bash[4232]: Try 1, running mhegepgsnoop.py now
Apr 16 11:27:27 FishMyth bash[4234]: Options selected =
Namespace(UTC=False, both=True, clean_titles=False,
demux_device='/dev/dvb/adapter0/>
Apr 16 11:27:27 FishMyth bash[4234]: Getting channel info from MythTV
database using Python bindings
Apr 16 11:27:30 FishMyth bash[4234]: Cannot find home directory to write to
Apr 16 11:27:30 FishMyth bash[4234]: Error accessing mythconverg
database using Python bindings.  Exiting.
Apr 16 11:27:30 FishMyth bash[4258]: rm: cannot remove '/tmp/xmltv.xml':
No such file or directory
Apr 16 11:27:30 FishMyth bash[4232]: Warning: mhegepgsnoop failed
(retval=1), retrying after sleep 5m

I suspect that I might need to edit a few files.

On 14/04/22 23:02, Stephen Worthington wrote:
> To test if it is working, or if you ever want to run EPG collection
> manually for some reason, do this:
>
> sudo systemctl start epg
>
> To see the status of EPG collection, this command will show you when
> the next automatic EPG collection will be done:
>
> systemctl status epg.timer
>
> and this will show you the result of the last EPG run:
>
> systemctl status epg
>
> and this will show you the full output from epg.service, including the
> full output of do_mhegepgsnoop.sh, mhegepgsnoop.py, xmltv-proc-nz and
> mythfilldatabase:
>
> journalctl -eu epg
>
> You will be in a "less" command showing the end of the systemd journal
> for epg.service - page up to see more.
>
> Should you want to check it, the last downloaded EPG will always be
> stored here:
>
> /home/mythtv/.mythtv/freeview.xml
>
> This is the version after xmltv-proc-nz processing. If you also want
> to keep a copy of the raw MHEG5 data as downloaded, edit
> do_mhegepgsnoop and change the TEMP_FILE= line to:
>
> TEMP_FILE=/home/mythtv/.mythtv/freeview-raw.xml
>
> Or you can just look at the /tmp/xmltv.xml file (if you have not
> rebooted since EPG was last run.
>
> I do not have a system I can test the above on, so please let me know
> if I have done a typo somewhere or if something does not work.
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archiveshttp://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
OUTPUT_FILE=/home/mythtv/.mythtv/

This directory does exist

On 16/04/22 11:44, Robert Fisher wrote:
>
> I think that after following Stephen's instructions I am nearly there
> but I get the following when I run
>
> *journalctl -eu epg*
>
> Apr 16 11:27:27 FishMyth systemd[1]: Started Get MHEG5 EPG for MythTV.
> Apr 16 11:27:27 FishMyth bash[4232]: Try 1, running mhegepgsnoop.py now
> Apr 16 11:27:27 FishMyth bash[4234]: Options selected =
> Namespace(UTC=False, both=True, clean_titles=False,
> demux_device='/dev/dvb/adapter0/>
> Apr 16 11:27:27 FishMyth bash[4234]: Getting channel info from MythTV
> database using Python bindings
> Apr 16 11:27:30 FishMyth bash[4234]: Cannot find home directory to
> write to
> Apr 16 11:27:30 FishMyth bash[4234]: Error accessing mythconverg
> database using Python bindings.  Exiting.
> Apr 16 11:27:30 FishMyth bash[4258]: rm: cannot remove
> '/tmp/xmltv.xml': No such file or directory
> Apr 16 11:27:30 FishMyth bash[4232]: Warning: mhegepgsnoop failed
> (retval=1), retrying after sleep 5m
>
> I suspect that I might need to edit a few files.
>
>
Re: No EPG - need temp solution [ In reply to ]
On Sat, 16 Apr 2022 11:44:54 +1200, you wrote:

>I think that after following Stephen's instructions I am nearly there
>but I get the following when I run
>
>*journalctl -eu epg*
>
>Apr 16 11:27:27 FishMyth systemd[1]: Started Get MHEG5 EPG for MythTV.
>Apr 16 11:27:27 FishMyth bash[4232]: Try 1, running mhegepgsnoop.py now
>Apr 16 11:27:27 FishMyth bash[4234]: Options selected =
>Namespace(UTC=False, both=True, clean_titles=False,
>demux_device='/dev/dvb/adapter0/>
>Apr 16 11:27:27 FishMyth bash[4234]: Getting channel info from MythTV
>database using Python bindings
>Apr 16 11:27:30 FishMyth bash[4234]: Cannot find home directory to write to
>Apr 16 11:27:30 FishMyth bash[4234]: Error accessing mythconverg
>database using Python bindings.  Exiting.
>Apr 16 11:27:30 FishMyth bash[4258]: rm: cannot remove '/tmp/xmltv.xml':
>No such file or directory
>Apr 16 11:27:30 FishMyth bash[4232]: Warning: mhegepgsnoop failed
>(retval=1), retrying after sleep 5m
>
>I suspect that I might need to edit a few files.

The problem is that mhegepgsnoop is not able to access the database -
it is not finding the config.xml file. The code for doing that is in
the MythTV Python bindings, rather than mhegepgsnoop.py. It should be
looking in /etc/mythtv for that, but it seems that it is not - it is
looking for $(HOME)/.mythtv/config.xml, even though it is being run as
root. And it just happens that on the systems I was testing it on,
/root/.mythtv/config.xml exists, so I did not notice the problem.
Since the problem is in the bindings, I can not fix it directly. Maybe
I could subclass the Python bindings and override the location when it
is being run from root, but that is dependent on the internals of the
Python bindings, so is probably not the best way to do it.
Fortunately, an easy workaround fixes it: create
/root/.mythtv/config.xml as a link to /etc/mythtv/config.xml:

sudo su
cd /root
mkdir .mythtv
rm config.xml
cd .mythtv
ln -s /etc/mythtv/config.xml
exit

If there are any error messages on the mkdir or rm commands above,
ignore them - it probably just means that at some point you have run
mythtv-setup from root instead of the usual mythtv user and
/root/.mythtv exists already.

I have also noticed a stupid typo in do_mhegegpgsnoop3.sh - I missed
out the | between the "cat" and "xmltv-proc-nz" commands. This is not
fatal, but it does mean that xmltv-proc-nz is not being run on the
data and the EPG will not have all the fixes it does, including
getting rid of the "New" and "All new" prefixes. So please
re-download the fixed do_mhegepgsnoop3.sh, mv and edit it again as per
the original instructions.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
On Sat, 16 Apr 2022 15:59:42 +1200, you wrote:

>sudo su
>cd /root
>mkdir .mythtv
>rm config.xml
>cd .mythtv
>ln -s /etc/mythtv/config.xml
>exit

Oops, the rm is in the wrong place, try this:

sudo su
cd /root
mkdir .mythtv
cd .mythtv
rm config.xml
ln -s /etc/mythtv/config.xml
exit

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
I still get this:-

robert@FishMyth:~$ systemctl status epg
? epg.service - Get MHEG5 EPG for MythTV
     Loaded: loaded (/etc/systemd/system/epg.service; disabled; vendor
preset: enabled)
     Active: active (running) since Mon 2022-04-18 16:21:28 NZST; 6min ago
TriggeredBy: ? epg.timer
   Main PID: 3558 (do_mhegepgsnoop)
      Tasks: 2 (limit: 4508)
     Memory: 5.2M
     CGroup: /system.slice/epg.service
             ??3558 /bin/bash /usr/local/bin/do_mhegepgsnoop.sh
             ??3850 sleep 5m

Apr 18 16:21:30 FishMyth bash[3568]: Error accessing mythconverg
database using Python bindings.  Exiting.
Apr 18 16:21:30 FishMyth bash[3584]: rm: cannot remove '/tmp/xmltv.xml':
No such file or directory
Apr 18 16:21:30 FishMyth bash[3558]: Warning: mhegepgsnoop failed
(retval=1), retrying after sleep 5m
Apr 18 16:26:30 FishMyth bash[3558]: Try 2, running mhegepgsnoop.py now
Apr 18 16:26:30 FishMyth bash[3845]: Options selected =
Namespace(UTC=False, both=True, clean_titles=False, demux_device='/dev/dvb/>
Apr 18 16:26:30 FishMyth bash[3845]: Getting channel info from MythTV
database using Python bindings
Apr 18 16:26:32 FishMyth bash[3845]: Cannot find home directory to write to
Apr 18 16:26:32 FishMyth bash[3845]: Error accessing mythconverg
database using Python bindings.  Exiting.
Apr 18 16:26:32 FishMyth bash[3849]: rm: cannot remove '/tmp/xmltv.xml':
No such file or directory
Apr 18 16:26:32 FishMyth bash[3558]: Warning: mhegepgsnoop failed
(retval=1), retrying after sleep 5m
lines 1-21/21 (END)

On 16/04/22 16:07, Stephen Worthington wrote:
> Oops, the rm is in the wrong place, try this:
>
> sudo su
> cd /root
> mkdir .mythtv
> cd .mythtv
> rm config.xml
> ln -s /etc/mythtv/config.xml
> exit
>

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
On Mon, 18 Apr 2022 16:33:48 +1200, you wrote:

>I still get this:-
>
>robert@FishMyth:~$ systemctl status epg
>? epg.service - Get MHEG5 EPG for MythTV
>      Loaded: loaded (/etc/systemd/system/epg.service; disabled; vendor
>preset: enabled)
>      Active: active (running) since Mon 2022-04-18 16:21:28 NZST; 6min ago
>TriggeredBy: ? epg.timer
>    Main PID: 3558 (do_mhegepgsnoop)
>       Tasks: 2 (limit: 4508)
>      Memory: 5.2M
>      CGroup: /system.slice/epg.service
>              ??3558 /bin/bash /usr/local/bin/do_mhegepgsnoop.sh
>              ??3850 sleep 5m
>
>Apr 18 16:21:30 FishMyth bash[3568]: Error accessing mythconverg
>database using Python bindings.  Exiting.
>Apr 18 16:21:30 FishMyth bash[3584]: rm: cannot remove '/tmp/xmltv.xml':
>No such file or directory
>Apr 18 16:21:30 FishMyth bash[3558]: Warning: mhegepgsnoop failed
>(retval=1), retrying after sleep 5m
>Apr 18 16:26:30 FishMyth bash[3558]: Try 2, running mhegepgsnoop.py now
>Apr 18 16:26:30 FishMyth bash[3845]: Options selected =
>Namespace(UTC=False, both=True, clean_titles=False, demux_device='/dev/dvb/>
>Apr 18 16:26:30 FishMyth bash[3845]: Getting channel info from MythTV
>database using Python bindings
>Apr 18 16:26:32 FishMyth bash[3845]: Cannot find home directory to write to
>Apr 18 16:26:32 FishMyth bash[3845]: Error accessing mythconverg
>database using Python bindings.  Exiting.
>Apr 18 16:26:32 FishMyth bash[3849]: rm: cannot remove '/tmp/xmltv.xml':
>No such file or directory
>Apr 18 16:26:32 FishMyth bash[3558]: Warning: mhegepgsnoop failed
>(retval=1), retrying after sleep 5m
>lines 1-21/21 (END)

It is still not finding the config.xml. There is a way of telling
MythTV programs specifically where to look, so please add these two
lines to your do_mhegepgsnoop.py file at the end of the configuration
settings at the top of the file (after #MAP_FILE=)

# Force a specific location for finding the MythTV configuration.
MYTHCONFDIR=/etc/mythtv

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
On Mon, 18 Apr 2022 18:43:58 +1200, you wrote:

>It is still not finding the config.xml. There is a way of telling
>MythTV programs specifically where to look, so please add these two
>lines to your do_mhegepgsnoop.py file at the end of the configuration
>settings at the top of the file (after #MAP_FILE=)
>
># Force a specific location for finding the MythTV configuration.
>MYTHCONFDIR=/etc/mythtv

And check that /etc/mythtv/config.xml is present and valid, and is
readable by all.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
It looks like it is not finding a "valid" config.xml

When I ran locate -i config.xml I only found files created before I
started setting up your grabber:-

root@FishMyth:/etc/mythtv# ls -la

-rw-rw----   1 mythtv   mythtv   509 Apr 12 16:52 config.xml

root@FishMyth:/home/robert/.mythtv# ls -la

lrwxrwxrwx  1 robert sudo     22 Aug 26  2019 config.xml ->
/etc/mythtv/config.xml

root@FishMyth:~/.mythtv# ls -la

root@FishMyth:/usr/share/mythtv# ls -la

-rw-r--r--   1 root root   514 Apr 12 12:32 config.xml

Should I delete or rename the old files and run through your setup again?


On 18/04/22 21:01, Stephen Worthington wrote:
> On Mon, 18 Apr 2022 18:43:58 +1200, you wrote:
>
>> It is still not finding the config.xml. There is a way of telling
>> MythTV programs specifically where to look, so please add these two
>> lines to your do_mhegepgsnoop.py file at the end of the configuration
>> settings at the top of the file (after #MAP_FILE=)
>>
>> # Force a specific location for finding the MythTV configuration.
>> MYTHCONFDIR=/etc/mythtv
> And check that /etc/mythtv/config.xml is present and valid, and is
> readable by all.
>

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
On Tue, 19 Apr 2022 09:38:27 +1200, you wrote:

>It looks like it is not finding a "valid" config.xml
>
>When I ran locate -i config.xml I only found files created before I
>started setting up your grabber:-
>
>root@FishMyth:/etc/mythtv# ls -la
>
>-rw-rw----   1 mythtv   mythtv   509 Apr 12 16:52 config.xml
>
>root@FishMyth:/home/robert/.mythtv# ls -la
>
>lrwxrwxrwx  1 robert sudo     22 Aug 26  2019 config.xml ->
>/etc/mythtv/config.xml
>
>root@FishMyth:~/.mythtv# ls -la
>
>root@FishMyth:/usr/share/mythtv# ls -la
>
>-rw-r--r--   1 root root   514 Apr 12 12:32 config.xml
>
>Should I delete or rename the old files and run through your setup again?

It is possible that the format of your config.xml files is not quite
right - especially if they have been around for many versions of
MythTV and are still in the old format. The format had a major change
many versions of MythTV ago, and while the old format is supposed to
still be accepted, I have had problems with that.

The correct modern format is in the example file:

/usr/share/mythtv/config.xml

As well as what is in there, there may also be a UPnP section which I
think gets added by mythfrontend if the UPnP options are enabled.
There are lots of bits of MythTV that will just create a new
config.xml file if they do not find one, and I think that includes the
Python bindings. So they can get created when you do not expect it.

I would recommend renaming your /etc/mythtv/config.xml file (eg to
config.xml.old) and taking a copy of the /usr/share/mythtv/config.xml
file and editing it to put in your database password. For config.xml
files on the backend machine, the Host field should be set to
"localhost" (I think 127.0.0.1 also works, but I am not sure about ::1
for IPv6). When MythTV software sees localhost, it uses a Unix socket
connection instead of actually connecting via the TCP/IP stack to
localhost. Using a socket is significantly faster. On machines other
than the backend, the Host field needs to use an IP address or DNS
name of the backend machine. Set the PingHost option to 0 when using
localhost. For non-backend machines, it is probably best to have
PingHost set to 1. The normal ownership of /etc/mythtv/config.xml is
"chown www-data:mythtv" and the permissions "chmod u=rw,g=rw". The
reason for the "www-data" ownership is probably to allow PHP access
for running mythweb. If there is a UPnP section, copy that to the new
config.xml. But check that it follows the new format. Here is an
example from one of my config.xml files:

<Configuration>
<UPnP>
<UDN>
<MediaRenderer>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</MediaRenderer>
</UDN>
</UPnP>
<Database>
<UserName>mythtv</UserName>
<PingHost>0</PingHost>
<Host>localhost</Host>
<DatabaseName>mythconverg</DatabaseName>
<Password>xxxxxxxxxxxx</Password>
<Port>3306</Port>
</Database>
<WakeOnLan>
<Enabled>0</Enabled>
<SQLReconnectWaitTime>0</SQLReconnectWaitTime>
<SQLConnectRetry>5</SQLConnectRetry>
<Command>echo 'WOLsqlServerCommand not set'</Command>
</WakeOnLan>
</Configuration>

Once you have created the new config.xml, in /etc/mythtv, you can just
create links to it from anywhere else you need it.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: No EPG - need temp solution [ In reply to ]
> Does anyone have a generic EPG file they can send me I can manually import
> with mythfilldatabase that covers the next week or so, so I'm still alive
> on Friday morning!!

Mythweb to the rescue - did a manual schedule so I survived ;)

Same again for the next couple of weeks then I can afford to mess up the
scanning etc (or just export the DB, install a new OS, import & then
upgrade Myth)


--
Robin Gilks


_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/