Skip to main content

HTTP

The HTTP plugin connects the DroneDeploy Robotics Portal to one or more HTTP endpoints, allowing you to integrate your robot which uses HTTP APIs for communication. These HTTP endpoints may be exposed on the robot itself, or available on the LAN the robot is part of.

The HTTP plugin is bidirectional; it can both call HTTP endpoints in response to commands being send from the DroneDeploy Robotics Portal, and automatically poll HTTP endpoints in order to publish data to the Robotics Portal.

Configuration

To use the HTTP plugin, your agent will need a section in its agent-settings.json file which enables the http component, as shown below. For more information on how to configure the agent plugins, see Agent Configuration.

...
"components": [
...
{
"enabled": false,
"id": "http",
"settings": {
"logLevel": 1,
"sources": {
"sourceName1": {
"address": "https://some.domain.com/some/api",
"method": "GET",
"headers": {
"aHeader": "headerValue"
},
"body": "someBodyText",
"timeout": 500,
"interval": 1000,
"response": "{\"$id\":\"%[1]s\",\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"%[1]s\",\"type\":\"array\"}"
}
}
}
},
...
]

The HTTP plugin understands the following configuration parameters:

NameDescriptionDefaultUnit
enabledWhether to enable the HTTP plugin or not.false
logLevelThe logging verbosity: 1 - very quiet, 6 - very talkative.4
sourcesA map which defines the names of data sources which the HTTP Plugin should publish by calling HTTP endpoints, and the details for each which configures how the endpoint should be called. Each source entry has a number of additional properties:
sources.addressRequired. The HTTP address which should be called in order to receive data for this source: the response from calling this request will be the data which is sent to the DroneDeploy Robotics Portal.
sources.methodThe type of HTTP operation which should be performed on the named endpoint."GET"
sources.headersA map of string key:value pairs which should be included in the HTTP request as headers.
sources.bodyThe string value which forms the body of the HTTP request.
sources.timeoutHow long the Agent should allow for each request to the HTTP endpoint, before it considers that the request has failed.10000ms
sources.intervalRequired. How long the Agent should wait between calls to the HTTP endpoint while collecting data. The Agent will not actually call the endpoint unless there is at least one consumer subscribed to the endpoint topic.ms
sources.responseA JSON schema which matches the format of JSON data contained in the body of response from the HTTP endpoint. This JSON schema is used to expose the response data into separate fields in the DroneDeploy Robotics Portal. If this field is not present, then the entire body of the response will instead simply be presented to the Robotics Portal as a single string.

Data Model

Receiving (Telemetry) Messages

The data model for this plugin is determined by the sources configuration settings for the plugin. Each separate HTTP endpoint to be used as a source must have a valid configuration entry; the name of each entry in the sources table will determine the data URLs which are published by the plugin.

For instance, if there is a source entry named sourceName1 , then the response from calling the configured endpoint will be exposed as the topic /http/sourceName1.

In order for individual fields in the HTTP response to be parsed separately by the DroneDeploy Robotics Portal, and thus be able to be bound to dashboard widgets, the body of the HTTP response must be valid JSON, and a corresponding JSON schema must be provided in the response setting for that source.

Sending (Control) Messages

The data model for this plugin consists of a JSON format for sending HTTP requests to arbitrary endpoints. You configure the payload when configuring a command in the DroneDeploy Robotics Portal. The payload this component expects is as follows:

{
"address": "https://yourdomain.com/your-endpoint", // the API endpoint you want the agent to call
"method": "POST", // the HTTP method
"headers" : {
"Content-Type":"text/plain" // any HTTP headers the call requires
},
"body": "hello world!", // the body of the message
"timeout": 10 // the amount of time the request should wait for a response, in milliseconds
}