End of support notice: On October 7th, 2026, Amazon will discontinue support for Amazon IoT Greengrass Version 1. After October 7th, 2026, you will no longer be able to access the Amazon IoT Greengrass V1 resources. For more information, please visit Migrate from Amazon IoT Greengrass Version 1.
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
Note
This connector runs in No container isolation mode, so you can deploy it to a Amazon IoT Greengrass group running in a Docker container.
This connector has the following versions.
Version |
ARN |
|---|---|
3 |
|
2 |
|
1 |
|
For information about version changes, see the Changelog.
Requirements
This connector has the following requirements:
Connector Parameters
This connector supports the following parameters:
LocalStoragePath-
The directory on the Amazon IoT Greengrass host that the IoT SiteWise connector can write persistent data to. The default directory is
/var/sitewise.Display name in the Amazon IoT console: Local storage path
Required:
falseType:
stringValid pattern:
^\s*$|\/. MaximumBufferSize-
The maximum size in GB for IoT SiteWise disk usage. The default size is 10GB.
Display name in the Amazon IoT console: Maximum disk buffer size
Required:
falseType:
stringValid pattern:
^\s*$|[0-9]+ CapabilityConfiguration-
The set of Modbus TCP collector configurations that the connector collects data from and connects to.
Display name in the Amazon IoT console: CapabilityConfiguration
Required:
falseType: 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": "127.0.0.1", "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 (Amazon 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/3", "Parameters": { "capability_configuration": "{\"version\":1,\"namespace\":\"iotsitewise:modbuscollector:1\",\"configuration\":\"{\"sources\":[{\"type\":\"ModBusTCPSource\",\"name\":\"SourceName1\",\"measurementDataStreamPrefix\":\"\",\"endpoint\":{\"ipAddress\":\"127.0.0.1\",\"port\":8081,\"unitId\":1},\"propertyGroups\":[{\"name\":\"PropertyGroupName\",\"tagPathDefinitions\":[{\"type\":\"ModBusTCPAddress\",\"tag\":\"TT-001\",\"address\":\"30001\",\"size\":2,\"srcDataType\":\"hexdump\",\"transformation\":\"noSwap\",\"dstDataType\":\"string\"}],\"scanMode\":{\"rate\":200,\"type\":\"POLL\"}}],\"destination\":{\"type\":\"StreamManager\",\"streamName\":\"SiteWise_Stream\",\"streamBufferSize\":10},\"minimumInterRequestDuration\":200}]}\"}" } } ] }'
Note
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" } ] }
Licenses
The Modbus-TCP Protocol Adapter connector includes the following third-party software/licensing:
Digital Petri
Modbus
This connector is released under the
Greengrass Core Software License Agreement
Changelog
The following table describes the changes in each version of the connector.
Version |
Changes |
Date |
|---|---|---|
3 (recommended) |
This version contains bug fixes. |
December 22, 2021 |
2 |
Added support for ASCII, UTF8, and ISO8859 encoded source strings. |
May 24, 2021 |
1 |
Initial release. |
December 15, 2020 |
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.