Data Collectors

Data Collectors enable JEDI One to communicate with data sources such as sensors, devices and machines and receive data.

JEDIDataCollectors

You can add, edit, delete, enable, disable data collectors by selecting the Data Collectors menu from the navigation panel.

JEDI One v1.5 supports the following data collectors:

  • HTTP Listener
  • TCP CSV

Adding a new data collector

JEDI One allows you to add multiple data collectors of the same type. This feature allows you to create separate data collectors for different groups of devices.

Step 1

Click ADD COLLECTOR button to add a new data collector.

JEDIDataCollectorAddNew

Step 2

Enter a name for this data collector.

Step 3

Select the type of data collector that you wish to add.

JEDIDataCollectorHTTP

Settings related to the selected data collector type are shown in the Protocol Options section.

Step 4

Select the the Listen IP address and enter the Listen Port number. The data collector will listen on the selected IP address and port number to receive data.

Step 5

Configure Protocol Options and save the data collector.

Step 6

Enable the data collector if it is not already enabled.

HTTP Listener Data Collector

The HTTP Listener data collector implements a HTTP server that can accept HTTP requests from data sources such as sensors, devices and machines.

Each HTTP Listener data collector can receive HTTP requests from one or more data sources by listening on the entered Listen IP and Listen Port.

Read Timeout: HTTP Listener data collector will timeout and abort a read request after this time.

Write Timeout: HTTP Listener data collector will timeout and abort a write request after this time.

Target

The Targets section shows the actively connected targets such as sensors, devices and machines.

Default HTTP Listener Data Collector

To get you started quickly, JEDI One is already enabled with a HTTP Listener data collector by default.

You can disable the default HTTP Listener or delete it at any time.

Sending Data To JEDI One Using HTTP Query Parameters

The following is an example of how you can send data to JEDI One easily using HTTP query parameters. In the example below:

Localhost is the domain name or IP address of the machine running JEDI One

8100 is the port number configured for the default HTTP Listener data collector. Replace this with the port number you configured when you added or edited a HTTP Listener data collector.

target is the device ID of the device sending the data.

key1 is a property such as "temperature", "frequency" ...

val1 is the value of key1

You can send multiple keys and values in the same HTTP request.

timestamp (optional) is the timestamp for the data in ISO8601 format.

Any special characters in the URL string must be escaped as per the HTML specifications.

http://localhost:8100/v1/data/for/:target?key1=val1&key2=val2&timestamp=timestamp

You can use the cURL tool available on most Linux and Apple MacOS operating systems to experiment with sending data to JEDI One. The following is the cURL example:

curl -X POST \
'http://localhost:8100/v1/data/for/weather3?Key1=10&Key2=20&timestamp=2016-07-25T02%3A22%3A33%2B0530%0A'

While HTTP query parameters are the easiest way to send data to JEDI One, it may not be the most user friendly way to send the data because of HTML URL limitations.

Sending Data to JEDI One Using HTTP POST Request

You can send data to JEDI One using a HTTP POST request. The following example shows the JSON syntax for the request:

{
    "context": {
        "target_id": "aa-bb-c",
        "target_ip": "192.168.2.1",
        “timestamp”: timestamp
    },
    "data": {
        "key1": 30,
        "key2": 20
    }
}

context section in the JSON contains information regarding the sender.

target_id is the device ID of the sender.

target_ip is the IP address of the sender.

timestamp (optional)* is the timestamp in ISO8601 format.

data section contains the key value pairs for data.

key1 and key2 are properties such as "temperature", "frequency", ...

30 is the value of key1

20 is the value of key2

You can use the cURL tool to experiment with sending data to JEDI One using HTTP POST request:

curl -X POST \
http://localhost:8100/v1/data/mc \
-H 'Content-Type: application/json' \
-d '{
    "context": {
        "target_id": "aa-bb-c",
        "target_ip": "192.168.2.1",
        "timestamp":"2016-07-25T02:22:33+0530"
    },
    "data": {
        "key1": 30,
        "key2": 20
    }
}'

TCP CSV Data Collector

The TCP CSV data collector implements a TCP server that is capable of automatically parsing comma-separated values (CSV) data.

TCP-CSV is a common format used by device servers that take a serial data stream from a sensor, device or machine and encapsulate that in TCP packets.

Adding a new TCP-CSV data collector is similar to adding a HTTP Listener data collector except for the Protocol Options.

JEDIDataCollectorTCP

The Data Format String

The Data Format string is used to decode and label the fields in the incoming CSV over TCP data stream.

Decoder syntax:

n:  <field-name> to assign a name to a field
use n:TARGETID to specify a field as device ID
ty: <field-type> to assign a type to a field.
Supported types:
ty:timestamp for timestamps in ISO8601 format
ty:number
ty:string
ty:bool (field value must be “true” or “false”)

Example:

n:TimeStamp; ty: timestamp, n:Temperature; ty: number, n:battery; ty: number

The example above decodes a CSV byte sequence received over TCP that looks like:

2020-01-25T02:22:33+0800,89.2,95

The data format string helps JEDI One decode the first field in the CSV as a timestamp, the second field as a number and labeled as "Temperature", the third field is a number and labeled as "battery".