1 回答
- 最新
- 投票最多
- 评论最多
0
You should be able to get a thing name from an env variable AWS_IOT_THING_NAME
inside a GGv2 component and construct a topic which looks something like this AWS_IOT_THING_NAME/message/response
where you can send the back the info to.
You will also have the info from which topic the message got received into in a lambda function payload, thus you can know where to send it back.
已回答 1 年前
相关内容
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 3 年前
- AWS 官方已更新 1 年前
Do I have to specify anything in recipe.json to get AWS_IOT_THING_NAME ?? I am using AWS Java SDK. In component what am I suppose to write to fetch the AWS_IOT_THING_NAME. Is it something like system.getEnvironment(AWS_IOT_THING_NAME) ??
https://docs.aws.amazon.com/greengrass/v2/developerguide/component-environment-variables.html
You don't need to do anything special.
AWS_IOT_THING_NAME
is provided as a regular environment variable.