Data Stream Integrations

Partners often desire a stable and high performance integration pipeline.  

Stream Processing

There are several cloud scale grade stream processing technologies available that eliminate the pain of integrating data streams.  Bluzone aims to integrate with several of the leading providers.  At this time, Bluzone supports Amazon AWS Kinesis (https://aws.amazon.com/kinesis/) and Azure Event Hubs.  

AWS Kinesis

The integration path is extremely straightforward.  Amazon provides excellent documentation and examples for setting up a stream and implementing a consumer client.

The following steps describe the process for configuring a Bluzone Project to export data to an Amazon Kinesis Stream.  

  1. Generate IAM credentials for connecting to the Stream. Refer to Setting Up for Amazon Kinesis Streams for step-by-step instructions.
    1. Select IAM Management Console
    2. Select a user
    3. Select "Security Credentials" tab
    4. Click "Create Access Key"
    5. Take note of the "Access Key ID" and the "Secret Key" values, as they are needed for a later step
  2. Create the Kinesis Stream.
    1. From the AWS Console Kinesis page, select "Kinesis Streams" (NOT "Kinesis Firehose")
    2. Click "Create Stream"
    3. Give the stream a name
    4. Enter the number of shards (Follow AWS instructions for figuring out the number of shards)
    5. Click Create
  3. Add the Kinesis Stream to Bluzone
    1. Login to the Bluzone Portal
    2. Open the project setting view
    3. Select "Stream"
    4. Create a new config by clicking "Create"
      1. Stream Name (This should match the name that you assigned to your steam in AWS Console Kinesis)
      2. Select Kinesis Endpoint region
      3. Either you can give AWS Access Key and AWS Secret key or Enable Assume Role, Refer How to create assume role
    5. Select the Stream Type:
      1. Packet Data - This option will capture aggregated scandata of all BluFis that are associated with your project
      2. Location Data - This option will capture aggregated RTLS data of all beacons that are associated with your project
      3. Policy Event Data - This option will capture any policy related event data associated with your project
      4. Beacon Telemetry data - This option will capture temperature and battery data of all beacons that are associated with your project
    6. Select Save
    7. Once you have successfully created and saved a stream, it will show up in the stream list with Enabled status
    8. You may disable the stream as following:
      1. Select the stream from the stream list
      2. Uncheck 'Remote Consumer Enabled' box
      3. Select Save

The Bluzone cloud will take up to 10 minutes to setup your stream.  Once it starts writing data, you will be able to consume from the stream with any of the provided reference libraries.

Azure Event Hubs

The following steps describe the process for configuring a Bluzone Project to export data to an Azure Event Hubs Stream.

  1. Creating Shared access policy.
    1. Create the Azure event hubs by following the link Setting up Azure Event Hubs for step-by-step instructions.
      1. Select the created Event Hub instance and select the Shared access policies.
      2. Click “Add”.
      3. Give the policy name and select any one or more options(“Manage”, “Send” and “Listen”) that available and click create.
      4. Now the shared access policy for the event hub is created and once you click on the policy, you can view the credentials at the right side.
      5. Take a note of “Event Hub Namespace name”, “Event Hub Name”, “SAS Policy Name” and “SAS Key” (Primary is preferred).



  2. Add Event Hub to Bluzone.
    1. Login to Bluzone Portal.

          
    2. Open the project setting view.
          
    3. Select "Streams".
          
    4. Click "Create" for new configuration.
          
    5. Select Azure as Cloud Provider and enter the following values:
      1. Azure Event Hub Namespace name.
      2. Azure Event Hub Name.
      3. SAS Policy Name.
      4. SAS Key.



    6. Select the Stream Type.
      1. Packet Data - This option will capture aggregated scandata of all BluFis that are associated with your project.
      2. Location Data - This option will capture aggregated RTLS data of all beacons that are associated with your project.
      3. Policy Event Data - This option will capture any policy related event data associated with your project.
      4. Beacon Telemetry data - This option will capture temperature and battery data of all beacons that are associated with your project
    7. Click "Save".
    8. Once you have successfully created and saved a stream, it will show up in the stream list with Enabled status.
    9. You may disable the stream as following:
      1. Select the stream from the stream list
      2. Uncheck 'Remote Consumer Enabled' box
      3. Click "Save"


The Bluzone cloud will take up to 10 minutes to setup your stream.  Once it starts writing data, you will be able to consume from the stream with any of the provided reference libraries.

Available Data Streams

The following streams are currently supported by Bluzone:

Packet Data

The raw packet data that is read from the Blufi devices

See:  ScanData Stream API v1

Location Data

A stream of location messages for use with RTLS deployments.

See:  Location Stream API v1

Location Event Data
 {
  "type": "location",
  "projectId": 1336,
  "id": "3777777777777777777",
  "mac": "01:ef:07:07:07:07:07",
  "floorNumber": 1,
  "deviceName": "door beacon",
  "latitude": 25.256818055638366,
  "longitude": 55.37758749303774,
  "altitude": 0.0006927130743861198,
  "location": "25.256818055638366, 55.37758749303774",
  "timestamp": "2016-02-24T16:58:14.014Z",
  "varianceX": 10.906546468979249,
  "varianceY": 17.58863642627552,
  "varianceZ": 0
}

Policy Event Data

Message tracking Policy state change events.

Note:  the "uniqueDeviceId" is the beacon deviceId when policy namespace is "BEACON".

See:  Policy Event Stream API v1

Policy Event Data
{
  "eventUuid": "7c8d1944-ffe0-4812-9519-18afd0e01a3e",
  "projectId": "1336",
  "policyId": "143333122",
  "blufiId": "732222122",
  "uniqueDeviceId": "8686868686868686868",
  "oldState": "OK",
  "newState": "VIOLATING",
  "value": "60",
  "timestamp": 1456850995739,
  "timestampCleared": null
}


SsnsSummary Data (High-Speed Data)

Condition Monitoring summary data that includes temperature and high-speed acceleration values in Protobuf encoding (Same as for RemoteStorage).

Proto File : highSpeed

For Additional on deserialization: Click Here

Telemetry Data

Beacon Telemetry summary data that includes temperature and battery values of 1 min interval of a beacon in Protobuf encoding (Same as for RemoteStorage).

Proto File: Telemetry 

For Additional on deserialization: Click Here

Distance Tracking Incident Data


Beacon Telemetry summary data that includes temperature and battery values of 1 min interval of a beacon in Protobuf encoding (Same as for RemoteStorage).

Proto File: ContactIncident 

For Additional on deserialization: Click Here