espressif / esp-aws-iot

AWS IoT SDK for ESP32 based chipsets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Core MQTT error on WiFi disconnect (CA-304)

esp32person opened this issue · comments

Hi,

When Wifi disconnects, I am getting the repeating error below,

E (115491) coreMQTT: Call to receiveSingleIteration failed. Status=MQTTRecvFailed
E (116001) esp-tls-mbedtls: read error :-0x004C:
E (116001) coreMQTT: Call to receiveSingleIteration failed. Status=MQTTRecvFailed
E (116501) esp-tls-mbedtls: read error :-0x004C:
....

Closing MQTT broker and server connection when WiFi fails and restarting server and Mqtt broker connection, fails to connect even after wifi connection is restored and the error keeps repeating. A restart fixes the issue.

Any ideas what I could do on wifi disconnect?

Thanks

You render SNTP invalid and you send a notification to MQTT to shut down.

Upon Wifi, reconnect, you first restart SNTP and allow it to validate your system time, and then start MQTT again.