knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.82k stars 1.47k forks source link

Loosing MQTT connection every ~14 hours #883

Open I-Connect opened 3 years ago

I-Connect commented 3 years ago

Hi,

We have a sim7000 on a esp32 running mqttloop() in a task every 200 ms.

see https://github.com/vshymanskyy/TinyGSM/issues/574

After approx 14 hours we every time loose MQTT connection, reconnecting GRPS goes oke but reconnecting MQTT fails. A power cycle of the SIM7000 solves the issue, reconnecting and sending goes oke again.

Any ideas what can be the cause or in which direction to troubleshoot (as it only happens once every 14 hours...)

thx!

dzungpv commented 2 years ago

I have same problem but it shorter, try to add code to soft reboot the chip with ESP.restart() or check gprs connection and call: modem.gprsConnect(apn, gprsUser, gprsPass)