espressif / esp-aws-iot

AWS IoT SDK for ESP32 based chipsets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MQTT_Connect function trigger task watchdog (CA-283)

zhouyu2021 opened this issue · comments

If network condition not good, “MQTT_Connect” will cost more time, it wait for ack in block mode, no doubt it will trigger the task watchdog.

I have this call at the top of a code block which is runs in a task loop -- and I have never had a watchdog timeout at this location. I think you'll not see a WD timeout if you just handle the return code. However, I do want to point out that I don't wait around inside that call. The more often you are servicing the process loop, the faster you can receive or send your messages.

{
mqttStatus = MQTT_ProcessLoop(&_mqttContext, 0);

// handle all the possible results here or move to next mode of operation to send...etc.
vTaskDelay(pdMS_TO_TICKS(50));
}

In my experience, the MQTT_Connect() call will return with something like -- MQTTRecvFailed if you are somehow disconnected by the network.