Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

Partners often desire a stable and high performance integration pipeline.  Websockets (and even Webhooks) are the first tools thought to solve the problem.  Websockets offer an easy way to get a look at the head of the stream.  The websocket provides high performance, real-time streaming data.  The problem with websockets is that the consumer usually needs to add a significant amount of code to robustly and reliably consume the data.  It is the responsibility of the consumer to handle reconnects if the websocket connection goes down.  Since the data is a near-real time stream of the head, the consumer will have a gap in the data while reconnecting.  The websocket server does not have a mechanism to move a "cursor" through the stream.

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/).  The integration path is extremely straightforward.  Amazon provides excellent documentation and examples for setting up a stream and implementing a consumer client.

AWS Kinesis

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"
    5. Enter the following values:
      1. AWS Access Key
      2. AWS Secret Key
      3. Select Kinesis Endpoint region
      4. Stream Name (This should match the name that you assigned to your steam in AWS Console Kinesis)
    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
    7. Select 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. 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.

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",
  "policy": {
    "policyId": 143333122,
    "projectId": 1336,
    "locationId": null,
    "globalScope": true,
    "name": "motion-policy-at-rest",
    "description": "",
    "namespace": "BEACON",
    "metricType": "MOTION",
    "operatorType": "AT_REST",
    "duration": 60,
    "sampleInterval": 2500,
    "threshold": null,
    "thresholdHyst": 0.05,
    "thresholdRange": [
      0.1,
      0.1
    ],
    "regions": null,
    "blufisInZone": null,
    "zoneBeacons": null,
    "period": 60,
    "emailAddresses": [
      "user@example.com"
    ],
    "managedBeaconIds": [],
    "managedBlufiIds": [],
    "anchorBlufis": null,
    "dwellMonitorSettings": [],
    "deviceCount": 0,
    "bounds": null,
    "dateUpdated": 1456847897652,
    "dateCreated": 1456847897652
  },
  "timestamp": 1456850995739,
  "timestampCleared": null
}



  • No labels