espressif / esp-mqtt

ESP32 mqtt component
Apache License 2.0
610 stars 257 forks source link

MQTT - Unable to send Disconnect ACKs #60

Closed Sedwin97 closed 6 years ago

Sedwin97 commented 6 years ago

Hi,

I'm working on research with a PhD student and I need to run an MQTT protocol with Wifi Power Save Mode on the Sparkfun ESP32 Thing board. We are using an unsecured WiFi network and simply connecting to an MQTT broker on a raspberry pi, publishing a message, and disconnecting.

I have been unable to see Disconnect ACKs (using Wireshark). I went through the API and I'm not sure why this is a problem. I can see a Connect Command and ACK and also a publish packet but the Disconnect never happens. This library is based on the lwmqtt and I noticed their header file mentioned the disconnect ack so I assumed this library worked similarly. Am I doing something wrong in my code?

I'm also seeing a ton of out-of-order, dup ack, and acked unseen segment packets. What might be causing that? (I'm still looking into this issue so it might be the fault of my AP or my broker)

Here is my code. I just put the low power WiFi example and the MQTT example together. https://gist.github.com/Sedwin97/308ab1f562fbd9984a67023ade0c194e

Sedwin97 commented 6 years ago

https://github.com/256dpi/esp-mqtt Used this library instead and it's working better