plapointe6 / EspMQTTClient

Wifi and MQTT handling for ESP8266 and ESP32
GNU General Public License v3.0
430 stars 128 forks source link

MQTT Disconnects after a few minutes with the WS2812FX library and the device reboots after several retries. #134

Open my-reminiscence opened 6 months ago

my-reminiscence commented 6 months ago

Description of the problem

  1. When I use the sketch without ws2812fx.service(); in loop() then everything works fine for several hours but when I include ws2812fx.service(); in loop() then MQTT disconnects after few minutes.
  2. Then it started to try reconnecting, after several minutes it says "MQTT!: Can't connect to broker after too many attempt, resetting WiFi".
  3. After several retries connecting with wifi, it reboots the device.
  4. I tried the same ESP01 and ESP12F.

Versions

Hardware

Logs

MQTT!: Can't connect to broker after too many attempt, resetting WiFi.

C++ code


void loop()
{
  client.loop();
  ws2812fx.service();
}
my-reminiscence commented 6 months ago
MQTT: Retrying to connect in 15 seconds.
11:36:34.274 -> MQTT!: Failed MQTT connection count: 6 
11:36:47.171 -> 
11:36:47.171 ->  ets Jan  8 2013,rst cause:4, boot mode:(3,6)
11:36:47.231 -> 
11:36:47.231 -> wdt reset
11:36:47.231 -> load 0x4010f000, len 3424, room 16 
11:36:47.231 -> tail 0
11:36:47.231 -> chksum 0x2e
11:36:47.231 -> load 0x3fff20b8, len 40, room 8 
11:36:47.231 -> tail 0
11:36:47.231 -> chksum 0x2b
11:36:47.231 -> csum 0x2b
11:36:47.231 -> v00060050
11:36:47.231 -> ~ld
EdJoPaTo commented 6 months ago

Can you recreate this with PubSubClient directly (= without EspMQTTClient)?

It doesn't seem like its related to this library directly to me…

my-reminiscence commented 6 months ago

Same issue with PubSubClient. I found that when I'm connecting with a mobile hotspot it's working fine but when I connect with a broadband (Airtel Fiber) router then it's occurring. I checked unique device id, client id, hostname but it's happening.