Included with the OTAcast library is a test application. This application is not meant for production use, but can be used for investigating whether or not a given environment is a good fit for OTAcast.

Start by building the library as specified in Quick Start. The OTAcast binary will then be located at install_location/bin/otacast.

The OTAcast binary has two modes server and client. They can be accessed by providing either as positional arguments to the binary, like so ./otacast server or ./otacast client.

Server mode

As the name implies the server mode is where the file is served from.

Using the --help argument the following will be returned:

$ ./otacast server --help
> OTAcast Server Options:
>   -f [ --input_file ] arg           Path to the file that should be sent.
>   -i [ --ip ] arg (=      The remote IPv4 address.
>   -p [ --port ] arg (=45678)        The remote port.
>   --interface arg                   The interface.
>   -w [ --width ] arg (=100)         Set the width of the decoding (higher width higher complexity).
>   --packet_size arg (=1500)         Set the max packet size.
>   -m [ --meta ] arg (=100)          The number of packets between sending a meta packet.
>   -d [ --data_rate ] arg (=1000000) The desired data rate in bytes/second.
>   --hops arg (=1)                   Set the multicast hop limit, i.e. the time-to-live associated with outgoing multicast packets.
>   -h [ --help ]                     Print this help message.
  • input_file: The path to the file which is to be distributed.
  • ip: The IP of the remote, or this could be a multicast address.
  • port: The port used when sending the data.
  • interface: The address of the network interface to use when sending the data.
  • width: An argument for the encoding. It’s basically the number of symbols included in each repair packets. This means that a higher width will produce a more powerful code, however a large width will result in high computational complexity. The width should be selected based on the use-case and the capabilities of the client device(s). For more information about coding terminology, please see Steinwurf’s FAQ here.
  • packet_size: The maximum size of the packets produced in bytes.
  • hops: The multicast hop limit, i.e. the time-to-live associated with outgoing multicast packets.
  • meta: The frequency of which the meta packets are produced. A client will initially discard all data until it has received a meta packet. All subsequent meta packets will be redundant.
  • data_rate: The target data rate in bytes per second.

Client mode

Using the --help argument the following will be returned:

$ ./otacast client --help
> OTAcast Client Options:
>   -i [ --ip ] arg (=    The IPv4 address of the listening interface
>   -p [ --port ] arg (=45678)    The port.
>   -d [ --output_directory ] arg Directory to use for downloading the file.
>   -r [ --resumable ]            Make the client resumable so that if the client
>                                 is stopped and then later restarted, it will
>                                 resume the download from where it left off.
>   -h [ --help ]                 Print this help message
  • ip: The IP of the listening interface, use to listen on any interface. In a multicast setting set this to the multicast IP.
  • port: The port used when receiving data.
  • output_directory: The directory where the received file should be stored. During the download the file will be stored as [FILENAME].otacast file, and upon completion the file is renamed to FILENAME.
  • resumable: The client will look for the file otacast.state in the output_directory. This file contain the information needed for restoring the state of the clients internal decoder. The file is created when the client is stopped before completion. If the client is restored, and the server no longer serves the file described in the otacast.state file, client is reset and the new download will begin instead.


Here’s a couple of examples of how to use the otacast application.

In all the examples we will send a file called myfile, you can use your own file or generate a one with random data using the following Linux command:

head -c 10M </dev/urandom > myfile

Once the file has been received you can verify the integrity with md5sum:

$ md5sum myfile
> 0e7c48fab7a4cf3b6ae469b859243e8b  myfile

Run locally

Server command:

./otacast server myfile

Client command:

./otacast client /tmp/

Run with remote client (unicast)

Server command:

./otacast server myfile --ip [IP OF REMOTE]

Client command:

./otacast client /tmp/

Run with remote clients (multicast)

To use multicast simply provide a multicast IP when starting OTAcast. Please make sure your network properly supports multicast. Read more about setting up WiFi Multicast here.

Server command:

./otacast server myfile --ip [MULTICAST IP]

Client command:

./otacast client /tmp/ --ip [MULTICAST IP]