tuanpmt / esp_mqtt

MQTT client library for ESP8266
http://tuanpm.net/post/esp_mqtt/
MIT License
1.15k stars 401 forks source link

Disconnect after publish #120

Closed harryd100 closed 8 years ago

harryd100 commented 8 years ago

Hi, I converted one of my existing working (SDK 1.5.2) project to SDK 2.0.0 using the latest esp_mqtt, but see some strange behaviour. After publishing a message, every 10 sec, the MQTT connection is disconnected. Wifi stays up as I can still ping the ESP. Serial log says: MQTT: Published TCP: data received 5 bytes TCP: data received 123 bytes TCP: Disconnected callback MQTT: Disconnected TCP: Free memory TCP: Connect to ip 192.168.24.250:1883 TCP: Reconnect to: 192.168.24.250:1883 MQTT: Connected to broker 192.168.24.250:1883 MQTT: Sending, type: 1, id: 0000 TCP: Sent TCP: data received 4 bytes MQTT: Connected to 192.168.24.250:1883 MQTT: queue subscribe, topic"/Device/ESP_0432AC/in", id: 1 MQTT: queue subscribe, topic"/Device/ESP_0432AC/out", id: 2 MQTT: Sending, type: 8, id: 0001 TCP: Sent TCP: data received 5 bytes MQTT: Subscribe successful MQTT: Sending, type: 8, id: 0002 TCP: Sent TCP: data received 41 bytes MQTT: queuing publish, length: 123, queue size(0/2048) MQTT: Sending, type: 3, id: 0000 TCP: Sent MQTT: Published TCP: data received 5 bytes TCP: data received 123 bytes TCP: Disconnected callback MQTT: Disconnected

and so on

Any idea what is happening here?

harryd100 commented 8 years ago

never mind, found the issue

fargiolas commented 7 years ago

never mind, found the issue

Hi I've been seeing a similar issue, it would be really helpful if you could add a comment about what you did to fix it...