dzungpv / mitsubishi2MQTT

Mitsubishi to MQTT with ESP8266/ESP32 module
GNU General Public License v3.0
68 stars 13 forks source link

Stabilize when running without MQTT #29

Closed pzbitskiy closed 2 months ago

pzbitskiy commented 2 months ago

This is possible related to #1

pzbitskiy commented 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.

pzbitskiy commented 2 months ago

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.

dzungpv commented 2 months ago

Thanks