Only receiving messages from MQTTSubscribe when next MQTTPublish is happening

fmuller-pi
Posts: 20
Joined: Wed Jan 23, 2019 8:41 am

Only receiving messages from MQTTSubscribe when next MQTTPublish is happening

Postby fmuller-pi » Thu Apr 11, 2019 9:07 am

Hi,

I am using an MQTT connection to communicate with my Cloud. Everything works pretty well I would say, except for the messages coming from the Cloud to my ESP. After I connect successfully to the Cloud with MQTT, I do a MQTTSubscribe (where I pass my message handler for incoming messages from the Cloud) that is successful. And then I do MQTTPublish when I need t post something to the Cloud. The problem is that ESP seems to be processing coming from the Cloud in my message handler only when I do a publish. Which is quite annoying cause I don't publish all the time and this can delay a lot the processing of my message from the Cloud. Any idea why my code could be acting that way? I am using the latest ESP_RTOS_SDK, and following their MQTTEcho example, and I checked on the Cloud side and I am certain the message leaves the Cloud right away when it needs to be sent.
So the problem is definitely on the ESP side...

Thanks for your help!

fmuller-pi
Posts: 20
Joined: Wed Jan 23, 2019 8:41 am

Re: Only receiving messages from MQTTSubscribe when next MQTTPublish is happening

Postby fmuller-pi » Thu Apr 18, 2019 2:17 am

Anyone having a suggestion on this?

I looked in there SDK, and to me, when looking at the function cycle() in the MQTTCLient.c file, it feels like there are only processing delivered MQTT messages when the switch case PUBLISH happens... Which would validate the behaviour I am observing here. Am I right? Or am I missing something?

Thanks,

Who is online

Users browsing this forum: Bing [Bot] and 4 guests