- Newest
- Most votes
- Most comments
Hi. SubscribeToTopic and PublishToTopic are for local communications to other components on Greengrass. To interact with AWS IoT Core, there are different IPC methods: https://docs.aws.amazon.com/greengrass/v2/developerguide/ipc-iot-core-mqtt.html
Yeah, this is exactly the code I'm trying to get to work. I'm using Nuc version 2.12.2. The example code is not working for me -- only for the publish.
answered 2 years ago
Hey Will, One thing you can check is to make sure you have the proper "accessControl" policies setup for your component.
You can use this documentation section as a guide for example code and how to publish and subscribe to topics using the ipc_client. https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html
answered 2 years ago
This is my access control policy in my custom component: "accessControl": { "aws.greengrass.ipc.pubsub": { "com.thio.coredevice.thio_bp:pubsub:1": { "policyDescription": "Allows access to publish/subscribe to topics.", "operations": [ "aws.greengrass#SubscribeToTopic", "aws.greengrass#PublishToTopic" ], "resources": [ "thio_bin_demo" ] }, "com.thio.coredevice.thio_bp:pubsub:2": { "policyDescription": "Allows access to publish/subscribe to topics.", "operations": [ "aws.greengrass#SubscribeToTopic", "aws.greengrass#PublishToTopic" ], "resources": [ "thio_bin_demo/request" ] } } },
answered 2 years ago
Relevant content
- AWS OFFICIALUpdated 6 months ago

You can merge the resources together so you only have 1 policy block in the access control:
"resources": [ "thio_bin_demo", "thio_bin_demo/request"]Could you provide the code block you are using to publish and subscribe with. Are you using the same component to publish and subscribe, i.e communicate with itself? The IPC is used to communicate information between different components and/or to IoT Core. Where are your messages coming from which you are testing with?