IoT SiteWise publisher - AWS IoT Greengrass

IoT SiteWise publisher

The IoT SiteWise publisher component (aws.iot.SiteWiseEdgePublisher) enables AWS IoT SiteWise gateways to export data from the edge to the AWS Cloud.

For more information about AWS IoT SiteWise gateways, see Using AWS IoT SiteWise at the edge in the AWS IoT SiteWise User Guide.

Versions

This component has the following versions:

  • 2.1.x

  • 2.0.x

Type

This component is a generic component (aws.greengrass.generic). The Greengrass nucleus runs the component's lifecycle scripts.

For more information, see Component types.

Operating system

This component can be installed on Linux core devices only.

Requirements

This component has the following requirements:

  • The Greengrass core device must run on one of the following platforms:

    • OS: Ubuntu 20.04 or 18.04

      Architecture: x86_64 (AMD64)

    • OS: Red Hat Enterprise Linux (RHEL) 8

      Architecture: x86_64 (AMD64)

    • OS: Amazon Linux 2

      Architecture: x86_64 (AMD64)

  • The Greengrass core device must connect to the Internet.

  • The Greengrass core device must be authorized to perform the iotsitewise:BatchPutAssetPropertyValue action. For more information, see Authorize core devices to interact with AWS services.

    Example permissions policy

    { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iotsitewise:BatchPutAssetPropertyValue", "Resource": "*" } ] }

Endpoints and ports

This component must be able to perform outbound requests to the following endpoints and ports, in addition to endpoints and ports required for basic operation. For more information, see Allow device traffic through a proxy or firewall.

Endpoint Port Required Description

data.iotsitewise.region.amazonaws.com

443 Yes

Publish data to AWS IoT SiteWise.

Dependencies

When you deploy a component, AWS IoT Greengrass also deploys compatible versions of its dependencies. This means that you must meet the requirements for the component and all of its dependencies to successfully deploy the component. This section lists the dependencies for the released versions of this component and the semantic version constraints that define the component versions for each dependency. You can also view the dependencies for each version of the component in the AWS IoT Greengrass console. On the component details page, look for the Dependencies list.

The following table lists the dependencies for version 2.0.x of this component.

Dependency Compatible versions Dependency type
Greengrass nucleus >=2.3.0<3.0.0 Hard
Stream manager >=2.0.10<3.0.0 Hard

For more information about component dependencies, see the component recipe reference.

Configuration

This component provides the following configuration parameters that you can customize when you deploy the component.

publishingOrder

The order in which data is published to the cloud. The value of this parameter can be one of the following.

  • TIME_ORDER (Publish oldest data first) – The oldest data is published to the cloud first, by default.

  • RECENT_DATA (Publish newest data first) – The newest data is published to the cloud first.

dropPolicy

(Optional) A policy that controls what data is published to the cloud.

cutoffAge

Data that is older than the cutoff period isn't published to the cloud. The cutoff age must be between five minutes and seven days.

You can use m, h, and d when you specify a cutoff age. Note that m represents minutes, h represents hours, and d represents days.

exportPolicy

(Optional) A policy that manages data storage at the edge. This policy applies to data that is older than the cutoff age.

retentionPeriod

Your gateway deletes any data at the edge that is older than the cutoff period from the local storage after it's stored for the specified retention period. The retention period must be between one minute and 30 days, and greater than or equal to the rotation period.

You can use m, h, and d when you specify a retention period. Note that m represents minutes, h represents hours, and d represents days.

rotationPeriod

The time interval over which to batch up and save data that is older than the cutoff period to a single file. The gateway transfers one batch of data to the following local directory at the end of each rotation period: /greengrass/v2/work/aws.iot.SiteWiseEdgePublisher/exports. The rotation period must be greater than one minute, and equal to or less than the retention period.

You can use m, h, and d when you specify a rotation period. Note that m represents minutes, h represents hours, and d represents days.

exportSizeLimitGB

The maximum allowed size of data stored locally, in GB. If this quota is breached, the gateway starts deleting the oldest data until the size of data stored locally is equal to or less than the quota. The value of this parameter must be greater than or equal to 1.

{ "publishingOrder": "TIME_ORDER", "dropPolicy": { "cutoffAge": "7d", "exportPolicy": { "retentionPeriod": "7d", "rotationPeriod": "6h", "exportLocation": "/greengrass/v2/work/aws.iot.SiteWiseEdgePublisher/exports", "exportSizeLimitGB": 10 } } }

Input data

This component reads BatchPutAssetPropertyValue messages from AWS IoT Greengrass stream manager. For more information, see BatchPutAssetPropertyValue in the AWS IoT SiteWise API Reference.

Local log file

This component uses the following log file.

/greengrass/v2/logs/aws.iot.SiteWiseEdgePublisher.log

To view this component's logs

  • Run the following command on the core device to view this component's log file in real time. Replace /greengrass/v2 with the path to the AWS IoT Greengrass root folder.

    sudo tail -f /greengrass/v2/logs/aws.iot.SiteWiseEdgePublisher.log

Licenses

This component is released under the Greengrass Core Software License Agreement.

Changelog

The following table describes the changes in each version of the component.

Version

Changes

2.1.1

Bug fixes and improvements.

2.1.0

New features

  • Adds support for publishing the newest data to the cloud first.

  • Adds supports for not publishing expired data to the cloud.

  • Adds support for storing expired data locally.

Bug fixes and improvements

  • Reduces disk I/O and corresponding latency.

2.0.2

Bug fixes and improvements.

2.0.1

Initial version.

See also