Modbus-TCP Protocol Adapter connector - AWS IoT Greengrass

You are viewing the documentation for AWS IoT Greengrass Version 1. AWS IoT Greengrass Version 2 is the latest major version of AWS IoT Greengrass. For more information about using AWS IoT Greengrass Version 2, see the AWS IoT Greengrass V2 Developer Guide.

Modbus-TCP Protocol Adapter connector

The Modbus-TCP Protocol Adapter connector collects data from local devices through the ModbusTCP protocol and publishes it to the selected StreamManager streams.

You can also use this connector with the IoT SiteWise connector and your IoT SiteWise gateway. Your gateway must supply the configuration for the connector. For more information, see Configure a Modbus TCP source in the IoT SiteWise user guide.


This connector runs in No container isolation mode, so you can deploy it to a AWS IoT Greengrass group running in a Docker container.

This connector has the following versions.





For information about version changes, see the Changelog.


This connector has the following requirements:

Version 1
  • AWS IoT Greengrass Core software v1.10.2 or later.

  • Stream manager enabled on the AWS IoT Greengrass group.

  • Java 8 installed on the core device and added to the PATH environment variable.


This connector is only available in the following regions:

  • ap-southeast-1

  • ap-southeast-2

  • eu-central-1

  • eu-west-1

  • us-east-1

  • us-west-2

Connector Parameters

This connector supports the following parameters:


The directory on the AWS IoT Greengrass host that the IoT SiteWise connector can write persistent data to. The default directory is /var/sitewise.

Display name in the AWS IoT console: Local storage path

Required: false

Type: string

Valid pattern: ^\s*$|\/.


The maximum size in GB for IoT SiteWise disk usage. The default size is 10GB.

Display name in the AWS IoT console: Maximum disk buffer size

Required: false

Type: string

Valid pattern: ^\s*$|[0-9]+


The set of Modbus TCP collector configurations that the connector collects data from and connects to.

Display name in the AWS IoT console: CapabilityConfiguration

Required: false

Type: A well-formed JSON string that defines the set of supported feedback configurations.

The following is an example of a CapabilityConfiguration:

{ "sources": [ { "type": "ModBusTCPSource", "name": "SourceName1", "measurementDataStreamPrefix": "SourceName1_Prefix", "destination": { "type": "StreamManager", "streamName": "SiteWise_Stream_1", "streamBufferSize": 8 }, "endpoint": { "ipAddress": "", "port": 8081, "unitId": 1 }, "propertyGroups": [ { "name": "GroupName", "tagPathDefinitions": [ { "type": "ModBusTCPAddress", "tag": "TT-001", "address": "30001", "size": 2, "srcDataType": "float", "transformation": "byteWordSwap", "dstDataType": "double" } ], "scanMode": { "type": "POLL", "rate": 100 } } ] } ] }

Create Connector Example (AWS CLI)

The following CLI command creates a ConnectorDefinition with an initial version that contains the Modbus-TCP Protocol Adapter connector.

aws greengrass create-connector-definition --name MyGreengrassConnectors --initial-version ' { "Connectors": [ { "Id": "MyModbusTCPConnector", "ConnectorArn": "arn:aws:greengrass:region::/connectors/ModbusTCP/versions/1", "Parameters": { "capability_configuration": "{\"sources\": [{ \"type\": \"ModBusTCPSource\", \"name\": \"SourceName1\", \"measurementDataStreamPrefix\": \"SourceName1_Prefix\", \"destination\": { \"type\": \"StreamManager\", \"streamName\": \"SiteWise_Stream_1\", \"streamBufferSize\": 8 }, \"endpoint\": { \"ipAddress\": \"\", \"port\": 8081, \"unitId\": 1 }, \"propertyGroups\": [{ \"name\": \"PropertyGroupName\", \"tagPathDefinitions\": [{ \"type\": \"ModBusTCPAddress\", \"tag\": \"TT-001\", \"address\": \"30001\", \"size\": 2, \"srcDataType\": \"float\", \"transformation\": \"byteWordSwap\", \"dstDataType\": \"double\" }], \"scanMode\": { \"type\": \"POLL\", \"rate\": 100 }}]}]}", "local_storage_path": "/var/MyModbusTCPConnectorState" } } ] }'

The Lambda function in this connector has a long-lived lifecycle.

Input data

This connector doesn't accept MQTT messages as input data.

Output data

This connector publishes data to StreamManager. You must configure the destination message stream. The output messages are of the following structure:

{ "alias" : "string", "messages" : [ { "name": "string", "value": boolean|double|integer|string, "timestamp": number, "quality": "string" } ] }


The Modbus-TCP Protocol Adapter connector includes the following third-party software/licensing:

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


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




Initial release.

A Greengrass group can contain only one version of the connector at a time. For information about upgrading a connector version, see Upgrading connector versions.

See also