2 Answers
- Newest
- Most votes
- Most comments
3
By chance are you using the aws-iot-device-sdk-python library? And then also sending the shadow update message in the same thread that receives a IoT topic (including receiving other shadow updates)? For reasons I have never fully understood, sending a IoT message in the callback thread (after receiving a message on a subscription) will throw a publish timeout error. If this is the case there are a couple of things you can do to try and resolve the problem.
- Spin up a worker thread to publish your shadow changes.
- Migrate your code to the newer [aws-iot-device-sdk-python-v2 library] (https://github.com/aws/aws-iot-device-sdk-python-v2).
A couple of further general suggestions to try and help narrow down the causes.
- Since publishing to IoT Shadows are really just publishing messages to special IoT topics, test whether or not you can consistently publish to a non-shadow topic. This will tell you if it's a problem with the shadow service or a general problem with IoT publishing.
- Make sure you are publishing with QoS 1, which sends back receive receipts.
- Set your code up such that if you get a publish timeout do a ping to your IoT endpoint. If the ping times out, this would tell you the problem is general networking versus IoT.
answered 2 years ago
0
There was an update to the sdk in december 2021 which fixed the issue for me. Currently (Jan. 2022) you need to install it manually from github to use it.
answered 2 years ago
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
Your first suggestion already did the trick, thank you very much!
Well, it seemingly only helped for some time, now the timeouts are back