tuanpmt / esp32-mqtt

ESP32 MQTT sample project for
https://github.com/tuanpmt/espmqtt
Apache License 2.0
176 stars 50 forks source link

Device crash upon mqtt_destroy() #6

Open forthlightning opened 7 years ago

forthlightning commented 7 years ago

Periodically, when the network is disconnected, I am getting a storeProhibited crash.

The serial monitor says "Network Disconnected" just before the crash.

Interestingly, not everytime the network is "disconnected" does this message pop up. For example it usually does not show when I pair the device with my phone's personal hotspot and toggle the hotspot off and back on. I have attempted to be very careful to only publish when the network connection is active.

When I comment out the mqtt_destroy() line in the code it seems to fix the problem. This does not feel like a long term solution however, as there may be a memory leak or something of the sort?