Get state of connection with AWS IoT in Greengrass component.

0

How can I get status of connection with the cloud in a custom Greengrass component?

질문됨 2년 전394회 조회
3개 답변
1

another option is to send a message to a ping/request topic to iot-core and have a lambda send a reply to the originator on a ping/response topic. i know..not a great solution, but at least you know within a configurable time that you've lost connection

clogwog
답변함 2년 전
  • I did similar solution. My component posts to a ping topic and subscribe to it at the same time. I the component doesn't get its messages I know that we lose the internet connection.

1

Hi Oleksandr,

There is no official way to get the MQTT connection state in a component, though if you visit us on Github we'd be more than happy to have a technical discussion with you on that.

One configuration knob that may be interesting to you is the keepQos0WhenOffline configuration option which can instruct Nucleus to drop QoS 0 MQTT messages if it is disconnected. While this doesn't directly address your question, there are a number of scenarios where it doesn't make sense to buffer messages to be sent at a later time.

https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html

Thanks, -joe

AWS
답변함 2년 전
0

Thanks for answering
The keepQos0WhenOffline is a good parameter and can be used in some cases. In my case, I need to indicate status of the connection on the led indicator.
So I think it will be easier to check only the internet connection.

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠