I am using nrf connect SDK version 1.4.2 and the AWS_IOT api to send data to an AWS IOT mqtt broker.
When our device boots, it correctly connects to AWS. However, when trying to disconnect from AWS, we receive error code -128 from the function aws_iot_disconnect().
If we then try to reconnect to AWS, the connection fails from the function aws_iot_connect() with error code -119.
A subsequent call to aws_iot_disconnect appears successful.
As for the next attempt at connecting to AWS, the device output indicates that it has connected successfully, but no data is ever sent.
Finally, when attempting a third disconnection from aws iot, the device deadlocks because it attempts to aqcuire an mqtt_mutex that is not available.
It seems that there many be multiple bugs at work here, but any advice on general conditions that cause aws iot connect and disconnect functions to fail?