aws / aws-iot-device-sdk-embedded-C

SDK for connecting to AWS IoT from a device using embedded C.
MIT License
977 stars 628 forks source link

Publishing messages often results in errors #1871

Closed ZL-LF closed 1 year ago

ZL-LF commented 1 year ago

Publishing messages often results in errors The corresponding error code MQTT_CLIENT_NOT_IDLE_ERROR = -30

ZL-LF commented 1 year ago

I want to know what causes this mistake

AniruddhaKanhere commented 1 year ago

Hello @ZL-LF it seems that you might be trying to access the AWS_IoT_Client from multiple tasks which only supports one operation at a time. Is that the case? If so, then you would need to use a queue to serialize your operations OR use a mutex to get exclusive access to the resource. If that is not the case, then can you please let us know how often are you trying to publish messages and from how many threads?

AniruddhaKanhere commented 1 year ago

Since this has been open for quite a while without an answer, I am closing this issue. @ZL-LF feel free to reopen this issue or open a new one if you are still facing this problem.