I am using the ESP8266_RTOS_SDK_2.x.x version and I connect to my cloud (Google Cloud) using MQTT secured protocol. The flow of functions I call is chronological as follow:
1) NetworkInitSSL()
2) MQTTClientInit()
3) NetworkConnectSSL()
4) MQTTConnectWithResults()
5) MQTTSubscribe()
6) MQTTPublish()
Everything works just fine, and I can see that my messages are published to the cloud with no issue.
My problem happens if, for example, I publish a message that doesn't make it through (could happen for various reasons). Then MQTTPublish() returns an error code and the function closes the session by calling
Code: Select all
MQTTCloseSession(c)
Code: Select all
MQTTDisconnect(&client)
Any thoughts on what I could be doing wrong here? I would really appreciate some help.
Thanks!