Closed pzbitskiy closed 2 months ago
I'm not sure what exactly helped with memory consumption.
I checked both mqtt client fork and esp8266 String
implementation, and cannot spot an issue - empty string assignment calls assignment operator that copies into internal buffer, and it gets destructed later anyway.
I also checked ArduinoJson, using a global static StaticJsonDocument
looks OK even they do not recommend global JsonDocument
and using String
types because of copying. I'm not sure how do they track and destroy all String
values (like from this assignments rootInfo["mode"] = hpGetMode(currentSettings)
) but looks working fine - having memory usage stable.
An update: uptime is 9d w/o MQTT with 40-42% free heap. Couple days ago LED become ON. Today I added HA + MQTT, no memory issues for few hours.
Thanks
This is possible related to #1