Warning: This is a development version. The latest stable version is Version 6.0.0.

Application

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 (=127.0.0.1)      The remote IPv4 address.
>   -p [ --port ] arg (=45678)        The remote port.
>   --interface arg                   The interface.
>   --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.
  • 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 (=0.0.0.0)    The IPv4 address of the listening interface
>   -p [ --port ] arg (=45678)    The port.
>   -d [ --output_directory ] arg Directory to use for downloading the file.
>   -s [ --silent ]               Disable the progress output.
>   -h [ --help ]                 Print this help message
  • ip: The IP of the listening interface, use 0.0.0.0 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.
  • silent: If set, the client will no longer print the progress.

Examples

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
_images/server.gif

Client command:

./otacast client /tmp/
_images/client.gif

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]