Configuring Edge device for direct or via gateway communication

0

Hello,
I would to know about the aggregation/gateway functionality of Greengrass and how I could apply this in the following scenario.
I have setup a single Greengrass core device, A group and a core and I have added 2 devices (AWS IOT SDK is running in 2 ubuntu 18.04 Docker containers on a physical machine in the same network as the Greengrass core device). The communication between the edge devices (containers) and the IoT Core is working fine with MQTT message sent and recieved both by edge devices and IoT core.
I would like to know

  1. if the MQTT messages could be made to be sent through the Greengrass core device acting as a gateway instead of direct connectivity to the IoT core from the edge device.
  2. Could the edge device be configured so that communication can be switched between direct connectivity and via the gateway/aggregator based on presence of internet connectivity between edge device and IoT core?

Thank you,

已提問 3 年前檢視次數 224 次
2 個答案
0

Hi,

  1. if the MQTT messages could be made to be sent through the Greengrass core device acting as a gateway instead of direct connectivity to the IoT core from the edge device.

Greengrass V1 supports Greengrass Aware Device (GGAD) which are Greengrass aware IoT Things. GGAD's can send messages to IoT Core via GGC Core (Greengrass core device acting as a gateway). Developer guide : https://docs.aws.amazon.com/greengrass/latest/developerguide/module4.html

Greengrass V2 unfortunately does not provide GGAD yet. We are actively working on addressing this gap and hope to release it in the coming months. Until that time, you can use Greengrass version 1 or you could use this example code for V2 (https://github.com/aws-greengrass/aws-greengrass-component-examples/tree/main/mqtt-bridge) as a skeleton for implementing your own MQTT broker on V2 in order to support remote devices.

Could the edge device be configured so that communication can be switched between direct connectivity and via the gateway/aggregator based on presence of internet connectivity between edge device and IoT core?

The option for GGAD to switch between direct connectivity and connecting via Greengrass core based on internet connectivity is NOT supported.

Regards,
Fahad

已回答 3 年前
0

Thank you for your reply Fahad,

I noticed that even when the GG core is not started, the GGADs of the group can send messages to IoT core.

Please let me know how I could strictly route the messages via the Greengrass core when internet connectivity of one or both of the GGAD's is disrupted. Im guessing i would have to have a Lambda running on the Greengrass core that subscribes to a common topic which all GGAD's publish to, The GG core will then publish that to another topic which can be subscribed by the IoT core. The IoT core will have all the subscriptions setup for the above communication paths. Is this possible?

Also please point me to resources where the GG core is used as a gateway to multiple GGAD's. I do not need inter-device communication in my use-case.

Edited by: avikurup on Feb 3, 2021 5:49 AM

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南