AWS IoT Greengrass Version 1 entered the extended life phase on June 30, 2023. For more information, see the AWS IoT Greengrass V1 maintenance policy. After this date, AWS IoT Greengrass V1 won't release updates that provide features, enhancements, bug fixes, or security patches. Devices that run on AWS IoT Greengrass V1 won't be disrupted and will continue to operate and to connect to the cloud. We strongly recommend that you migrate to AWS IoT Greengrass Version 2, which adds significant new features and support for additional platforms.
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.
Note
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.
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 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*$|\/.
MaximumBufferSize
-
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]+
CapabilityConfiguration
-
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": "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 (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/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.