RTSA HTTP Stream Server Endpoints 8
RTSA HTTP Stream Server Endpoints 8
Block Graph
An HTTP server block in the block graph of the RTSA suite provides the access. More than one HTTP
server blocks may be present in one graph, but will have to use different ports for their listening socket.
The data streamed will depend on the graph used in the RTSA suite.
Including a demodulation block allows fine grained control of the spectrum range and sample rate down
to the sub hertz frequencies.
A sweep block on the other hand extends the frequency range beyond the realtime span of the capture
device.
Stream Format
The stream server supports three main data types for streaming data – the RTSA file format, JSON and a
combined JSON and binary format. External applications will most likely use JSON or raw. The stream is
split into packets comprising meta data and an array of samples.
Not all fields are present for all media types. The start and end time as well as the payload type are
always present.
Spectrum Data
Spectrum data packets will look like this:
{
"startTime" : 1501163970.1396854,
"endTime" : 1501163970.140799,
"unit" : "dbm"
"payload" : "spectra",
"startFrequency" : 2400250000,
"endFrequency" : 2487750000,
"minPower" : -95,
"maxPower" : 5,
"antenna" : {
"name" : "Block_IsoLOG_0"
"latitude" : 50.13646697998047,
"longitude" : 6.320250034332275,
"azimuth" : -2.748893976211548,
"declination" : 0,
},
"sampleDepth" : 1,
"sampleSize" : 448,
"samples" : [
[ -90.05, -90.05, ... , -81.01 ],
...
[ -81.65, -78.05, ... , -90.01 ]
],
}
IQ Data
IQ Samples are transmitted as a flat array of alternating I and Q values.
{
…
"payload" : "iq",
"unit" : "generic"
"minPower" : -2,
"maxPower" : 2,
"sampleDepth" : 1,
"sampleSize" : 2,
"samples": [
5.12e-05, 0.00132,
0.000885, 0.00124,
0.000566, 0.000654,
-0.000615, 2.35e-05,
0.00042, -0.000276,
-0.000723, -0.000343,
-0.000672, 0.000195,
0.000843, -0.000228,
...
]
}
Data that is captured from a source that is not calibrated will have a unit type of generic. The used value
range will be given by the min and max power values.
Histogram Data
Histogram data transfers percentages of bin usage. The sample size is like the spectrum or category
data, but the sample depth is used to separate the bins. The sample data is a 2D array with the
dimensions sample size and sample depth packed into a flat 1D JS array.
{
"startTime" : 1506933004.0587604,
"endTime" : 1506933004.0911448,
"payload" : "histogram",
"unit" : "percentage"
"startFrequency" : 2402250128,
"endFrequency" : 2489750128,
"maxPower" : 5,
"minPower" : -165,
"sampleDepth" : 256,
"sampleSize" : 896,
"samples": [
[ 0.074, 0.0787, ... 0.0893 ]
],
}
{
…
"categories" : [
{
"name" : "Wifi Channel 1",
"startFrequency" : 2401000000
"endFrequency" : 2423000000,
},
...
],
…
}
Antenna Data
Data that was captured using an antenna with e.g. location or directional information will have an
antenna specification field in the packet.
Data Endpoints
Single Samples
Polling single samples from the server block input is performed with the “/sample” endpoint. This can
easily be tried using a standard web browser http://localhost:54664/sample :
Receiving multiple samples can be achieved using the “/samples” endpoint. The number of samples can
be controlled with the “limit” argument e.g. http://localhost:54664/samples?limit=1000 will try to
capture 1000 samples or spectra. The result will be an array of sample objects.
The “input” argument may be used to select a different input than the “main”.
Stream Data
Another option is the use of streaming with a chunked transfer setting using the “/stream” endpoint.
The data is transmitted as line limited JSON. Each sample packet is encoded as individual JSON data
separated by a line feed (ASCII 10) and a record separator (ASCII 30) character.
The stream can be limited to a maximum number of samples using the limit argument:
http://localhost:54664/stream?format=json
Additional optional arguments are “rate_reduction=n” to reduce the number of samples transmitted by
a factor of n. Automatic rate adaption can be disabled by using “rate_adaption=0”.
The “input” argument may be used to select a different input than the “main”.
Alternative Inputs
Some connectors provide more than one stream. The “input” argument of the sample and stream
endpoint is used to select this stream. The “inputs” endpoint returns an array of available inputs.
{"inputs":["main","{3b459e11-74e1-4b82-88ad-28459dfe2fe1}"]}
New inputs can be created based on existing inputs with a post request to the inputs endpoint. The
argument is a JSON document with the following fields:
The result is a JSON document that provides the name of the new input. Available types are:
Each input does also provide a set of configuration parameters. The input endpoint together with the
input parameter can be used to query the current settings (see configuration data).
The float data is requested using the “raw32” format and the integer data using the “int16” format. A
scale value is provided in the JSON metadata section to convert from the integer format to float values;
The RTSA HTTP server block will start dropping data when the outbound TCP buffer exceeds 8 Mbytes. A
loss of data can be determined by comparing the timestamps of two adjacent data packets.
Control Endpoint
Depending on its functionality each configuration block of the Aaronia-RTSA-Suite accepts control
commands for example the start/stop command. These commands are not addressed to a specific RTSA
block and will be processed from all RTSA blocks in the block graph configuration.
Following control HTTP PUT request(http://localhost:54664/control) will start all streaming related
blocks at the remote configuration site. To stop the streaming the value of start needs to be set to false:
{
"start" : true,
"type" : "streaming"
}\n'
Sending a put request is problematic using a web browser, but can be done using e.g. “curl” as a
command line tool.
To set the frequency range of the measurement devices, following fields are used:
{
"frequencyCenter" : 1200000000,
"frequencySpan" : 44000000,
"frequencyBins" : 448,
"referenceLevel" : -20,
"type" : "capture"
}\n'
Using curl:
curl -X PUT -d "{\"frequencyCenter\":1920.0e6, \"frequencySpan\":200.0e6,
\"type\":\"capture\"}" http://localhost:54664/control
To start or stop the autorotation of all antennas in the remote block graph configuration, following fields
are used:
{
"rotate" : true,
"type" : "antenna"
}\n'
{
"start" : true,
"filename" : “xy”
"type" : "recording"
}\n'
{
"reload" : true,
"type" : "mission"
}\n'
Configuration Data
Server Info
The “/info” endpoint provides information of the http server block, such as name, title, port, features
and the name and path of the mission http://localhost:54664/info.
{
"name" : "Block_HTTPServer_0",
"title" : "HTTP Server",
"uuid" : "aaf2a8f7-11fa-45a3-bcfc-26aaf5957629",
"port" : 54664,
"mission" : ""
}
General
All configuration items visible in the configuration blocks of the Aaronia-RTSA-Suite have a
representation as JSON. The list of available configuration items can be queried with the
“/remoteconfig” endpoint http://localhost:54664/remoteconfig.
The configuration data forms a tree with the root being placed into the config member of the top-level
object. The second tree level is populated with the blocks of the graph, all further levels by configuration
elements of these blocks.
A JSON “/remoteconfig” HTTP PUT request starts with the following fields:
{
"request" : 0,
"config" : {
"type" : "group",
"name" : "Block_Spectran_0",
"items" : [ {
…
A HTTP PUT request to enable the amplifier of a Spectran V5 RTSA block for example, looks like the
following:
{
"request" : 1,
"config" : {
"type" : "group",
"name" : "Block_Spectran_0",
"items" : [{
"type" : "group",
"name" : "main",
"label" : "Main",
"items" : [{
"type" : "bool",
"name" : "amplifier",
"value" : true
}]
}]
}
}
Status Endpoint
Depending on the functionality of a configuration block in the Aaronia-RTSA-Suite, a block can report its
health status at the “/healthstatus” endpoint http://localhost:54664/healthstatus in JSON format. The
health status contains the current state of the configuration blocks together with its latest error.
Depending on the capabilities of the block additional information is provided, like temperature values or
performance statistics.
The format of the health status is composed of the same config items as the configuration data format.
It consists of one main group item, named “healthstatus” with one child group item per health aware
block. Each one of these block health groups consists of up to five subgroups
User Endpoint
The “/user “ endpoint provides information regarding the current user of the endpoint, such as name,
email, position or the alternative authorization token.
Performance Considerations
While it is unlikely to achieve the full 250M samples of IQ data using pure JSON or a gigabit network card,
it is a simple matter of a fast parser to get the full rate using a loopback connection and an appropriate
programming language. TCP loopback on windows can be improved by using the TCP Loopback Fast Path
(enabled by SIO_LOOPBACK_FAST_PATH).