This repository contains an example packager and a receiver that demonstrate how to use the Data over DAB libraries.
The following libraries are required to build the code in this repository:
Depending on your operating system these libraries might be available in your OS package repository.
Building the examples requires CMake
The first thing you need to do is to clone the repository and its submodules:
$ git clone --recursive https://github.com/Opendigitalradio/data-over-dab-example.git
Afterwards you are ready to configure and build the examples like so:
$ cd data-over-dab-example
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Release
$ cmake --build -- -j$(nproc)
The resulting binaries can be found in <build-directory>/products/Release/bin
Per default, the packager packages the incoming data in way that makes it look
like it comes from 10.0.0.2
and goes to 10.0.0.1
. It also sets 1000
as
the DAB packet address. Thus you need to make sure to pass 10.0.0.1
and
1000
as the receiver
s arguments.
To start the packager, you need to create the expected fifo and run the packager:
$ mkfifo /tmp/dabdata
$ <build-directory>/products/Release/bin/packager
NOTE: If you want to use ODR-DabMux to create a DAB multiplex that transports the data generated by the packager, you will need to start ODR-DabMux using the supplied demo.mux file PRIOR to running the packager:
$ odr-dabmux <source-root>/mux/demo.mux
You can also use the supplied run
script if you want to transmit the
multiplex using ODR-DabMod and a HackRF:
$ <source-root>/mux/run
Please note that the run
script requires python and GNURadio with the
modules for the HackRF to run.
Running the receiver requires an SDR device compatible with librtlsdr. The receiver requires root access to create the virtual network device:
$ sudo <build-directory>/products/Release/bin/receiver 10.0.0.1 1000
To send data via the DAB IP tunnel, you can send UDP datagrams to port 4321 on the machine the packager is running on. For example you can use netcat:
$ echo "Hello DAB" | nc -w0 -u 127.0.0.1 4321
Receiving the transmitted is equally as simple. On the machine that is running the receiver, you will simply listen on the address of the virtual network interface for UDP datagrams on the port specified in the packager (default 4242):
$ nc -u -l 10.0.0.1 4242