<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.opendigitalradio.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nickpiggott</id>
	<title>OpenDigitalRadio - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.opendigitalradio.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nickpiggott"/>
	<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/Special:Contributions/Nickpiggott"/>
	<updated>2026-04-08T09:08:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1581</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1581"/>
		<updated>2024-08-16T14:03:33Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
* Some Service Providers only allow access to the SI (&amp;amp; PI) files if you get a Client ID (like an API key) from them first. This ClientID is associated with their FQDN (fully qualified domain name). You can create a CSV format file which holds the fqdns and associated ClientIDs, which allows the generator to provide the ClientID when it&amp;#039;s asking for the SI &amp;amp; PI files.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/howto/&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-pip python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python3 setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -f odr-radioepg-bridge/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
   -c CLIENTIDS       filename of CSV file of fqdn,ClientID key values&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
* -c gives the filename of a CSV formatted file which contains Fully Qualified Domain Names (fqdns) and Client IDs. Some service providers will only allow access to their SI file with a Client ID. Contact them directly for a Client ID.&lt;br /&gt;
&lt;br /&gt;
   example.org,wkljew324cx&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1580</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1580"/>
		<updated>2024-04-08T16:06:51Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
* Some Service Providers only allow access to the SI (&amp;amp; PI) files if you get a Client ID (like an API key) from them first. This ClientID is associated with their FQDN (fully qualified domain name). You can create a CSV format file which holds the fqdns and associated ClientIDs, which allows the generator to provide the ClientID when it&amp;#039;s asking for the SI &amp;amp; PI files.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/howto/&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-pip python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python3 setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -f odr-radioepg-bridge/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
   -c CLIENTIDS       filename of CSV file of fqdn,ClientID key values&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
* -c gives the filename of a CSV formatted file which contains Fully Qualified Domain Names (fqdns) and Client IDs. Some service providers will only allow access to their SI file with a Client ID. Contact them directly for a Client ID.&lt;br /&gt;
   example:&lt;br /&gt;
   example.org,wkljew324cx&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1579</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1579"/>
		<updated>2024-04-08T16:05:05Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Generating your SPI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/howto/&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-pip python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python3 setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -f odr-radioepg-bridge/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
   -c CLIENTIDS       filename of CSV file of fqdn,ClientID key values&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
* -c gives the filename of a CSV formatted file which contains Fully Qualified Domain Names (fqdns) and Client IDs. Some service providers will only allow access to their SI file with a Client ID. Contact them directly for a Client ID.&lt;br /&gt;
   example:&lt;br /&gt;
   example.org,wkljew324cx&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=Main_Page&amp;diff=1578</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=Main_Page&amp;diff=1578"/>
		<updated>2023-05-27T12:54:57Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: Added link to SPI Generator&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size:282%&amp;quot;&amp;gt;Opendigitalradio.org&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BIG&amp;gt;&lt;br /&gt;
Open techniques for Digital Radio Broadcasting&lt;br /&gt;
&amp;lt;/BIG&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%; border-spacing:8px; margin:-8px -8px;&amp;quot;&lt;br /&gt;
|class=&amp;quot;MainPageBG&amp;quot; style=&amp;quot;width:100%; border:1px solid #ddcef2; background:#faf5ff; vertical-align:top; color:#000;&amp;quot;|&lt;br /&gt;
{| cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;width:100%; vertical-align:top; background:#faf5ff; color:#000&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#ddcef2; font-size:120%; font-weight:bold; border:1px solid #afa3bf; text-align:left; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;Background&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;color:#000;&amp;quot;|&lt;br /&gt;
Open digital broadcasting techniques based on software defined radio. Digital radio transmission and development must also become democratized for experimenters and small broadcasters. Opendigitalradio.org wiki is about creating a community for documenting and exchanging experimentations and gather information about existing small-scale DAB projects. Please read [[Introduction]] for more information.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[Association Opendigitalradio|Opendigitalradio is a non-profit association based in Switzerland]]&amp;#039;&amp;#039;&amp;#039; (page in french), offering also a broadcast infrastructure for temporary radio stations.&lt;br /&gt;
&lt;br /&gt;
This wiki is also the home of the &amp;#039;&amp;#039;&amp;#039;ODR-mmbTools&amp;#039;&amp;#039;&amp;#039;, the continuation of the CRC-mmbTools from [http://mmbtools.crc.ca CRC]. Please see [[Introduction on DAB/DAB+]]&lt;br /&gt;
&lt;br /&gt;
Have a look at the [http://opendigitalradio.github.io/mmbtools-doc/mmbtools.pdf guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[News|Older news]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%; border-spacing:8px; margin:-8px -8px;&amp;quot;&lt;br /&gt;
|class=&amp;quot;MainPageBG&amp;quot; style=&amp;quot;border:1px solid #cef2e0; background:#f5fffa; vertical-align:top; color:#000;&amp;quot;|&lt;br /&gt;
{| cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;width:100%; vertical-align:top; background:#f5fffa; color:#000&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#cef2e0; font-size:120%; font-weight:bold; border:1px solid #afa3bf; text-align:left; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;DAB/DAB+ transmission&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;color:#000;&amp;quot;|&lt;br /&gt;
[[Image:Logo mmb.png|right]]&lt;br /&gt;
*[[Introduction on DAB/DAB+]]&lt;br /&gt;
*[[DAB/DAB+ encoding]]: MPEG Layer II or HE-AAC encoding, slideshow encoding&lt;br /&gt;
*[[DAB multiplexing]]: putting together DAB/DAB+/DMB programs&lt;br /&gt;
*[[DAB modulation]]: create the baseband COFDM modulation&lt;br /&gt;
*[[DAB hardware]]: software radio peripheral, filtering, amplification&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;width:100%; vertical-align:top; background:#f5fffa; color:#000&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#cef2e0; font-size:120%; font-weight:bold; border:1px solid #afa3bf; text-align:left; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;Real cases, examples&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;color:#000;&amp;quot;|&lt;br /&gt;
&lt;br /&gt;
The ODR-mmbTools are used in several real-world 24/7 broadcasts, as shown on http://www.opendigitalradio.org/software&lt;br /&gt;
&lt;br /&gt;
A recipe for a low cost DAB transmission chain for local broadcasts based on the ODR-mmbTools is the [[RaspDAB]] description.&lt;br /&gt;
&lt;br /&gt;
Older presentations:&lt;br /&gt;
*[http://www.slideshare.net/radioradioradio/local-dab-broadcasting Presentation] and [[WorldDMB GA 2010 Open DAB demonstration|demonstration]] of the full open source DAB transmission solution at 2010 WorldDMB General Assembly in Belfast&lt;br /&gt;
*[[First licensed open dab transmission]] for Label Suisse Festival 17-19 September 2010 Lausanne.&lt;br /&gt;
*[[Demonstration of open source digital transmission chain at IBC]], Stand 10.D21 (EBU), 10-14 September 2010&lt;br /&gt;
*[[DAB scripts examples]]&lt;br /&gt;
*[[Installer scripts]] for &amp;#039;&amp;#039;&amp;#039;Debian&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*[[How to configure SPI (Service and Programme Information) for ODR-DabMux]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%; border-spacing:8px; margin:-8px -8px;&amp;quot;&lt;br /&gt;
|class=&amp;quot;MainPageBG&amp;quot; style=&amp;quot;border:1px solid #f2e0ce; background:#fffaf5; vertical-align:top; color:#000;&amp;quot;|&lt;br /&gt;
{| cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;width:100%; vertical-align:top; background:#fffaf5; color:#000&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#f2e0ce; font-size:120%; font-weight:bold; border:1px solid #afa3bf; text-align:left; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;Other digital systems, transmission and reception&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;color:#000;&amp;quot;|&lt;br /&gt;
*[[DAB reception]] (Openmokast and others)&lt;br /&gt;
*[[DAB measurement]] (measurement&amp;amp;monitoring tools, planning tools).&lt;br /&gt;
*[[DRM/DRM+ Digital Radio Mondiale]], digital radio system for AM bands (LW, MW and SW) and all VHF bands (FM band and others). &lt;br /&gt;
*[[FM RDS transmission]] (not really a digital system except RDS ;)&lt;br /&gt;
*[[Crazy techniques using a VGA card as radio peripheral]]&lt;br /&gt;
*[[Coverage planning]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%; border-spacing:8px; margin:-8px -8px;&amp;quot;&lt;br /&gt;
|class=&amp;quot;MainPageBG&amp;quot; style=&amp;quot;width:100%; border:1px solid #cedff2; background:#f5faff; vertical-align:top; color:#000;&amp;quot;|&lt;br /&gt;
{| cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;width:100%; vertical-align:top; background:#f5faff; color:#000&amp;quot;&lt;br /&gt;
! &amp;lt;h2 style=&amp;quot;margin:0; background:#cedff2; font-size:120%; font-weight:bold; border:1px solid #afa3bf; text-align:left; color:#000; padding:0.2em 0.4em;&amp;quot;&amp;gt;Contacts&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;color:#000;&amp;quot;|&lt;br /&gt;
Please follow the odr-mmbtools discussion on groups.io for bug reports, solutions and updates. See the webiste https://groups.io/g/odr-mmbtools how to subscribe. This is the follow up of the crc-mmbtools mailing list on googlegroups (https://groups.google.com/g/crc-mmbtools) , which is still available to check for solutions to older problems.&lt;br /&gt;
&lt;br /&gt;
Follow us on &amp;#039;&amp;#039;&amp;#039;Twitter&amp;#039;&amp;#039;&amp;#039;: http://twitter.com/opendigiradio to get informed, involved or for any questions. Find us [http://www.facebook.com/opendigitalradio also on &amp;#039;&amp;#039;&amp;#039;Facebook&amp;#039;&amp;#039;&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
Email: broadcast at opendigitalradio.org&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1577</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1577"/>
		<updated>2023-05-27T12:51:04Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: Update external link to RadioDNS HOWTO guides&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/howto/&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-pip python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python3 setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -f odr-radioepg-bridge/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1575</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1575"/>
		<updated>2022-04-28T07:02:19Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Step 8: odr-radioepg-bridge */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-pip python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python3 setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -f odr-radioepg-bridge/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1574</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1574"/>
		<updated>2022-04-03T13:27:27Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Step 5: pyradiodns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-pip python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python3 setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln odr-radioepg-bridge/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1573</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1573"/>
		<updated>2022-04-01T18:18:01Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-pip python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln odr-radioepg-bridge/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1572</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1572"/>
		<updated>2022-04-01T15:46:28Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo pip3 install .&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln odr-radioepg-bridge/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1571</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1571"/>
		<updated>2022-04-01T11:09:31Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Step 8: odr-radioepg-bridge */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln odr-radioepg-bridge/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1570</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1570"/>
		<updated>2022-04-01T08:03:10Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Step 0: Update your system */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -s odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1569</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1569"/>
		<updated>2022-04-01T08:02:10Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -s odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_install_odr-radioepg-bridge_in_Debian_Jessie&amp;diff=1568</id>
		<title>How to install odr-radioepg-bridge in Debian Jessie</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_install_odr-radioepg-bridge_in_Debian_Jessie&amp;diff=1568"/>
		<updated>2022-03-15T20:36:22Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: Nickpiggott moved page How to install odr-radioepg-bridge in Debian Jessie to How to configure SPI (Service and Programme Information) for ODR-DabMux: More appropriate title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[How to configure SPI (Service and Programme Information) for ODR-DabMux]]&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1567</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1567"/>
		<updated>2022-03-15T20:36:22Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: Nickpiggott moved page How to install odr-radioepg-bridge in Debian Jessie to How to configure SPI (Service and Programme Information) for ODR-DabMux: More appropriate title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies bitarray at &amp;#039;&amp;#039;exactly&amp;#039;&amp;#039; version 1.2.0. You should make sure that you only have this version installed in your python enivronment.&lt;br /&gt;
If it isn&amp;#039;t installed, you need to download, unpack, and manually install the package from https://pypi.org/simple/bitarray/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -s odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1566</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1566"/>
		<updated>2022-03-15T20:20:36Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-setuptools python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies bitarray at &amp;#039;&amp;#039;exactly&amp;#039;&amp;#039; version 1.2.0. You should make sure that you only have this version installed in your python enivronment.&lt;br /&gt;
If it isn&amp;#039;t installed, you need to download, unpack, and manually install the package from https://pypi.org/simple/bitarray/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -s odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1565</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1565"/>
		<updated>2022-03-15T20:17:26Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This guide assumes your default python envrionment is Python 3.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies bitarray at &amp;#039;&amp;#039;exactly&amp;#039;&amp;#039; version 1.2.0. You should make sure that you only have this version installed in your python enivronment.&lt;br /&gt;
If it isn&amp;#039;t installed, you need to download, unpack, and manually install the package from https://pypi.org/simple/bitarray/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -s odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1564</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1564"/>
		<updated>2022-03-15T20:16:41Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-crcmod python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies that dnspython must be at or greater than version 2.0 when used with python3. Most distributions ship with this version.&lt;br /&gt;
If the installer can&amp;#039;t find dnspython&amp;gt;=2.0, you need to download, unpack, and manually install the package from https://pypi.org/simple/dnspython/&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The installer specifies bitarray at &amp;#039;&amp;#039;exactly&amp;#039;&amp;#039; version 1.2.0. You should make sure that you only have this version installed in your python enivronment.&lt;br /&gt;
If it isn&amp;#039;t installed, you need to download, unpack, and manually install the package from https://pypi.org/simple/bitarray/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -s odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1563</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1563"/>
		<updated>2022-03-15T19:07:38Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-crcmod python3-bitarray python3-dateutil python3-isodate python3-pil git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -s odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1562</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1562"/>
		<updated>2022-03-15T10:57:59Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions (and edited to show installation for Python 3)&lt;br /&gt;
&lt;br /&gt;
This is now updated to run on Python 3. Instuctions on how to make it (mostly) run on Python 2 are below, but this is now deprecated.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed alongside Python 3.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python3-crcmod python3-bitarray python3-dateutil python3-isodate git&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed. Establish yourself in a suitable working directory (e.g. ~/src)&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmot&lt;br /&gt;
 cd python-dabmot&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-mot-epg&lt;br /&gt;
 cd python-mot-epg&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-dabmsc&lt;br /&gt;
 cd python-dabmsc&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/radiodns/pyradiodns&lt;br /&gt;
 cd pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radiodns-bridge&lt;br /&gt;
 cd odr-radiodns-bridge&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/python-hybridspi&lt;br /&gt;
 cd python-hybridspi&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/Opendigitalradio/odr-radioepg-bridge&lt;br /&gt;
 sudo ln -s odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;br /&gt;
* Updated on 15MAR22: Instructions are now for Python 3&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1558</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1558"/>
		<updated>2021-04-15T08:57:58Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Some observations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python-crcmod python-bitarray python-dateutil python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-pip&lt;br /&gt;
 pip install setuptools&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your SPI (EPG)===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi {&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you are using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo will ensure that you can update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it &amp;#039;&amp;#039;might&amp;#039;&amp;#039; not allow you to update your SPI without having to restart your MUX.&lt;br /&gt;
* If the SPI output file is &amp;#039;&amp;#039;rewritten&amp;#039;&amp;#039;, the new content will be picked up by ODR-DabMux automatically, and your SPI will immediately be updated. This will be the case if you use generate-epg to generate a new file directly upon the the old one.&lt;br /&gt;
* However, if the SPI output file is &amp;#039;&amp;#039;replaced&amp;#039;&amp;#039;, the new file will &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; be picked up by ODR-DabMux, until you restart it. This will be the case, if you generate a new file elsewhere (e.g. in a different folder or on another machine) and then &amp;#039;&amp;#039;copy&amp;#039;&amp;#039; it into where the old one is.&lt;br /&gt;
&lt;br /&gt;
To get around this, and be sure that you can always update your SPI, any way you want, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo spififo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/spififo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendspi.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/spififo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendspi.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendspi.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendspi]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendspi.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendspi.conf /etc/supervisor/conf.d/sendspi.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI, any way you want, without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Resolved on 12APR21: (Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.)&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1547</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1547"/>
		<updated>2020-07-24T15:01:50Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Updating your SPI automatically every day */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python-crcmod python-bitarray python-dateutil python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi{&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it will not allow you to update your SPI without having to restart your MUX. To get around this, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi{&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/spi&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1546</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1546"/>
		<updated>2020-07-24T15:00:02Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Updating your EPG automatically every day */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python-crcmod python-bitarray python-dateutil python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi{&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your SPI automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the SPI from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your SPI, it will not allow you to update your SPI without having to restart your MUX. To get around this, you can feed your SPI to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your SPI and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your SPI file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your SPI subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-spi{&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your SPI again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your SPI must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your SPI is sent to ODR-DabMux from the fifo, and you will now be able to update your SPI without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your SPI automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your SPI every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your SPI yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your SPI to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The SPI creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the SPI will be incomplete. The more frequently you update the SPI, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1545</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1545"/>
		<updated>2020-07-24T14:58:21Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Broadcasting your SPI*/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python-crcmod python-bitarray python-dateutil python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your SPI====&lt;br /&gt;
&lt;br /&gt;
To broadcast your SPI using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-spi{&lt;br /&gt;
 label &amp;quot;EPG &amp;amp; Logos&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPGLogos&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-spi {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for SPI.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section (if you are using version 3.1.1 or earlier of odr-dabmux)&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the SPI (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If you using version 3.1.2 or later of odr-dabmux, the construction of the component section is slightly different&lt;br /&gt;
&lt;br /&gt;
 comp-spi {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-spi&lt;br /&gt;
 subchannel sub-spi&lt;br /&gt;
 user-applications {&lt;br /&gt;
   userapp &amp;quot;spi&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your SPI should be transmitted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the EPG from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your EPG, it will not allow you to update your EPG without having to restart your MUX. To get around this, you can feed your EPG to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your EPG and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your EPG file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your EPG subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your EPG must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your EPG is sent to ODR-DabMux from the fifo, and you will now be able to update your EPG without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your EPG automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your EPG yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1544</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1544"/>
		<updated>2020-07-24T14:54:15Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Packet sizes and bitrates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python-crcmod python-bitarray python-dateutil python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your SPI, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your SPI will not be transmitted. If the packet size is too small, your SPI will (probably) be transmitted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the EPG from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your EPG, it will not allow you to update your EPG without having to restart your MUX. To get around this, you can feed your EPG to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your EPG and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your EPG file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your EPG subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your EPG must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your EPG is sent to ODR-DabMux from the fifo, and you will now be able to update your EPG without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your EPG automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your EPG yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1543</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1543"/>
		<updated>2020-07-24T14:53:45Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Generating your SPI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python-crcmod python-bitarray python-dateutil python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your SPI). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you SPI. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your SPI (see below).&lt;br /&gt;
* -a is the packet address for your SPI. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your SPI as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your SPI the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your SPI (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your SPI. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the EPG from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your EPG, it will not allow you to update your EPG without having to restart your MUX. To get around this, you can feed your EPG to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your EPG and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your EPG file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your EPG subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your EPG must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your EPG is sent to ODR-DabMux from the fifo, and you will now be able to update your EPG without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your EPG automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your EPG yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1542</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1542"/>
		<updated>2020-07-24T14:53:09Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Generating your SPI*/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python-crcmod python-bitarray python-dateutil python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your SPI====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete SPI.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your EPG as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your EPG the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the EPG from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your EPG, it will not allow you to update your EPG without having to restart your MUX. To get around this, you can feed your EPG to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your EPG and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your EPG file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your EPG subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your EPG must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your EPG is sent to ODR-DabMux from the fifo, and you will now be able to update your EPG without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your EPG automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your EPG yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1541</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1541"/>
		<updated>2020-07-24T14:52:12Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Step 1: Miscellaneous dependencies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install python-crcmod python-bitarray python-dateutil python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your EPG as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your EPG the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the EPG from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your EPG, it will not allow you to update your EPG without having to restart your MUX. To get around this, you can feed your EPG to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your EPG and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your EPG file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your EPG subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your EPG must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your EPG is sent to ODR-DabMux from the fifo, and you will now be able to update your EPG without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your EPG automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your EPG yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1540</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1540"/>
		<updated>2020-07-24T14:51:48Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Step 1: Miscellaneous dependencies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-dateutil&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your EPG as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your EPG the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the EPG from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your EPG, it will not allow you to update your EPG without having to restart your MUX. To get around this, you can feed your EPG to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your EPG and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your EPG file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your EPG subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your EPG must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your EPG is sent to ODR-DabMux from the fifo, and you will now be able to update your EPG without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your EPG automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your EPG yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1539</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1539"/>
		<updated>2020-07-24T14:51:41Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: moved the standard date/time Deb package up to that section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your EPG as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your EPG the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the EPG from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your EPG, it will not allow you to update your EPG without having to restart your MUX. To get around this, you can feed your EPG to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your EPG and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your EPG file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your EPG subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your EPG must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your EPG is sent to ODR-DabMux from the fifo, and you will now be able to update your EPG without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your EPG automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your EPG yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1538</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1538"/>
		<updated>2020-07-24T14:50:59Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the SPI must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-dateutil&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your EPG as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your EPG the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the EPG from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your EPG, it will not allow you to update your EPG without having to restart your MUX. To get around this, you can feed your EPG to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your EPG and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your EPG file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your EPG subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your EPG must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your EPG is sent to ODR-DabMux from the fifo, and you will now be able to update your EPG without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your EPG automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your EPG yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1537</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1537"/>
		<updated>2020-07-24T14:50:48Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie. Nick Piggott has contributed with some additions.&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB SPI from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* Confused about EPG and SPI? In this context, EPG and SPI are basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the EPG must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-dateutil&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: pyradiodns====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/radiodns/pyradiodns and unpack to a folder, e.g. /home/user/pyradiodns-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 8: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/Opendigitalradio/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS] [-D]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an SPI bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
   -D                 output Datagroups instead of Packets&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
* -D will tell the script to output Datagroups instead of Packets. This is useful for some commercial multiplexers or in case you want to broadcast your EPG as X-PAD instead of packet data. Note: You do not need this if you plan to broadcast your EPG the way it&amp;#039;s described on this wiki page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
====Feeding the EPG from a fifo to be able to update it without restarting the MUX====&lt;br /&gt;
&lt;br /&gt;
While the setup shown above will allow you to broadcast your EPG, it will not allow you to update your EPG without having to restart your MUX. To get around this, you can feed your EPG to ODR-DabMux from a named fifo instead of a file.&lt;br /&gt;
&lt;br /&gt;
Navigate to the folder where you have your EPG and create a fifo like this:&lt;br /&gt;
&lt;br /&gt;
 mkfifo epgfifo&lt;br /&gt;
&lt;br /&gt;
In the subchannel section of your mux.conf, you should replace your EPG file (output.dat) with your fifo, and also add a new line, &amp;quot;nonblock true&amp;quot;, so that your EPG subchannel looks like this:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/epgfifo&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 nonblock true&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
Your EPG must be continously sent to the fifo. You can make a shell script for that. Create a file, sendepg.sh, with this content:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
 while :&lt;br /&gt;
 do&lt;br /&gt;
  &lt;br /&gt;
 cat /home/user/odr-radioepg-bridge-master/output.dat &amp;gt;&amp;gt; /home/user/odr-radioepg-bridge-master/epgfifo&lt;br /&gt;
  &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And make it executable (chmod +x sendepg.sh).&lt;br /&gt;
&lt;br /&gt;
This script must be running all the time. If you&amp;#039;re already using Supervisor to keep your MUX running (as described here: https://github.com/Opendigitalradio/dab-scripts), it&amp;#039;s easy to also use supervisor for this script. Create a new file, sendepg.conf, in your /home/user/odr/config/supervisor folder with this content:&lt;br /&gt;
&lt;br /&gt;
 [program:sendepg]&lt;br /&gt;
 command=bash -c &amp;quot;/home/user/odr-radioepg-bridge-master/sendepg.sh&amp;quot;&lt;br /&gt;
 autostart=true&lt;br /&gt;
 autorestart=true&lt;br /&gt;
 startretries=99999&lt;br /&gt;
 priority=10&lt;br /&gt;
 stderr_logfile=/dev/stdout&lt;br /&gt;
 stdout_logfile=/dev/stdout&lt;br /&gt;
&lt;br /&gt;
Then run these commands:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /home/user/odr/config/supervisor/sendepg.conf /etc/supervisor/conf.d/sendepg.conf&lt;br /&gt;
 sudo supervisorctl reread&lt;br /&gt;
 sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
Now your EPG is sent to ODR-DabMux from the fifo, and you will now be able to update your EPG without having to restart ODR-DabMux.&lt;br /&gt;
&lt;br /&gt;
====Updating your EPG automatically every day====&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line (with the same parameters as when you generate your EPG yourself)&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr-radioepg-bridge-master/output.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (at least those up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1534</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1534"/>
		<updated>2020-07-14T16:31:51Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* Updating your EPG automatically every day */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB EPG from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* In this context, EPG and SPI is basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the EPG must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Important: &amp;#039;&amp;#039;&amp;#039;It MUST be this commit&amp;#039;&amp;#039;&amp;#039;, NOT the original one from GlobalRadio from 2017 (thanks to Nick Piggott for help figuring out this).&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-dateutil&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-pip&lt;br /&gt;
 sudo pip install hybridspi&lt;br /&gt;
 sudo pip install pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/magicbadger/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an EPG bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Assuming you have a ~/odr/epg folder, create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr/epg/epg_data.dat&lt;br /&gt;
&lt;br /&gt;
In your mux.conf you would use the lines&lt;br /&gt;
&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr/epg/epg_data.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
&lt;br /&gt;
to tell odr-dabmux where to read the EPG packet data from.&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr/epg/epg_data.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some problems and solutions===&lt;br /&gt;
&lt;br /&gt;
====Local variable &amp;#039;ecc&amp;#039; referenced before assignment====&lt;br /&gt;
&lt;br /&gt;
For some domains, lookup will cause the script to fail with error message &amp;quot;local variable &amp;#039;ecc&amp;#039; referenced before assignment&amp;quot; if the domain has no _radiotag._tcp SRV record.&lt;br /&gt;
&lt;br /&gt;
You can get around this by opening this file in a text editor:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/pyradiodns/rdns.py&lt;br /&gt;
and remove or comment out line 13 &amp;quot;(&amp;#039;radiotag&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If the domain is not using RadioVIS, you might also have to remove line 14 &amp;quot;(&amp;#039;radiovis&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;, but I haven&amp;#039;t experienced this myself.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;rdns.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed on a wrong date====&lt;br /&gt;
&lt;br /&gt;
I have observed that radio programmes beginning before noon (or all programmes on some receivers) were listed on a wrong date, one day before the correct date. My solution was to modify line 428 in this file:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
Here, &amp;quot;(timepoint.hour - 12)&amp;quot; should be changed to &amp;quot;timepoint.hour&amp;quot;, so that line 428 will be:&lt;br /&gt;
&lt;br /&gt;
 jd = jdn + timepoint.hour / 24 + timepoint.minute / 1440 + timepoint.second / 86400&lt;br /&gt;
&lt;br /&gt;
This should fix the daystamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed with wrong timestamps if your time zone is not UTC====&lt;br /&gt;
&lt;br /&gt;
I have observed that if the time zone is not UTC, all radio programmes were listed with wrong times. My solution was to make some modifications to this file:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
After line 419 (&amp;quot;bits.setall(False)&amp;quot;) I have added the following two lines:&lt;br /&gt;
&lt;br /&gt;
 offset = (timepoint.utcoffset().days * 86400 + timepoint.utcoffset().seconds) + (timepoint.dst().days * 86400 + timepoint.dst().days)&lt;br /&gt;
 timepoint=timepoint - timedelta(seconds=offset)&lt;br /&gt;
&lt;br /&gt;
(The first line is taken from line 457, from where it can then be removed)&lt;br /&gt;
&lt;br /&gt;
And after line 28 (&amp;quot;import sys&amp;quot;), I have added this line:&lt;br /&gt;
&lt;br /&gt;
 from datetime import timedelta&lt;br /&gt;
&lt;br /&gt;
This should fix the timestamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
===Other observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1533</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1533"/>
		<updated>2020-07-14T16:22:49Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: Explain how to run a daily cron job.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB EPG from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* In this context, EPG and SPI is basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the EPG must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Important: &amp;#039;&amp;#039;&amp;#039;It MUST be this commit&amp;#039;&amp;#039;&amp;#039;, NOT the original one from GlobalRadio from 2017 (thanks to Nick Piggott for help figuring out this).&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-dateutil&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-pip&lt;br /&gt;
 sudo pip install hybridspi&lt;br /&gt;
 sudo pip install pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/magicbadger/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an EPG bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
You can update your EPG every 24 hours by adding a new daily task to cron.&lt;br /&gt;
&lt;br /&gt;
Assuming you have a ~/odr/epg folder  Create a new file&lt;br /&gt;
&lt;br /&gt;
 /etc/cron.daily/epg&lt;br /&gt;
&lt;br /&gt;
with the single line&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr/epg/epg_data.dat&lt;br /&gt;
&lt;br /&gt;
In your mux.conf you would use the lines&lt;br /&gt;
&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr/epg/epg_data.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
&lt;br /&gt;
to tell odr-dabmux where to read the EPG packet data from.&lt;br /&gt;
&lt;br /&gt;
By default, the cron job will run every day at around 06:00. If you want your EPG to update more frequently (every 4 hours), you could add it to the user cron job with&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and add the line&lt;br /&gt;
&lt;br /&gt;
 0 */4 * * * /usr/local/bin/generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf -o /home/user/odr/epg/epg_data.dat&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The EPG creates new MOT TransportIDs for every object each time it is run. A receiver will not recognise that objects have been previously received and cached. If there is an interruption in reception, the EPG will be incomplete. The more frequently you update the EPG, more likely it is that a receiver will not be able to utilise the cached objects.&lt;br /&gt;
&lt;br /&gt;
===Some problems and solutions===&lt;br /&gt;
&lt;br /&gt;
====Local variable &amp;#039;ecc&amp;#039; referenced before assignment====&lt;br /&gt;
&lt;br /&gt;
For some domains, lookup will cause the script to fail with error message &amp;quot;local variable &amp;#039;ecc&amp;#039; referenced before assignment&amp;quot; if the domain has no _radiotag._tcp SRV record.&lt;br /&gt;
&lt;br /&gt;
You can get around this by opening this file in a text editor:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/pyradiodns/rdns.py&lt;br /&gt;
and remove or comment out line 13 &amp;quot;(&amp;#039;radiotag&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If the domain is not using RadioVIS, you might also have to remove line 14 &amp;quot;(&amp;#039;radiovis&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;, but I haven&amp;#039;t experienced this myself.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;rdns.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed on a wrong date====&lt;br /&gt;
&lt;br /&gt;
I have observed that radio programmes beginning before noon (or all programmes on some receivers) were listed on a wrong date, one day before the correct date. My solution was to modify line 428 in this file:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
Here, &amp;quot;(timepoint.hour - 12)&amp;quot; should be changed to &amp;quot;timepoint.hour&amp;quot;, so that line 428 will be:&lt;br /&gt;
&lt;br /&gt;
 jd = jdn + timepoint.hour / 24 + timepoint.minute / 1440 + timepoint.second / 86400&lt;br /&gt;
&lt;br /&gt;
This should fix the daystamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed with wrong timestamps if your time zone is not UTC====&lt;br /&gt;
&lt;br /&gt;
I have observed that if the time zone is not UTC, all radio programmes were listed with wrong times. My solution was to make some modifications to this file:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
After line 419 (&amp;quot;bits.setall(False)&amp;quot;) I have added the following two lines:&lt;br /&gt;
&lt;br /&gt;
 offset = (timepoint.utcoffset().days * 86400 + timepoint.utcoffset().seconds) + (timepoint.dst().days * 86400 + timepoint.dst().days)&lt;br /&gt;
 timepoint=timepoint - timedelta(seconds=offset)&lt;br /&gt;
&lt;br /&gt;
(The first line is taken from line 457, from where it can then be removed)&lt;br /&gt;
&lt;br /&gt;
And after line 28 (&amp;quot;import sys&amp;quot;), I have added this line:&lt;br /&gt;
&lt;br /&gt;
 from datetime import timedelta&lt;br /&gt;
&lt;br /&gt;
This should fix the timestamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
===Other observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1532</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1532"/>
		<updated>2020-07-14T16:11:44Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: Correct link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB EPG from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* In this context, EPG and SPI is basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the EPG must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at https://radiodns.org/technical/documentation/#howto&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Important: &amp;#039;&amp;#039;&amp;#039;It MUST be this commit&amp;#039;&amp;#039;&amp;#039;, NOT the original one from GlobalRadio from 2017 (thanks to Nick Piggott for help figuring out this).&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-dateutil&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-pip&lt;br /&gt;
 sudo pip install hybridspi&lt;br /&gt;
 sudo pip install pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/magicbadger/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an EPG bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
To be written....&lt;br /&gt;
&lt;br /&gt;
===Some problems and solutions===&lt;br /&gt;
&lt;br /&gt;
====Local variable &amp;#039;ecc&amp;#039; referenced before assignment====&lt;br /&gt;
&lt;br /&gt;
For some domains, lookup will cause the script to fail with error message &amp;quot;local variable &amp;#039;ecc&amp;#039; referenced before assignment&amp;quot; if the domain has no _radiotag._tcp SRV record.&lt;br /&gt;
&lt;br /&gt;
You can get around this by opening this file in a text editor:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/pyradiodns/rdns.py&lt;br /&gt;
and remove or comment out line 13 &amp;quot;(&amp;#039;radiotag&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If the domain is not using RadioVIS, you might also have to remove line 14 &amp;quot;(&amp;#039;radiovis&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;, but I haven&amp;#039;t experienced this myself.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;rdns.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed on a wrong date====&lt;br /&gt;
&lt;br /&gt;
I have observed that radio programmes beginning before noon (or all programmes on some receivers) were listed on a wrong date, one day before the correct date. My solution was to modify line 428 in this file:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
Here, &amp;quot;(timepoint.hour - 12)&amp;quot; should be changed to &amp;quot;timepoint.hour&amp;quot;, so that line 428 will be:&lt;br /&gt;
&lt;br /&gt;
 jd = jdn + timepoint.hour / 24 + timepoint.minute / 1440 + timepoint.second / 86400&lt;br /&gt;
&lt;br /&gt;
This should fix the daystamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed with wrong timestamps if your time zone is not UTC====&lt;br /&gt;
&lt;br /&gt;
I have observed that if the time zone is not UTC, all radio programmes were listed with wrong times. My solution was to make some modifications to this file:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
After line 419 (&amp;quot;bits.setall(False)&amp;quot;) I have added the following two lines:&lt;br /&gt;
&lt;br /&gt;
 offset = (timepoint.utcoffset().days * 86400 + timepoint.utcoffset().seconds) + (timepoint.dst().days * 86400 + timepoint.dst().days)&lt;br /&gt;
 timepoint=timepoint - timedelta(seconds=offset)&lt;br /&gt;
&lt;br /&gt;
(The first line is taken from line 457, from where it can then be removed)&lt;br /&gt;
&lt;br /&gt;
And after line 28 (&amp;quot;import sys&amp;quot;), I have added this line:&lt;br /&gt;
&lt;br /&gt;
 from datetime import timedelta&lt;br /&gt;
&lt;br /&gt;
This should fix the timestamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
===Other observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1531</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1531"/>
		<updated>2020-07-14T16:10:56Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: Extended explanation of how the bridge works by sourcing content using RadioDNS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB EPG from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* In this context, EPG and SPI is basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This tool uses RadioDNS to locate and acquire Service Information (SI.xml), Programme Information (PI.xml) and Logos.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Each station you want to add to the EPG must be registered in RadioDNS using the correct information (Ensemble ID, Service ID, Service Component ID), and have correctly formatted SI, PI and logo files in PNG format. Find out more at [radiodns.org](https://radiodns.org/technical/documentation/#howto)&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Important: &amp;#039;&amp;#039;&amp;#039;It MUST be this commit&amp;#039;&amp;#039;&amp;#039;, NOT the original one from GlobalRadio from 2017 (thanks to Nick Piggott for help figuring out this).&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-dateutil&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-pip&lt;br /&gt;
 sudo pip install hybridspi&lt;br /&gt;
 sudo pip install pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/magicbadger/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an EPG bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
To be written....&lt;br /&gt;
&lt;br /&gt;
===Some problems and solutions===&lt;br /&gt;
&lt;br /&gt;
====Local variable &amp;#039;ecc&amp;#039; referenced before assignment====&lt;br /&gt;
&lt;br /&gt;
For some domains, lookup will cause the script to fail with error message &amp;quot;local variable &amp;#039;ecc&amp;#039; referenced before assignment&amp;quot; if the domain has no _radiotag._tcp SRV record.&lt;br /&gt;
&lt;br /&gt;
You can get around this by opening this file in a text editor:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/pyradiodns/rdns.py&lt;br /&gt;
and remove or comment out line 13 &amp;quot;(&amp;#039;radiotag&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If the domain is not using RadioVIS, you might also have to remove line 14 &amp;quot;(&amp;#039;radiovis&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;, but I haven&amp;#039;t experienced this myself.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;rdns.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed on a wrong date====&lt;br /&gt;
&lt;br /&gt;
I have observed that radio programmes beginning before noon (or all programmes on some receivers) were listed on a wrong date, one day before the correct date. My solution was to modify line 428 in this file:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
Here, &amp;quot;(timepoint.hour - 12)&amp;quot; should be changed to &amp;quot;timepoint.hour&amp;quot;, so that line 428 will be:&lt;br /&gt;
&lt;br /&gt;
 jd = jdn + timepoint.hour / 24 + timepoint.minute / 1440 + timepoint.second / 86400&lt;br /&gt;
&lt;br /&gt;
This should fix the daystamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed with wrong timestamps if your time zone is not UTC====&lt;br /&gt;
&lt;br /&gt;
I have observed that if the time zone is not UTC, all radio programmes were listed with wrong times. My solution was to make some modifications to this file:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
After line 419 (&amp;quot;bits.setall(False)&amp;quot;) I have added the following two lines:&lt;br /&gt;
&lt;br /&gt;
 offset = (timepoint.utcoffset().days * 86400 + timepoint.utcoffset().seconds) + (timepoint.dst().days * 86400 + timepoint.dst().days)&lt;br /&gt;
 timepoint=timepoint - timedelta(seconds=offset)&lt;br /&gt;
&lt;br /&gt;
(The first line is taken from line 457, from where it can then be removed)&lt;br /&gt;
&lt;br /&gt;
And after line 28 (&amp;quot;import sys&amp;quot;), I have added this line:&lt;br /&gt;
&lt;br /&gt;
 from datetime import timedelta&lt;br /&gt;
&lt;br /&gt;
This should fix the timestamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
===Other observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1530</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1530"/>
		<updated>2020-07-14T16:07:24Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: Moved to /usr/local/bin per Debian guidelines&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB EPG from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* In this context, EPG and SPI is basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;You must already have a working EPG (SPI) for hybrid radio via radioDNS, before you can use this tool.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Important: &amp;#039;&amp;#039;&amp;#039;It MUST be this commit&amp;#039;&amp;#039;&amp;#039;, NOT the original one from GlobalRadio from 2017 (thanks to Nick Piggott for help figuring out this).&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-dateutil&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-pip&lt;br /&gt;
 sudo pip install hybridspi&lt;br /&gt;
 sudo pip install pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/magicbadger/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/local/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an EPG bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
To be written....&lt;br /&gt;
&lt;br /&gt;
===Some problems and solutions===&lt;br /&gt;
&lt;br /&gt;
====Local variable &amp;#039;ecc&amp;#039; referenced before assignment====&lt;br /&gt;
&lt;br /&gt;
For some domains, lookup will cause the script to fail with error message &amp;quot;local variable &amp;#039;ecc&amp;#039; referenced before assignment&amp;quot; if the domain has no _radiotag._tcp SRV record.&lt;br /&gt;
&lt;br /&gt;
You can get around this by opening this file in a text editor:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/pyradiodns/rdns.py&lt;br /&gt;
and remove or comment out line 13 &amp;quot;(&amp;#039;radiotag&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If the domain is not using RadioVIS, you might also have to remove line 14 &amp;quot;(&amp;#039;radiovis&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;, but I haven&amp;#039;t experienced this myself.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;rdns.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed on a wrong date====&lt;br /&gt;
&lt;br /&gt;
I have observed that radio programmes beginning before noon (or all programmes on some receivers) were listed on a wrong date, one day before the correct date. My solution was to modify line 428 in this file:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
Here, &amp;quot;(timepoint.hour - 12)&amp;quot; should be changed to &amp;quot;timepoint.hour&amp;quot;, so that line 428 will be:&lt;br /&gt;
&lt;br /&gt;
 jd = jdn + timepoint.hour / 24 + timepoint.minute / 1440 + timepoint.second / 86400&lt;br /&gt;
&lt;br /&gt;
This should fix the daystamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed with wrong timestamps if your time zone is not UTC====&lt;br /&gt;
&lt;br /&gt;
I have observed that if the time zone is not UTC, all radio programmes were listed with wrong times. My solution was to make some modifications to this file:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
After line 419 (&amp;quot;bits.setall(False)&amp;quot;) I have added the following two lines:&lt;br /&gt;
&lt;br /&gt;
 offset = (timepoint.utcoffset().days * 86400 + timepoint.utcoffset().seconds) + (timepoint.dst().days * 86400 + timepoint.dst().days)&lt;br /&gt;
 timepoint=timepoint - timedelta(seconds=offset)&lt;br /&gt;
&lt;br /&gt;
(The first line is taken from line 457, from where it can then be removed)&lt;br /&gt;
&lt;br /&gt;
And after line 28 (&amp;quot;import sys&amp;quot;), I have added this line:&lt;br /&gt;
&lt;br /&gt;
 from datetime import timedelta&lt;br /&gt;
&lt;br /&gt;
This should fix the timestamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
===Other observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1529</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1529"/>
		<updated>2020-07-14T16:06:42Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: Have added a setup.py file to that package&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB EPG from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* In this context, EPG and SPI is basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;You must already have a working EPG (SPI) for hybrid radio via radioDNS, before you can use this tool.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Important: &amp;#039;&amp;#039;&amp;#039;It MUST be this commit&amp;#039;&amp;#039;&amp;#039;, NOT the original one from GlobalRadio from 2017 (thanks to Nick Piggott for help figuring out this).&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-dateutil&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-pip&lt;br /&gt;
 sudo pip install hybridspi&lt;br /&gt;
 sudo pip install pyradiodns&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/magicbadger/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an EPG bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
To be written....&lt;br /&gt;
&lt;br /&gt;
===Some problems and solutions===&lt;br /&gt;
&lt;br /&gt;
====Local variable &amp;#039;ecc&amp;#039; referenced before assignment====&lt;br /&gt;
&lt;br /&gt;
For some domains, lookup will cause the script to fail with error message &amp;quot;local variable &amp;#039;ecc&amp;#039; referenced before assignment&amp;quot; if the domain has no _radiotag._tcp SRV record.&lt;br /&gt;
&lt;br /&gt;
You can get around this by opening this file in a text editor:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/pyradiodns/rdns.py&lt;br /&gt;
and remove or comment out line 13 &amp;quot;(&amp;#039;radiotag&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If the domain is not using RadioVIS, you might also have to remove line 14 &amp;quot;(&amp;#039;radiovis&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;, but I haven&amp;#039;t experienced this myself.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;rdns.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed on a wrong date====&lt;br /&gt;
&lt;br /&gt;
I have observed that radio programmes beginning before noon (or all programmes on some receivers) were listed on a wrong date, one day before the correct date. My solution was to modify line 428 in this file:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
Here, &amp;quot;(timepoint.hour - 12)&amp;quot; should be changed to &amp;quot;timepoint.hour&amp;quot;, so that line 428 will be:&lt;br /&gt;
&lt;br /&gt;
 jd = jdn + timepoint.hour / 24 + timepoint.minute / 1440 + timepoint.second / 86400&lt;br /&gt;
&lt;br /&gt;
This should fix the daystamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed with wrong timestamps if your time zone is not UTC====&lt;br /&gt;
&lt;br /&gt;
I have observed that if the time zone is not UTC, all radio programmes were listed with wrong times. My solution was to make some modifications to this file:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
After line 419 (&amp;quot;bits.setall(False)&amp;quot;) I have added the following two lines:&lt;br /&gt;
&lt;br /&gt;
 offset = (timepoint.utcoffset().days * 86400 + timepoint.utcoffset().seconds) + (timepoint.dst().days * 86400 + timepoint.dst().days)&lt;br /&gt;
 timepoint=timepoint - timedelta(seconds=offset)&lt;br /&gt;
&lt;br /&gt;
(The first line is taken from line 457, from where it can then be removed)&lt;br /&gt;
&lt;br /&gt;
And after line 28 (&amp;quot;import sys&amp;quot;), I have added this line:&lt;br /&gt;
&lt;br /&gt;
 from datetime import timedelta&lt;br /&gt;
&lt;br /&gt;
This should fix the timestamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
===Other observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1528</id>
		<title>How to configure SPI (Service and Programme Information) for ODR-DabMux</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=How_to_configure_SPI_(Service_and_Programme_Information)_for_ODR-DabMux&amp;diff=1528"/>
		<updated>2020-07-14T15:56:44Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: Not necessary to install the binary &amp;quot;decode&amp;quot; to use the bridge.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Howto by Ulrik Brinck on odr-radioepg-bridge installation on Debian Jessie&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This tool (or rather series of tools) will pick up your SPI (Service and Programme Information) from the internet via RadioDNS and generate a DAB EPG from it. It was written by Ben Poor and Nick Piggott. In this HowTo, I will describe how it can be installed on Debian Jessie. Some details might be slightly different on other Debian generations.&lt;br /&gt;
&lt;br /&gt;
* In this context, EPG and SPI is basically the same thing. While EPG (Electronic Programme Guide) is an old, but commonly well-known term, SPI (Service and Programme Information) is now the official name of this feature.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;You must already have a working EPG (SPI) for hybrid radio via radioDNS, before you can use this tool.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I have assumed that you are logged in to your Linux system as a standard user and have sudo installed on your system. If sudo is not installed, you can see here, how to install it on Debian Jessie:&lt;br /&gt;
https://www.geek17.com/en/content/debian-8-jessie-install-and-configure-sudo-25&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
====Step 0: Update your system====&lt;br /&gt;
Begin with &amp;quot;sudo apt-get update&amp;quot; to make sure that you can install all that you need.&lt;br /&gt;
&lt;br /&gt;
====Step 1: Miscellaneous dependencies====&lt;br /&gt;
First there are some dependencies to install with apt-get:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install python-crcmod&lt;br /&gt;
 sudo apt-get install python-bitarray&lt;br /&gt;
 sudo apt-get install python-isodate&lt;br /&gt;
&lt;br /&gt;
Next there are some dependencies and subcomponents which must be downloaded from github and installed:&lt;br /&gt;
&lt;br /&gt;
====Step 2: python-dabmot====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-dabmot and unpack to a folder, e.g. /home/user/python-dabmot-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 3: python-mot-epg====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/GlobalRadio/python-mot-epg and unpack to a folder, e.g. /home/user/python-mot-epg-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 4: python-msc====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/python-dabmsc and unpack to a folder, e.g. /home/user/python-dabmsc-master&lt;br /&gt;
&lt;br /&gt;
Important: &amp;#039;&amp;#039;&amp;#039;It MUST be this commit&amp;#039;&amp;#039;&amp;#039;, NOT the original one from GlobalRadio from 2017 (thanks to Nick Piggott for help figuring out this).&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-dateutil&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 5: odr-radiodns-bridge====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radiodns-bridge and unpack to a folder, e.g. /home/user/odr-radiodns-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo apt-get install python-pip&lt;br /&gt;
 sudo pip install hybridspi&lt;br /&gt;
 sudo pip install pyradiodns&lt;br /&gt;
&lt;br /&gt;
There is no setup.py file in this package, but you can create one yourself. Go to the /src subfolder (/home/user/odr-radiodns-bridge-master/src) and create a file, setup.py with this content:&lt;br /&gt;
&lt;br /&gt;
 from distutils.core import setup&lt;br /&gt;
 &lt;br /&gt;
 setup(&lt;br /&gt;
     name=&amp;#039;odr-radiodns-bridge&amp;#039;,&lt;br /&gt;
     version=&amp;#039;1.0&amp;#039;,&lt;br /&gt;
     packages=[&amp;#039;odr&amp;#039;, &amp;#039;odr.radiodns&amp;#039;],&lt;br /&gt;
     url=&amp;#039;https://github.com/nickpiggott/odr-radiodns-bridge&amp;#039;,&lt;br /&gt;
     license=&amp;#039;GNU Lesser General Public License 2.1&amp;#039;,&lt;br /&gt;
     author=&amp;#039;Nick Piggott&amp;#039;,&lt;br /&gt;
     author_email=&amp;#039;nick@piggott.eu&amp;#039;,&lt;br /&gt;
     description=&amp;#039;Tools to bridge RadioDNS applications into the OpenDigitalRadio environment&amp;#039;&lt;br /&gt;
 )&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 6: python-hybridspi====&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/magicbadger/python-hybridspi and unpack to a folder, e.g. /home/user/python-hybridspi-master&lt;br /&gt;
&lt;br /&gt;
Then navigate to the folder and run:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
====Step 7: odr-radioepg-bridge====&lt;br /&gt;
&lt;br /&gt;
And now for the RadioEPG-bridge itself.&lt;br /&gt;
&lt;br /&gt;
Download from here https://github.com/nickpiggott/odr-radioepg-bridge and unpack to a folder, e.g. /home/user/odr-radioepg-bridge-master&lt;br /&gt;
&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo ln -s /home/user/odr-radioepg-bridge-master/generate-epg /usr/bin/generate-epg&lt;br /&gt;
(If your folder is not /home/user/odr-radioepg-bridge-master, use your_path/generate-epg in the last command line above).&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You should now be able to run this command and see a help text:&lt;br /&gt;
 generate-epg -h&lt;br /&gt;
&lt;br /&gt;
===Generating and broadcasting your EPG===&lt;br /&gt;
&lt;br /&gt;
====Generating your EPG====&lt;br /&gt;
&lt;br /&gt;
Odr-radioepg-bridge is a command-line tool, which will:&lt;br /&gt;
* First read your mux.conf (from your ODR-DabMux configuration) to get information about your services.&lt;br /&gt;
* Then try to fetch SPI data for your services from the internet using RadioDNS.&lt;br /&gt;
* And lastly generate an output file containing a complete EPG.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;generate-epg -h&amp;quot; you will get a list of available command-line arguments:&lt;br /&gt;
&lt;br /&gt;
 usage: generate-epg [-h] [-o OUTPUT] [-X] [-d DAYS] [-p PACKET_SIZE]&lt;br /&gt;
                     [-a PACKET_ADDRESS]&lt;br /&gt;
                     f&lt;br /&gt;
 &lt;br /&gt;
 Encodes an EPG bitstream for services in a multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 positional arguments:&lt;br /&gt;
   f                  multiplex configuration file&lt;br /&gt;
 &lt;br /&gt;
 optional arguments:&lt;br /&gt;
   -h, --help         show this help message and exit&lt;br /&gt;
   -o OUTPUT          output bitstream file&lt;br /&gt;
   -X                 turn debug on&lt;br /&gt;
   -d DAYS            number of days ahead to encode schedule files&lt;br /&gt;
   -p PACKET_SIZE     Packet size in bytes&lt;br /&gt;
   -a PACKET_ADDRESS  Packet address&lt;br /&gt;
&lt;br /&gt;
The positional argument tells the tool where to find your mux.conf.&lt;br /&gt;
The other arguments are optional, and some default values will be used if you don&amp;#039;t set them:&lt;br /&gt;
&lt;br /&gt;
* -o can be used to set filename and path to your output file (your EPG). Default is output.dat, placed in the folder from where you run the tool.&lt;br /&gt;
* -d is the number of days of programme schedule you want in you EPG. From 1 til 4 days, default is 2.&lt;br /&gt;
* -p is packet size. Available values are 24, 48, 72 and 96. Default is 96. Which value you should use, depends on the bitrate in which you are broadcasting your EPG (see below).&lt;br /&gt;
* -a is the packet address for your EPG. Default is 1, which will normally be fine. Important is, that you must set the same address in your mux.conf (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
If your mux.conf is placed in /home/user/odr/config/mux.conf, and you want 4 days in your EPG (today and the next 3 days) and you want to broadcast it in 16 kbit/s, your command line could look like this:&lt;br /&gt;
&lt;br /&gt;
 generate-epg -d 4 -p 48 /home/user/odr/config/mux.conf&lt;br /&gt;
&lt;br /&gt;
This will generate a file named output.dat containing your EPG. In this example, I have set the packet size to 48, which is suitable for 16 kbit/s. I have not set the packet address, which means that the default value of 1 will be used.&lt;br /&gt;
&lt;br /&gt;
====Packet sizes and bitrates====&lt;br /&gt;
&lt;br /&gt;
The packet size, which you set when you generate your EPG, should match the bitrate in which you intend to broadcast it. If the packet size is too large, your EPG will not be broadcasted. If the packet size is too small, your EPG will (probably) be broadcasted, but it will be slower than necessary, because more space will be used for packet headers and maybe partly empty data packets. I will recommend these values:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bitrate&lt;br /&gt;
! Packet size&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
| 16&lt;br /&gt;
| 48&lt;br /&gt;
|-&lt;br /&gt;
| 24&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 32&lt;br /&gt;
| 96&lt;br /&gt;
|-&lt;br /&gt;
| 48&lt;br /&gt;
| 72&lt;br /&gt;
|-&lt;br /&gt;
| 64&lt;br /&gt;
| 96&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Broadcasting your EPG====&lt;br /&gt;
&lt;br /&gt;
To broadcast your EPG using ODR-DabMux, create a packet data service in your mux.conf like in this example:&lt;br /&gt;
&lt;br /&gt;
In the services section:&lt;br /&gt;
&lt;br /&gt;
 srv-epg {&lt;br /&gt;
 label &amp;quot;EPG&amp;quot;&lt;br /&gt;
 shortlabel &amp;quot;EPG&amp;quot;&lt;br /&gt;
 ; the service-ID consists of 8 hex digits for packet data services. Usually the first two digits will&lt;br /&gt;
 ; be the same as your ECC, and the third digit will be the same as the first digit in your Ensemble Id.&lt;br /&gt;
 id 0xe1912345&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In the subchannels section:&lt;br /&gt;
&lt;br /&gt;
 sub-epg {&lt;br /&gt;
 ; type packet or enhancedpacket can be used for EPG.&lt;br /&gt;
 type enhancedpacket&lt;br /&gt;
 ; if you change the bitrate, remember to also change the packet size accordingly (see above) and generate your EPG again.&lt;br /&gt;
 bitrate 16&lt;br /&gt;
 protection-profile EEP_A&lt;br /&gt;
 protection 3&lt;br /&gt;
 ; inputuri is the path and filename for your output file from generate-epg&lt;br /&gt;
 inputuri &amp;quot;/home/user/odr-radioepg-bridge-master/output.dat&amp;quot;&lt;br /&gt;
 inputproto file&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
And in the components section:&lt;br /&gt;
&lt;br /&gt;
 comp-epg {&lt;br /&gt;
 type 60&lt;br /&gt;
 service srv-epg&lt;br /&gt;
 subchannel sub-epg&lt;br /&gt;
 figtype 0x7&lt;br /&gt;
 ; The address must be the same as your packet address set when you generate the EPG (default value is 1).&lt;br /&gt;
 address 0x1&lt;br /&gt;
 datagroup true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. Now (re)start your ODR-DabMux, and your EPG should be broadcasted.&lt;br /&gt;
&lt;br /&gt;
===Updating your EPG automatically every day===&lt;br /&gt;
&lt;br /&gt;
To be written....&lt;br /&gt;
&lt;br /&gt;
===Some problems and solutions===&lt;br /&gt;
&lt;br /&gt;
====Local variable &amp;#039;ecc&amp;#039; referenced before assignment====&lt;br /&gt;
&lt;br /&gt;
For some domains, lookup will cause the script to fail with error message &amp;quot;local variable &amp;#039;ecc&amp;#039; referenced before assignment&amp;quot; if the domain has no _radiotag._tcp SRV record.&lt;br /&gt;
&lt;br /&gt;
You can get around this by opening this file in a text editor:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/pyradiodns/rdns.py&lt;br /&gt;
and remove or comment out line 13 &amp;quot;(&amp;#039;radiotag&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If the domain is not using RadioVIS, you might also have to remove line 14 &amp;quot;(&amp;#039;radiovis&amp;#039;, &amp;#039;TCP&amp;#039;),&amp;quot;, but I haven&amp;#039;t experienced this myself.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;rdns.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed on a wrong date====&lt;br /&gt;
&lt;br /&gt;
I have observed that radio programmes beginning before noon (or all programmes on some receivers) were listed on a wrong date, one day before the correct date. My solution was to modify line 428 in this file:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
Here, &amp;quot;(timepoint.hour - 12)&amp;quot; should be changed to &amp;quot;timepoint.hour&amp;quot;, so that line 428 will be:&lt;br /&gt;
&lt;br /&gt;
 jd = jdn + timepoint.hour / 24 + timepoint.minute / 1440 + timepoint.second / 86400&lt;br /&gt;
&lt;br /&gt;
This should fix the daystamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
====Radio programmes listed with wrong timestamps if your time zone is not UTC====&lt;br /&gt;
&lt;br /&gt;
I have observed that if the time zone is not UTC, all radio programmes were listed with wrong times. My solution was to make some modifications to this file:&lt;br /&gt;
 /usr/local/lib/python2.7/dist-packages/spi/binary/__init__py&lt;br /&gt;
&lt;br /&gt;
After line 419 (&amp;quot;bits.setall(False)&amp;quot;) I have added the following two lines:&lt;br /&gt;
&lt;br /&gt;
 offset = (timepoint.utcoffset().days * 86400 + timepoint.utcoffset().seconds) + (timepoint.dst().days * 86400 + timepoint.dst().days)&lt;br /&gt;
 timepoint=timepoint - timedelta(seconds=offset)&lt;br /&gt;
&lt;br /&gt;
(The first line is taken from line 457, from where it can then be removed)&lt;br /&gt;
&lt;br /&gt;
And after line 28 (&amp;quot;import sys&amp;quot;), I have added this line:&lt;br /&gt;
&lt;br /&gt;
 from datetime import timedelta&lt;br /&gt;
&lt;br /&gt;
This should fix the timestamp issue.&lt;br /&gt;
&lt;br /&gt;
Note: When you modify this file, you might have to remove &amp;#039;&amp;#039;&amp;#039;__init__.pyc&amp;#039;&amp;#039;&amp;#039; in the same folder to make sure that your changes are being used.&lt;br /&gt;
&lt;br /&gt;
===Other observations===&lt;br /&gt;
&lt;br /&gt;
* According to specs, logo slides in DAB EPG must be PNG. Although JPG is allowed in hybrid radio SPI, JPG logos will not be added to your DAB EPG. Be sure that your logos (up to 320x240) are PNG.&lt;br /&gt;
* Programme descriptions (shortDescription) seem to be processed but not shown. Perhaps we will have to look a little further into this.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
	<entry>
		<id>https://wiki.opendigitalradio.org/index.php?title=RaspDAB/Automate_operation_with_Supervisor&amp;diff=1454</id>
		<title>RaspDAB/Automate operation with Supervisor</title>
		<link rel="alternate" type="text/html" href="https://wiki.opendigitalradio.org/index.php?title=RaspDAB/Automate_operation_with_Supervisor&amp;diff=1454"/>
		<updated>2018-07-11T14:32:14Z</updated>

		<summary type="html">&lt;p&gt;Nickpiggott: /* The contents of the configuration file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installing Supervisor ==&lt;br /&gt;
&lt;br /&gt;
It is time to make the operation automatic, such that when you power up the Raspberry Pi it will start the encoders and the multiplexer and deliver a multiplexed stream to the EasyDAB board.&lt;br /&gt;
&lt;br /&gt;
To do so we use a software package called supervisor (extended information can be found at http://supervisord.org). We first need to install it with&lt;br /&gt;
&lt;br /&gt;
   $ sudo apt-get install supervisor&lt;br /&gt;
&lt;br /&gt;
This will probably also install python-meld3 as it needs that package to function correctly.&lt;br /&gt;
&lt;br /&gt;
== Supervisor configuration files folder ==&lt;br /&gt;
&lt;br /&gt;
In this manual we will put the supervisor configuration files in a folder config in the user&amp;#039;s home directory. If you want to put this elsewhere you need to make appropriate changes to the commands shown here. You can do this from a terminal window with&lt;br /&gt;
&lt;br /&gt;
   $ mkdir config&lt;br /&gt;
&lt;br /&gt;
or from the graphical file manager. In this folder we make 2 subfolders, supervisor and mux:&lt;br /&gt;
&lt;br /&gt;
   $ chdir config&lt;br /&gt;
   $ mkdir supervisor&lt;br /&gt;
   $ mkdir mux&lt;br /&gt;
&lt;br /&gt;
Again, you can also do this with the graphical filemanager.&lt;br /&gt;
&lt;br /&gt;
Now we can make the configuration file for program srv1 (the name is arbitrary, you can use your own names to make identification of the stations easy). Do this for all stations that you want include in the ensemble.&lt;br /&gt;
&lt;br /&gt;
== The contents of the configuration file ==&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s have a look at the configuration file for the encoders. The following are examples:&lt;br /&gt;
&lt;br /&gt;
   [program:enc-srv1]&lt;br /&gt;
   # DAB encoding using odr-audioenc&lt;br /&gt;
   command=/usr/local/bin/odr-audioenc -v [URL of audio stream] -C 200 -b 64 -r 48000 -c 2 -o tcp://localhost:59001 -D -L --audio-resampler=samplerate -L --src-converter-type=0 -p 58 -P /tmp/srv1-pad.fifo&lt;br /&gt;
   autostart=true&lt;br /&gt;
   autorestart=true&lt;br /&gt;
   startretries=100&lt;br /&gt;
   priority=10&lt;br /&gt;
   stderr_logfile=/var/log/supervisor/enc-srv1.log&lt;br /&gt;
   stdout_logfile=/var/log/supervisor/enc-srv1.log&lt;br /&gt;
&lt;br /&gt;
   [program:pad-srv1]&lt;br /&gt;
   # PAD encoding using odr-padenc&lt;br /&gt;
   command=/usr/local/bin/odr-padenc -o /tmp/srv1-pad.fifo -p 58 -t /home/[UserID]/PAD/srv1/DLS/DLS1.txt -d /home/[UserID]/PAD/srv1/MOT&lt;br /&gt;
   autostart=true&lt;br /&gt;
   autorestart=true&lt;br /&gt;
   startretries=100&lt;br /&gt;
   priority=10&lt;br /&gt;
   stderr_logfile=/var/log/supervisor/pad-srv1.log&lt;br /&gt;
   stdout_logfile=/var/log/supervisor/pad-srv1.log&lt;br /&gt;
&lt;br /&gt;
So you define a name for the program that supervisor uses to identify the process it governs. In this case 2 programs, the audio encoder and PAD encoder for station srv1.&lt;br /&gt;
&lt;br /&gt;
You declare the command line as if you would invoke the program from a command line in a terminal window. Note that we don&amp;#039;t use the more verbose reporting, as this would all be put in the log file, which is not necessary. The next 2 lines tell the supervisor program to start the program automatically, and also restart it when it stops. The number of startretries may seem high, but this is to ensure the audio encoder makes a sufficient number of retries when the connection to the stream server is temporarily lost. Then you can declare the priority, which in our case should all be the same - perhaps with the exception of the multiplexer. And you provide the location of the log files, in this case just one file in which both error and normal log messages are collected.&lt;br /&gt;
&lt;br /&gt;
Make similar files for each station, and put these in the config/supervisor folder.&lt;br /&gt;
&lt;br /&gt;
The configuration file for the multiplexer is similar:&lt;br /&gt;
&lt;br /&gt;
   [program:mux]&lt;br /&gt;
   command=/usr/local/bin/odr-dabmux -e /home/[UserID]/config/mux/dab.mux&lt;br /&gt;
   autostart=true&lt;br /&gt;
   autorestart=true&lt;br /&gt;
   priority=100&lt;br /&gt;
   stderr_logfile=/var/log/supervisor/mux.log&lt;br /&gt;
   stdout_logfile=/var/log/supervisor/mux.log&lt;br /&gt;
&lt;br /&gt;
Note we give this priority 100 to delay the start of the multiplexer to give the processor time to start the NTP protocol and update the time.&lt;br /&gt;
&lt;br /&gt;
=== Special Note for Commands that start Child Processes ===&lt;br /&gt;
&lt;br /&gt;
In certain situations, your command may need to start more than one process. For example:&lt;br /&gt;
&lt;br /&gt;
   command=bash -c &amp;quot;rtpdump -F payload 239.192.1.1/5004 | sox -t raw -e signed-integer -r 48000 -c 2 -b 24 -B /dev/stdin -t raw --no-dither -r 48000 -c 2 -b 16 -L /dev/stdout gain 4 | odr-audioenc --format=raw --dab --bitrate=128 --dabmode=j --dabpsy=2 --pad=24 --pad-fifo=/home/dabsys/site/mot/sam.mot --input=/dev/stdin --output=tcp://127.0.0.1:9010&amp;quot; &lt;br /&gt;
   stopasgroup=true&lt;br /&gt;
&lt;br /&gt;
This composite command extracts linear audio from a multicast source (such as Telos Alliance &amp;quot;Livewire&amp;quot; system), piping the audio to sox to convert the audio format and levels and then piping onwards to the odr-audioenc process.&lt;br /&gt;
&lt;br /&gt;
This scenario requires special handling:&lt;br /&gt;
* The entire composite command should be specified within the correct shell - in this case, bash. This prevents parsing confusion.&lt;br /&gt;
* An additional line is added to the configuration - [http://supervisord.org/configuration.html stopasgroup=true]. This tells supervisor to stop this process AND all the child processes it has spawned. If you don&amp;#039;t do this, you&amp;#039;ll end up with orphaned sox and odr-audioenc processes, which will continue to stream silent packets to the destination.&lt;br /&gt;
&lt;br /&gt;
== Creating symbolic links ==&lt;br /&gt;
&lt;br /&gt;
For each radio program that will be part of the multiplex ensemble you need to create a symbolic link into the /etc/supervisor/conf.d/ folder. This is where supervisor will look for the configuration files. Providing symbolic links will point the program to the files we just created, so supervisor will know the parameters for the audio and PAD encoders and the multiplexer.&lt;br /&gt;
&lt;br /&gt;
Now we can make the symbolic links (assuming &amp;#039;odr&amp;#039; is your username):&lt;br /&gt;
&lt;br /&gt;
   $ sudo ln -s /home/odr/config/supervisor/srv1.conf /etc/supervisor/conf.d/srv1.conf&lt;br /&gt;
&lt;br /&gt;
for the configuration file for program srv1. You should do this for all stations you want to include in the multiplex and the multiplex program configuration file itself.&lt;br /&gt;
&lt;br /&gt;
== Getting Supervisor to work ==&lt;br /&gt;
&lt;br /&gt;
For every change you make to the configuration files you need to call supervisorctl to reread and update its configuration:&lt;br /&gt;
&lt;br /&gt;
   $ sudo supervisorctl reread&lt;br /&gt;
   $ sudo supervisorctl update&lt;br /&gt;
&lt;br /&gt;
This will start supervisord and install it as a deamon, so it will automatically start from now on and start/restart the programs. All services are launched from supervisor, you don&amp;#039;t need to start them manually anymore.&lt;br /&gt;
&lt;br /&gt;
To show status of all services :&lt;br /&gt;
&lt;br /&gt;
   $ sudo supervisorctl status&lt;br /&gt;
&lt;br /&gt;
To [stop|start|restart] a service :&lt;br /&gt;
&lt;br /&gt;
   $ sudo supervisorctl [stop|start|restart] service-name&lt;br /&gt;
&lt;br /&gt;
To apply change after change anything in /home/[UserID]/config/supervisor/ file you need to call supervisor to reread and update configuration.&lt;br /&gt;
&lt;br /&gt;
If you simply type&lt;br /&gt;
&lt;br /&gt;
    sudo supervisorctl&lt;br /&gt;
&lt;br /&gt;
this will not revert to the command prompt, but you will be able to monitor the supervisor status and issue the commands directly.&lt;br /&gt;
&lt;br /&gt;
Supervisor redirects all logs from the tools to files in /var/log/supervisor/ You may need to ensure yourself that this directory exists. The logs will get rotated according to the policy defined by your distribution. More details in the child logging section of the documentation. Please refer to the official supervisor documentation for more details.&lt;br /&gt;
&lt;br /&gt;
If you have correctly installed all programs and configured them correctly you will now have a micro DAB transmitter, with the audio encoding, PAD encoding and multiplexer in a single Raspberry Pi and the modulator in the EasyDAB v2 board, that will automatically start to encode and multiplex and subsequently modulate and transmit the DAB ensemble as soon as you provide a supply voltage. It may take about a minute for the whole process to start, but once it does it will continue until you remove the supply voltage again.&lt;/div&gt;</summary>
		<author><name>Nickpiggott</name></author>
	</entry>
</feed>