

支援終止通知：2026 年 10 月 7 日 AWS 將停止 的支援 AWS IoT Greengrass Version 1。2026 年 10 月 7 日之後，您將無法再存取 AWS IoT Greengrass V1 資源。如需詳細資訊，請造訪[從 遷移 AWS IoT Greengrass Version 1](https://docs.aws.amazon.com/greengrass/v2/developerguide/migrate-from-v1.html)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# IoT 乙太網路 IP 通訊協定轉接器連接器
<a name="ethernet-ip-connector"></a>

IoT 乙太網路 IP 通訊協定轉接器[連接器](connectors.md)會使用乙太網路/IP 通訊協定從本機裝置收集資料。您可以使用此連接器從多個裝置收集資料，並將其發佈至`StreamManager`訊息串流。

您也可以將此連接器與 IoT SiteWise 連接器和 IoT SiteWise 閘道搭配使用。您的閘道必須提供連接器的組態。如需詳細資訊，請參閱 IoT SiteWise 使用者指南中的[設定乙太網路/IP (EIP) 來源](https://docs.aws.amazon.com/iot-sitewise/latest/userguide/configure-eip-source.html)。

**注意**  
此連接器以[無容器](lambda-group-config.md#no-container-mode)隔離模式執行，因此您可以將其部署到在 Docker 容器中執行的 AWS IoT Greengrass 群組。

此連接器具有下列版本。


| 版本 | ARN | 
| --- | --- | 
| 2 （建議） | `arn:aws:greengrass:region::/connectors/IoTEIPProtocolAdaptor/versions/2` | 
| 1 | `arn:aws:greengrass:region::/connectors/IoTEIPProtocolAdaptor/versions/1` | 

如需版本變更的詳細資訊，請參閱 [Changelog](#ethernet-ip-connector-changelog)。

## 要求
<a name="ethernet-ip-connector-req"></a>

此連接器有下列要求：

------
#### [ Version 1 and 2 ]
+ AWS IoT Greengrass 核心軟體 1.10.2 版或更新版本。
+  AWS IoT Greengrass 群組上已啟用串流管理員。
+ 安裝在核心裝置上並新增至`PATH`環境變數的 Java 8。
+ 至少 256 MB 的額外 RAM。此需求是 AWS IoT Greengrass 核心記憶體需求以外的需求。

**注意**  
 此連接器僅適用於下列區域：  
cn-north-1
ap-southeast-1
ap-southeast-2
eu-central-1
eu-west-1
us-east-1
us-west-2

------

## 連接器參數
<a name="ethernet-ip-connector-param"></a>

此連接器支援下列參數：

`LocalStoragePath`  
IoT SiteWise 連接器可寫入持久性資料的 AWS IoT Greengrass 主機目錄。預設目錄為 `/var/sitewise`。  
 AWS IoT 主控台中的顯示名稱：**本機儲存路徑**  
必要： `false`  
類型：`string`  
有效模式： `^\s*$|\/.`

`ProtocolAdapterConfiguration`  
連接器從 收集資料或連線的一組乙太網路/IP 收集器組態。這可以是空白清單。  
 AWS IoT 主控台中的顯示名稱：**通訊協定轉接器組態**  
必要： `true`  
類型：格式正確的 JSON 字串，定義一組支援的意見回饋組態。

 以下是 的範例`ProtocolAdapterConfiguration`：

```
{
    "sources": [
        {
            "type": "EIPSource",
            "name": "TestSource",
            "endpoint": {
                "ipAddress": "52.89.2.42",
                "port": 44818
            },
            "destination": {
                "type": "StreamManager",
                "streamName": "MyOutput_Stream",
                "streamBufferSize": 10
            },
            "destinationPathPrefix": "EIPSource_Prefix",
            "propertyGroups": [
                {
                    "name": "DriveTemperatures",
                    "scanMode": {
                        "type": "POLL",
                        "rate": 10000
                    },
                    "tagPathDefinitions": [
                        {
                            "type": "EIPTagPath",
                            "path": "arrayREAL[0]",
                            "dstDataType": "double"
                        }
                    ]
                }
            ]
        }
    ]
}
```

### 建立範例連接器 (AWS CLI)
<a name="eip-connector-create"></a>

下列 CLI 命令`ConnectorDefinition`會使用包含 IoT 乙太網路 IP 通訊協定轉接器連接器的初始版本來建立 。

```
aws greengrass create-connector-definition --name MyGreengrassConnectors --initial-version 
'{
    "Connectors": [
        {
            "Id": "MyIoTEIPProtocolConnector",
            "ConnectorArn": "arn:aws:greengrass:region::/connectors/IoTEIPProtocolAdaptor/versions/2",
            "Parameters": {
                "ProtocolAdaptorConfiguration": "{ \"sources\": [{ \"type\": \"EIPSource\", \"name\": \"Source1\", \"endpoint\": { \"ipAddress\": \"54.245.77.218\", \"port\": 44818 }, \"destinationPathPrefix\": \"EIPConnector_Prefix\", \"propertyGroups\": [{ \"name\": \"Values\", \"scanMode\": { \"type\": \"POLL\", \"rate\": 2000 }, \"tagPathDefinitions\": [{ \"type\": \"EIPTagPath\", \"path\": \"arrayREAL[0]\", \"dstDataType\": \"double\" }]}]}]}",
                "LocalStoragePath": "/var/MyIoTEIPProtocolConnectorState"
            }
        }
    ]
}'
```

**注意**  
此連接器中的 Lambda 函數具有[長期生命週期](lambda-functions.md#lambda-lifecycle)。

## 輸入資料
<a name="ethernet-ip-connector-data-input"></a>

此連接器不接受 MQTT 訊息做為輸入資料。

## 輸出資料
<a name="ethernet-ip-connector-data-output"></a>

此連接器會將資料發佈至 `StreamManager`。您必須設定目的地訊息串流。輸出訊息的結構如下：

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

## 授權
<a name="ethernet-ip-connector-license"></a>

IoT 乙太網路 IP 通訊協定轉接器連接器包含下列第三方軟體/授權：
+ [Ethernet/IP 用戶端](https://github.com/digitalpetri/ethernet-ip/blob/master/LICENSE)
+ [MapDB](https://github.com/jankotek/mapdb/blob/master/LICENSE.txt)
+ [斯德羅](https://github.com/jankotek/elsa/blob/master/LICENSE.txt)

此連接器根據 [Greengrass 核心軟體授權合約](https://greengrass-release-license.s3.us-west-2.amazonaws.com/greengrass-license-v1.pdf)發行。

## 變更記錄
<a name="ethernet-ip-connector-changelog"></a>

下表說明連接器每個版本中的變更。


| 版本 | 改變 | 日期 | 
| --- | --- | --- | 
| 2 | 此版本包含錯誤修正。 | 2021 年 12 月 23 日 | 
| 1 | 初始版本。 | 2020 年 12 月 15 日 | 

<a name="one-conn-version"></a>Greengrass 群組一次只能包含一個版本的連接器。若要取得有關升級連接器版本的資訊，請參閱[升級連接器版本](connectors.md#upgrade-connector-versions)。

## 另請參閱
<a name="ethernet-ip-connector-see-also"></a>
+ [使用 Greengrass 連接器來整合服務和通訊協定](connectors.md)
+ [Greengrass 連接器入門 (主控台)](connectors-console.md)
+ [Greengrass 連接器入門 (CLI)](connectors-cli.md)