Introduction

This package provides two ways to interact with the XRA-31:

The first allows you to configure the XRA-31 and capture packets with the use of JSON configuration files and command-line options.

The XRA-31 Python Interface gives you the option to use the same JSON files, or interact with the XRA-31 through a fine-grained programming interface.

Both provide the same configuration granularity as the web interface, and can be used interchangeably. As a consequence, the JSON configuration files don’t need to be written from scratch - a configuration with the web interface can be saved and restored using the XRA-31 Command-line Interface or XRA-31 Python Interface.

Throughout this manual, user parameters have the following units, unless stated otherwise:

  • MHz for frequencies,

  • seconds for time, and

  • MB for file sizes.

As a quick start, the following minimal example configures an OFDM, an SC-QAM, an OFDMA and an A-TDMA channel, starts a 30-second capture, waits for it to end and downloads the capture to a compressed pcap file:

from excentis import xra31

# Connect to the XRA-31, in full access mode
with xra31.connect("xra31_hostname", full_access = True) as client:

    # Configure
    # Clear any previously configured channels
    client.configuration.clear()

    # Add an OFDM channel
    client.configuration.add_ofdm(plc_frequency,
                                  fft_size,
                                  cyclic_prefix)
    # Add an SC-QAM channel
    client.configuration.add_sc_qam(sc_qam_frequency,
                                    sc_qam_modulation)

    # Set reference SC-QAM channel
    client.configuration.set_reference(frequency=sc_qam_frequency)

    # Wait for the OFDMA channel to be detected
    client.configuration.detection.wait_for_channel(ucid=ucid_ofdma)
    # and add it
    client.configuration.add_ofdma(ucid_ofdma)
    # Wait for the A-TDMA channel to be detected
    client.configuration.detection.wait_for_channel(ucid=ucid_a_tdma)
    # and add it
    client.configuration.add_a_tdma(ucid_a_tdma)

    # Capture
    # Don't use a rolling file capture
    client.capture.number_of_files = None
    # Don't limit the capture size; limit the capture duration
    client.capture.size = None
    client.capture.duration = 30
    # Choose an output
    client.capture.path = "demo.pcap"
    # Start the capture
    client.capture.start()
    # Wait for the capture to end, after the 30 seconds or
    # when stopped from another interface
    client.capture.wait_for_end()

    # Analyse
    # Download the capture
    client.analysis.download(path="demo.pcap", output="test.pcap.gz", compress=True)
    # Remove the capture file from the XRA-31
    client.analysis.delete(path="demo.pcap")

The same can be achieved from the command line interface with the following three commands, given channels.json has been populated previously:

$ xra31-configure xra31_hostname --load channels.json
[xra31-configure][INFO]: Connected to xra31_hostname (Excentis) at http://xra31_hostname
[xra31-configure][INFO]: Load configuration from channels.json
[excentis.xra31][INFO]: Clear channels
[excentis.xra31][INFO]: Configure OFDM channels
[excentis.xra31][INFO]: Configure SC-QAM channels
[excentis.xra31][INFO]: Set reference SC-QAM channel at 664.0MHz
[excentis.xra31][INFO]: Wait for reference SC-QAM channel at 664.0MHz to lock...
[excentis.xra31][INFO]: Configure OFDMA channels
[excentis.xra31][INFO]: Wait for channel descriptor with UCID 25
[excentis.xra31][INFO]: Configure A-TDMA channels
[excentis.xra31][INFO]: Wait for channel descriptor with UCID 2

$ xra31-capture xra31_hostname --number-of-files 1 --size 0 --duration 30 --path demo.pcap --start
[xra31-capture][INFO]: Connected to xra31_hostname (Excentis) at http://xra31_hostname
[xra31-capture][INFO]: Configure capture
[excentis.xra31][INFO]: Configure output
[xra31-capture][INFO]: Start capture

$ xra31-analyse xra31_hostname --wait-end --download --compress --path demo.pcap --output test.pcap.gz --delete
[xra31-analyse][INFO]: Connected to xra31_hostname (Excentis) at http://xra31_hostname
[xra31-analyse][INFO]: Wait for the capture to end
[xra31-analyse][INFO]: Capture stopped, file demo.pcap ready
[xra31-analyse][INFO]: Download capture /demo.pcap
Downloading demo.pcap to test.pcap.gz:  100%
[xra31-analyse][INFO]: Delete capture /demo.pcap
Deleting /demo.pcap