Creating a gateway - Amazon IoT SiteWise
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Creating a gateway

You can use the Amazon IoT SiteWise console to create a gateway. This topic contains the following steps:

Step 1: Configure a gateway

  1. Navigate to the Amazon IoT SiteWise console.

  2. In the navigation pane, choose Gateways.

  3. Choose Create gateway.

  4. Enter a name for your gateway or use the name generated by Amazon IoT SiteWise.

  5. For Greengrass core device, choose one of the following options:

    • Default setup ‐ Amazon automatically uses default settings to create a Greengrass core device in Amazon IoT Greengrass V2.

      1. Enter a name for the Greengrass core device or use the name generated by Amazon IoT SiteWise.

    • Advanced setup ‐ Choose this option if you want to use an existing Greengrass core device or to create one manually.

      1. Choose a Greengrass core device or choose Create Greengrass core device to create one in the Amazon IoT Greengrass V2 console. For more information, see Setting up Amazon IoT Greengrass V2 core devices in the Amazon IoT Greengrass Version 2 Developer Guide.

  6. Choose Next.

Step 2: Configure edge capabilities

Amazon IoT SiteWise provides the following packs that your gateway can use to determine how to collect and process your data. Select packs to enable edge capabilities for your gateway.

  • Data collection pack enables your gateway to collect data from multiple OPC-UA servers, and then export the data from the edge to the Amazon Cloud. By default, this pack is automatically enabled for your gateway. You can't disable this pack.

  • Data processing pack enables your gateway to process your data at the edge. For example, you can use asset models to compute metrics and transforms. For more information about asset models and assets, see Modeling industrial assets.

    Note
    • Amazon IoT SiteWise retains your edge data on your gateways up to 30 days. The retention of your data is dependent on your device and the available disk space.

    • The data processing pack is automatically turned off 30 days after your gateway has been disconnected from the Amazon Cloud.

  1. (Optional) In the Edge capabilities pane, select Data processing pack.

  2. (Optional) In the Edge LDAP connection pane, you can grant user groups in your corporate directory access to this gateway. The user groups can use the Lightweight Directory Access Protocol (LDAP) credentials to access the gateway. Then they can use the Amazon OpsHub for Amazon IoT SiteWise application, Amazon IoT SiteWise APIs, or other tools to manage the gateway. For more information, see Managing gateways

    Note

    You can also use the Linux credentials to access the gateway. For more information, see Accessing your gateway using Linux operating system credentials.

    1. Select Enable.

    2. For Provider name, enter a name for your LDAP provider.

    3. For Hostname or IP address, enter the hostname or IP address of your gateway device.

    4. For Port, enter a port number.

    5. For Base distinguished name (DN), enter a distinguished name (DN) for the base.

      The following attribute types are supported: commonName (CN), localityName (L), stateOrProvinceName (ST), organizationName (O), organizationalUnitName (OU), countryName (C), streetAddress (STREET), domainComponent (DC), and userid (UID).

    6. For Admin group DN, enter a DN.

    7. For User group DN, enter a DN.

  3. Choose Next.

Step 3: Configure publisher - optional

You can configure the publisher to control what data is sent to the cloud and the order that it's sent to the cloud. The Amazon IoT SiteWise publisher is an Amazon IoT Greengrass component that runs on your gateway device. For more information, see IoT SiteWise Publisher in the Amazon IoT Greengrass Version 2 Developer Guide.

To configure the publisher, use the Amazon IoT SiteWise console or API.

Console

To configure the publisher

  1. For Publishing order, choose one of the following.

    • Publish oldest data first – The gateway publishes the oldest data to the cloud first by default.

    • Publish newest data first – The gateway publishes the newest data to the cloud first.

  2. (Optional) Choose Exclude expired data.

  3. For Cutoff period, enter a number and choose a unit. The cutoff period must be between five minutes and seven days. For example, if the cutoff period is three days, data that's older than three days isn't published to the cloud.

  4. (Optional) Choose Local storage settings.

  5. For Retention period, enter a number and choose a unit. The retention period must be between one minute and 30 days, and greater than or equal to the rotation period. For example, if the retention period is 14 days, the gateway deletes any data at the edge that's older than the specified cutoff period after it's stored for 14 days.

  6. For Rotation period, enter a number and choose a unit. The rotation period must be greater than one minute, and equal to or less than the retention period. For example, if the rotation period is two days, the gateway batches up and saves data that is older than the cutoff period to a single file. The gateway also transfers a batch of data to the following local directory once every two days: /greengrass/v2/work/aws.iot.SiteWiseEdgePublisher/exports.

  7. For Storage capacity, enter a number that is greater than or equal to 1. If the storage capacity is 2 GB, the gateway starts deleting data when more than 2 GB of data is stored locally.

  8. Choose Next.

API

You can also use the UpdateGatewayCapabilityConfiguration API to configure the publisher. Set the capabilityNamespace parameter to iotsitewise:publisher:2.

The publisher provides the following configuration parameters that you can customize.

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.

Example publisher configuration

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

Step 4: Add data sources - optional

Data sources are local servers or industrial equipment that are connected to gateways. You can add data sources so that your gateway can ingest data from the OPC-UA servers to Amazon IoT SiteWise.

Note

Gateways running on Amazon IoT Greengrass V2 currently don't support Modbus TCP and Ethernet IP sources.

To add an OPC-UA source

  1. Choose Add data source.

  2. Enter a name for the source.

  3. Enter the Local endpoint of the data source server. The endpoint can be the IP address or hostname. You may also add a port number to the local endpoint. For example, your local endpoint might look like opc.tcp://203.0.113.0:49320.

  4. (Optional) For Node ID for selection, add node filters to limit which data streams are ingested to the Amazon Cloud. By default, gateways use the root node of a server to ingest all data streams. To define node filters, you can use node IDs and the * and ** wildcard characters.

  5. For Destinations, choose where the source data is sent.

    • Amazon IoT SiteWise ‐ Send data to Amazon IoT SiteWise. Choose this option if you want to process data at the edge.

    • Amazon IoT Greengrass stream manager ‐ Use Amazon IoT Greengrass stream manager to send data to the following Amazon cloud destinations: channels in Amazon IoT Analytics, streams in Amazon Kinesis Data Streams, asset properties in Amazon IoT SiteWise, or objects in Amazon Simple Storage Service (Amazon S3). For more information, see Manage data streams on the Amazon IoT Greengrass Core in Amazon IoT Greengrass Version 2 Developer Guide.

      Enter a name for the Amazon IoT Greengrass stream.

  6. In the Advanced configuration pane, do the following:

    1. (Optional) Enter a Data stream prefix. The gateway adds this prefix to all data streams from this source. Use a data stream prefix to distinguish between data streams that have the same name from different sources. Each data stream should have a unique name within your account.

    2. Choose a Message security mode for connections and data in transit between your source server and your gateway. This field is the combination of the OPC-UA security policy and message security mode. Choose the same security policy and message security mode that you specified for your OPC-UA server.

    3. If your source requires authentication, choose an Amazon Secrets Manager secret from the Authentication configuration list. The gateway uses the authentication credentials in this secret when it connects to this data source. You must attach secrets to your gateway's Amazon IoT Greengrass component to use them for data source authentication. For more information, see Configuring data source authentication.

      Tip

      Your data server might have an option named Allow anonymous login. If this option is Yes, then your source doesn't require authentication.

    4. For Property groups, choose Add new group.

    5. Enter a Name for the property group.

    6. For Properties:

      1. (Optional) For Node paths, add OPC-UA node filters to limit which OPC-UA paths are uploaded to Amazon IoT SiteWise. You can use node filters to reduce your gateway's startup time and CPU usage by only including paths to data that you model in Amazon IoT SiteWise. By default, gateways upload all OPC-UA paths except those that start with /Server/. To define OPC-UA node filters, you can use node paths and the * and ** wildcard characters. For more information, see Using OPC-UA node filters.

    7. For Group settings, do the following:

      1. Starting for Amazon IoT SiteWise OPC-UA collector 2.1.x:

        1. (Optional) For DataQuality, choose the type of data quality that you want Amazon IoT SiteWise Collector to ingest.

        2. (Optional) For Subscription, configure following standard subscription properties:

          • DataChangeTrigger ‐ You can define the condition that initiates a data change alert.

          • QueueSize ‐ The depth of the queue on an OPC‐UA server for a particular metric where notifications for monitored items are queued.

          • PublishingIntervalMilliseconds ‐ The interval (in milliseconds) of publishing cycle specified when subscription is created.

          • SnapshotFrequencyMilliseconds ‐ You can configure the snapshot frequency timeout setting to ensure that Amazon IoT SiteWise Edge ingests a steady stream of data.

      2. For Scan mode, choose the mode that you want Amazon IoT SiteWise to use to collect your data. For more information about scan mode, see Filter data ingestion ranges with OPC-UA.

      3. For Scan rate, update the rate that you want the gateway to read your registers. Amazon IoT SiteWise automatically calculates the minimum allowable scan rate for your gateway.

      4. (Optional) configure a Deadband setting for your source. This controls what data your source sends to your Amazon IoT SiteWise, and what data it discards. For more information about the deadband setting, see Filter data ingestion ranges with OPC-UA.

    8. Choose Add.

  7. Choose Next.

Step 5: Review and generate an installer

In this step, you review the configuration of your gateway, and then do the following:

  1. Choose one of the following operating systems:

    • Amazon Linux

    • Red hat

    • Ubuntu

    • Windows Server

  2. Choose Generate.

  3. In the dialog box, choose Acknowledge.

Amazon IoT SiteWise automatically generates an installer that you can use to configure your gateway device. Make sure that you save the installer file in a secure location. You will use the file later.