Page tree
Skip to end of metadata
Go to start of metadata

This module handles the classification of data being stored in a project. The user determines the manner in which data is being represented and displayed on the UCW IoT Platform. We will demonstrate the steps in doing so below:


Table of Contents

1.0 Data stream panel

To start, navigate to project panel (Projects → Manage Projects → Browse)

Select Data Streams under the Data Management section in the menu sidebar, as shown below.

You should see the available data streams if they are any:

1.1 Create a data stream

To do this, click on the Create Stream button located on the top right of the page.

A dialog box appears for the user to provide desired data stream information such as nametype, and description of the stream.



If the data stream has been successfully added, your screen should look like this:


1.2 Data stream properties

This information identifies and describes the data stream. The user provides them at the point of creating a data stream.

  • Name - It identifies a unique identifier of a data stream in a project. This property is used in firmware to send data to the server.
  • Type - It identifies the type of sensor data format.
    • DATA_MESSAGE - A data message represented by a JSON structure (e.g. {"temperature": 22.34, "humidity": 45})
    • DATA_POINT - A single value of type double (e.g. 22.34).
  • Storage type - Identifies a type of storage to store data. It can be generic storage, PostgreSQL, InfluxDB, and many others.
  • State - Data streams have to be Enabled for it to be active. It can be changed in the data stream properties by checking the Enable box in the Create/Edit Data Stream dialogue box.

1.3 Data stream actions

The tasks or functions that can be carried on a data stream are explained below:

  • Edit - When the user clicks on this button, it provides a dialog box similar to that when you clicked on the Add Stream button. You can make changes to the data stream information provided earlier. However, the Storage type and Type properties can not be edited once a data stream has been created.
  • Browse - It shows the history of data sent from the end devices being stored on the server. Be default it shows the 50 most recent data received from devices.
  • Remove - This button removes the data stream. It prompts a dialog box requiring the user to confirm if the data stream is to be removed.

2.0 Sending data to the UCW IoT Platform

The dataStreamName is required to send data to the UCW IoT Platform. This information is provided in two ways:

sendData
ucw.sendData(deviceId, dataStreamName, payload);
  • If you are not using UCW Arduino Library, the dataStreamName is provided as part of the REST API endpoint. You can see the format below.
URI
String apiUri = "POST /api/ucw/v1/data-streams/%dataStream/messages/%deviceId HTTP/1.1";
apiUri.replace("%dataStream", dataStreamName);
apiUri.replace("%deviceId", deviceId);

You can see an example here.

3.0 Data stream browse

To send data to the server, you need to use the appropriate deviceId and token. The data can be viewed on the data stream panel (Projects → Manage Projects → Browse → Data Streams → Browse). You can see there the most recent data in the stream. An example is shown below:

  • No labels