Sunday 8 November 2020

Can you call publish_get_named_shadow against AWS IoT GreenGrass Core

tl;dr: Calling publish_get_named_shadow on an IotShadowClient connected to an IoT GreenGrass Core causes an AWS_ERROR_MQTT_CONNECTION_SHUTDOWN error; I think it's a bug, but maybe I'm doing something wrong?

Context: I'm using the AWS IoT Device SDK for Python V2, running the IoT GreenGrass Core software on a Raspberry Pi. I have a pretty simple use-case of running a couple sensors attached to the Pi and publishing readings using MQTT, and I want to use the device shadow for state-management.

When I run my script using the AWS IoT cloud endpoint as the host (rather than my GreenGrass Core) everything works perfectly; when I change the connection to my GGC endpoint, the script throws an error when I call publish_get_named_shadow, but everything else (non-shadow MQTT subscribe/publish) works. I opened an issue on the GitHub repo for the API a couple weeks ago, but haven't yet received any replies: https://github.com/aws/aws-iot-device-sdk-python-v2/issues/125. The script and output of it are in the GitHub issue.

At this point, my work-around is to maintain two separate MQTT connections - one to the GGC, and one to the IoT cloud endpoint, which is used only for device shadow operations. This works, but it means I can't do any shadow interactions unless the device has Internet connectivity, defeating the purpose of using GGC.

Has anyone managed to do shadow operations against a GGC device using the aws-iot-device-sdk-python-v2 library?



from Can you call publish_get_named_shadow against AWS IoT GreenGrass Core

No comments:

Post a Comment