Reputation: 1259
Mine is a basic IoT project using ESP8266. I have integrated Tzapu's WiFi Manager and PubSub Client library for MQTT. It uses a TLS connection using WiFiSecure. The code is mostly copied from example codes that come with the respective libraries. When I press a button, the WiFi Manager portal starts. But when a WiFi client tries to connect to the WiFi Manager AP, the ESP crashes.
Then I disabled TLS and used a non-secure MQTT connection. No other change was made in the code. Now the WiFi Manager portal works fine, without crashing. When using an insecure connection, the free heap is 34,216. When TLS is turned on, the heap comes down to 5,792.
Though WiFi Manager has nothing to do with TLS-MQTT, is there any incompatibility between the two? Or is it just that TLS consumes too much memory and WiFi Manager feels suffocated?
Update:
The problem of TLS enabled MQTT goes beyond WiFi Manager. I tried to integrate a Web Socket client, and then a Web Socket server with the same project. Either the Web socket works, or the TLS-MQTT works, but not both simultaneously.
If I disable TLS and use plain MQTT, there is no problem running the Web socket along with the Paho MQTT client.
This does not look like a memory issue; I tried to run the same code on an ESP32 which has ample memory. Still TLS was unable to coexist with a web server, WiFi Manager or any form of Web socket.
Upvotes: 0
Views: 100