I now have a 14D EPG. It took a while to find all the information as it was scattered across several threads/posts so the following is my attempt to bring it all together in case others want to try it.
Note though this is specific to my requirements (14D EPG for UK FTA via Astra 28E using Windows 10) I hope there's enough detail to enable changes to be made for different sources/channels etc.
The 1st step is to source the EPG data. Thanks to JonMMM's posting above I've used mc2xml. Use the link to download mc2xml and to read the usage instructions.
As the windows version of mc2xml.exe doesn't need installing I placed it in its own folder (D:\EPE) which acts as the working folder to hold the files it creates.
Now run mc2xml to set the inital configuration (this only needs to be done once).
The first screen displayed is to select the EPG source - I used tvguide.co.uk (the country code should default to GB). Make sure the following options are selected
-U UTF8
-u UTC
-F Chan name first
Click on OK then choose the channel lineup that best represents your provider/region, I used Sky HD London and after clicking on OK, mc2xml will run using its built in defaults to pull 7 days data into a file called xmltv.xml.
To get 14D EPG you need to pass a parameter when calling mc2xml so in the working folder I created a batch file (EPE_Grab.bat) containing the following
D:\EPG\mc2xml.exe -d 336
D:\EPG\ is my location for mc2xml.exe and -d 336 is the parameter to specify the number of hrs of data to grab (336 = 14 days). If you look at the mc2xml usage instructions you will see other parameters you can pass when running the prog. For example, I added to my .bat file -o D:\EPG\EPGDATA.xml to redirect the output from the default xmltv.xml file to EPGDATA.xml
Run the bat file to get the 14d epg data (if you see some error messages about missing data its likely that the number of hrs being grabbed is greater than the number of hours available in the EPG data source - it can be ignored) then copy the resulting file to a directory on the Sat box - for convenience I put it into /etc/epgimport which is a folder used by EPGimport.
The 2nd step is create a custom.sources.xml file which will tell EPGimport where to find the EPG data and the location of a custom.channels.xml file which holds the channel mapping (see step 3). This file needs to be in /etc/epgimport/ and contain the following:
<?xml version="1.0" encoding="UTF-8"?>
<sources>
<sourcecat sourcecatname="AAAA">
<source type="gen_xmltv" channels="custom.channels.xml">
<description>BBBB</description>
<url>CCCC</url>
</source>
</sourcecat>
</sources>
Where:
AAAA = top level name that will be displayed in the EPGimport sources
BBBB = is the name displayed next to source selection check box.
CCCC = is the location & name of EPG Data file to use ie /etc/epgimport/EPGDATA.xml
The last step is to create the custom.channels.xml in /etc/epgimport/ which contains the mapping between the channel identifier(s) used by the EPG provider in the EPGDATA data file and the corresponding service reference which the box uses to tune to the channel. The format of the file is:
<?xml version="1.0" encoding="latin-1"?>
<channels>
<channel id="XXXX">1:0:19:3ED:A:1:FFFF0000:0:0:0:</channel>
<channel id="YYYY">1:0:19:3XX:A:1:FFFF0000:0:0:0:</channel>
</channels>
where
XXXX & YYYY are the channel identifiers in the EPGDATA
>1:0:19.... etc are the service references the box uses for each channel.
Unfortunately this is the tedious bit as you need to match the Enigma service reference with each channel identifier in the EPG data file and it looks like Enigma2 does not hold the service ref and channel name together in one place. The service ref looks to be in the bouquets and uses a Hex string (ie 3ED above) to link to the channel name in held in Lamedb5. There are tools like DreamboxEdit and E-channelizer which can display the service ref for each channel but the free versions don't allow bulk copy/exporting of the refs to a file that you can use as starting point for the custom.channels.xml so you need to copy/paste. An alternative (particularly if you have a lot of channels to deal with) is to work with the Enigma files directly and try to "semi-automate" the process. Though the exact approach will depend on your skill set and tools available, the "process flow" would look like:
1. Open/view the EPG data file and note/get the channel identifier & channel name for each of the channels of interest in the EPG data (the "Channel" section is the first part of the EPG Data file)
eg - <channel id="I101.713.tvguide.co.uk">
<display-name>BBC One London</display-name>
2. Use DreamboxEdit or E-channelizer to display the service ref for that channel.
OR (if "automating" and you want to pull the data directly from the Enigma files)
a. Open/view \etc\enigma2\lamedb5, find the row matching the channel name and note/get the hex characters following the "s:" (you may have rows starting with "t:" which I beleive are for terrestrial channels)
ie for BBC One London
s:189d:011a0000:07fd:0002:1:0:0,"BBC One Lon",p:BSkyB
The hex characters to note would be 189d
b. Open/view the "main" bouquet file in \etc\enigma2\ (mine was called userbouquet.abm.sat_282_sky_uk.main.tv) and note/get the row containing the hex characters from step a.
ie for 189d above the corresponding row in my bouquet file was
#SERVICE 1:0:1:189d:7fd:2:11a0000:0:0:0:
The string of characters after the #SERVICE is the service reference for that channel.
3. Create, then populate the custom.channels.xml file using the channel id from step 1 and the corresponding service ref from step 2.
ie the above examples would give the line
<channel id="I101.713.tvguide.co.uk">1:0:1:189d:7fd:2:11a0000:0:0:0:</channel>
As I'm familiar with Excel, I used Notepad to open each of the files, copy/pasted the contents into an Excel workbook then used Excel's Find/Replace/Lookup functions etc. to create a sheet containing the all the required rows in the right format to copy/paste into the custom.channels.xml.
When all the files are created and in place, open EPGimport. Use the blue button to view the sources and you should see an entry matching whatever you used in place of AAAA above, expand that entry and you should see your version of BBBB above with a checkbox next to it. Select it and as a test use the yellow button to manually import the highlighted entry. All being well you should see the data being loaded into the EPG. Open the EPG and page forward 8-9 days and you should see program data for the channels in the EPGDATA file.
Note that EPGimport loads data in the order that it appears in the sources. If you are using one or more Rytec files in addition to the 14D EPG data file and there are any Channel/program duplicates between the two data sets, the last loaded file takes precedence.
Once you are happy that everything works you can either stick with a manual process or look at automating the EPG refresh etc.