esp-aws-iot icon indicating copy to clipboard operation
esp-aws-iot copied to clipboard

Core MQTT error on WiFi disconnect (CA-304)

Open esp32person opened this issue 2 years ago • 1 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

esp32person avatar Jul 24 '23 19:07 esp32person

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.

SolidStateLEDLighting avatar Jul 26 '23 14:07 SolidStateLEDLighting