Verify the data flow

The AWS IoT SiteWise gateway should get streams from your OPC-UA server and upload them into SiteWise. Three data streams are associated to the asset Generator-1. Because notifications are enabled data are published to AWS IoT Core.

SiteWise publishes data from notifications to the topic:

$aws/sitewise/asset-models/[ASSET_MODEL_ID]/assets/[ASSET_ID]/properties/[PROPERTY_ID]

You remember the hierarchy Asset model -> Asset -> Asset property?

To see all messages from assets where you have set the notification status to ENABLED subscribe to the topic $aws/sitewise/asset-models/+/assets/+/properties/+.

To subscribe to the topic

  1. Navigate to the AWS IoT Core console
  2. Choose Test, if available chooose MQTT test client.
  3. Under Subscribe to a topic, enter $aws/sitewise/asset-models/+/assets/+/properties/+, and then choose Subscribe.
  4. In the Subscriptions pane, under $aws/sitewise/asset-models/+/assets/+/properties/+ you should see regularly arriving messages. These messages should look similar to:
{
  "type": "PropertyValueUpdate",
  "payload": {
    "assetId": "835d67e1-b5a7-495f-8545-4ac0afc38da9",
    "propertyId": "83262e8c-fee5-4fda-936c-ea43f96baefe",
    "values": [
      {
        "timestamp": {
          "timeInSeconds": 1634182205,
          "offsetInNanos": 572000000
        },
        "quality": "GOOD",
        "value": {
          "doubleValue": 94.48563937046083
        }
      },
      {
        "timestamp": {
          "timeInSeconds": 1634182210,
          "offsetInNanos": 572000000
        },
        "quality": "GOOD",
        "value": {
          "doubleValue": 91.16124316357875
        }
      }
    ]
  }
}

If you want to get messages only for a single asset property you can subscribe to the related topic. You will find the topic name in the AWS IoT SiteWise Console by looking at an asset. A particular topic would look similar to: $aws/sitewise/asset-models/4ddae1ce-0e73-4c2e-8e41-e04167e4c426/assets/3cc0345a-e51a-434d-98c5-645882335f28/properties/cc83cf68-46b1-49f6-b789-a553de75ec4d

It is not possible to subscribe to the topic $aws/sitewise/#. This topic is not accepted by the test client in the AWS IoT console. If you try to subscribe to this topic with another MQTT client it gets disconnected by the service.

You can also use the AWS IoT SiteWise console to look for incoming data streams for your assets.

  • Open the assets section in the console.
  • Choose Generator-1.
  • When data are arriving you should see values in the Measurements and Metrics tabs under the column Latest value.

Create the following generator assets to ingest more data. Data for Generator-2 will be ingested through the SiteWise gateway, for Generator-3 through the PUT API and for Generator-7 through the rules engine from IoT Core.

  • Generator-2
  • Generator-3
  • Generator-7

Use any serial and the related measurements. Data streams contain the generator number. For example the stream /DayOneEnergyCorp/7/Generator/rpm represents the rpm for Generator-7.

After you have created the assets you should see one more asset ingesting data in the MQTT test client.

The remaining generators 4 and 8 will be created later. You will learn howto create assets with an SDK.