1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
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.
beantwortet vor einem Jahr
Relevanter Inhalt
- Wie veröffentliche ich MQTT-Nachrichten von meinem Gerät auf AWS IoT Core, wenn ich Python verwende?AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor einem Jahr
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.