philbowles / PangolinMQTT

PangolinMQTT - ArduinoIDE client library for ESP8266, ESP32 and STM32-NUCLEO
Other
71 stars 21 forks source link

Problem with reconnect, if Internet lost #35

Closed rtprof closed 3 years ago

rtprof commented 3 years ago

Hello. I use the latest version (1.0.1) and have the problem with reconnect. I blocked an Internet access for the esp8266 and after few minutes opened it

D:1: CONNECTING to m16.cloudmqtt.com:15381 as esp8266-E48296 FH=14832 session=1 14:02:35.092 -> D:4: We are now clean:) 14:02:35.092 -> D:2: ----> TX CONNECT 95 bytes 14:02:35.264 -> Address: 0x3FFF35FC len: 0x5F (95) 14:02:35.264 -> [0x3FFF35FC] 0x00000000: **** some data **** some data 14:02:35.300 -> [0x3FFF364C] 0x00000050: 64 00 0C 62 42 4E 62 76 57 78 75 64 66 36 65 d..bBNbvWxudf6e 14:02:35.438 -> D:4: <---- RX CONNACK 3FFF6F6A len=4 14:02:35.472 -> Address: 0x3FFF6F6A len: 0x4 (4) 14:02:35.472 -> [0x3FFF6F6A] 0x00000000: 20 02 00 00 ... 14:02:35.472 -> D:2: <---- RX CONNACK 3FFF6F6A len=4 14:02:35.472 -> Address: 0x3FFF6F6A len: 0x4 (4) 14:02:35.472 -> [0x3FFF6F6A] 0x00000000: 20 02 00 00 ... 14:02:35.472 -> D:1: CONNECTED FH=14832 MaxPL=5368 SESSION CLEAN 14:02:35.472 -> Connected to MQTT. 14:02:35.472 -> Session present: 0 14:02:36.769 -> D:1: T=2880731 SRV GONE? ka=30 tix=46 14:02:59.531 -> D:1: ON DISCONNECT FH=11624 r=1 14:02:59.531 -> D:4: CLEAR 0 FRAGMENTS 14:02:59.531 -> Disconnected from MQTT. 14:03:00.828 -> D:1: TCP CHOPPED US! 14:03:21.288 -> D:1: ON DISCONNECT FH=14832 r=0 14:03:21.288 -> D:4: CLEAR 0 FRAGMENTS 14:03:21.288 -> Disconnected from MQTT.

poulch74 commented 3 years ago

https://github.com/philbowles/PangolinMQTT/issues/33

philbowles commented 3 years ago

This should be fixed by v2

Wollwolke commented 3 years ago

Unfortunately, I still have the problem with v2. Even after redownload ESPAsyncTCP and Pangolin. I tried to get the Quickstart Example with a reconnect delay of over 30s to work, but the result is the same as rtprof's.

AcuarioCat commented 3 years ago

I'm also having reconnect problems after loss of internet. On previous versions it worked ok. I get disconnect reasons of 8 and 9 when trying to reconnect. Rebooting reconnects correctly.

HamzaHajeir commented 1 year ago

If any need, all can checkout this Pangolin-based fork H4AsyncMQTT.