How to retreive GreengrassV2 Core Device's AWS IoT Thing name

0

When working with already-configured GreengrassV2 core devices (and therefore the associated AWS IoT Thing), how should one go about the local identification of a physical device that's been registered? The Greengrass CLI (https://docs.aws.amazon.com/greengrass/v2/developerguide/gg-cli-reference.html) has no method to describe how the local device is registered to the cloud, and the AWS CLI greengrassv2 command does not help identify "which physical device corresponds to the registered core-device".

Consider a scenario where someone has 5 unmarked Raspberry Pi's set up as core devices. Each is registered as a Greengrass core device / IoT Thing. How can one best cross-reference which Raspberry Pi corresponds to which core device definition?

I see in a recent documentation update, that in a component lifecycle script, a number of environment variables are automatically set including AWS_IOT_THING_NAME. However, these don't seem to be available outisde of a lifecycle script. Is there a configuration file that stores that information which could easily be accessed, outside of the context of a lifecycle script? Is there a local utility installed that can print out this information?

I feel like there must be some simple way to SSH into a physical device and quickly identify which IoT Thing it is. Or am I wrong?

질문됨 3년 전930회 조회
2개 답변
0
수락된 답변

Hi,
The correct and the recommended way of knowing the thing name within the Greengrass scope is by using the AWS_IOT_THING_NAME environment variable. However, as you mentioned it already - you can read the effective config file at <greengrass-root>/config/effectiveConfig.yaml to know the thingName under system property outside of Greengrass.

Thanks,
Saranya

AWS
Saranya
답변함 3년 전
0

As a follow-up, I now see that there is an "effective config" file in the Greengrass root directory (/greengrass/v2/config/effectiveConfig.yaml on my system after following the current quick-start installation instructions).

In that YAML file, there is a section system.thingName which shows the currently registered name.

Is this the appropriate place to find this information?

답변함 3년 전
  • Just wondering if you explored this idea of reading the config file?

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

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

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