Issues with v23.9.11 , had to revoke merge #440
Replies: 10 comments 13 replies
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
I found this: Update espressif32 from 6.3.2 to 6.4.0
This results in crashes:
Can anybody confirm this? I'm wondering why there are no issues with @tbnobody upstream version |
Beta Was this translation helpful? Give feedback.
-
Checked the logs again. It happens also in MqttHandleHassClass
|
Beta Was this translation helpful? Give feedback.
-
FYI: Commit f7bd4a4 unintentionally (?) reverts JK BMS: Support for MQTT (#432) (24018a1). |
Beta Was this translation helpful? Give feedback.
-
I nailed it down, that I get different results for serializeJson() Using branch https://github.com/helgeerbe/OpenDTU-OnBattery/tree/espressif_6.4.0 with
and with
Luna is the second Inverter. Solar ist my first one and is published always correctly. |
Beta Was this translation helpful? Give feedback.
-
No, as soon you try to publish or print the buffer the system crashes (when it has an odd length). I will try to use Serial instead of MessageOutput |
Beta Was this translation helpful? Give feedback.
-
I have no idea how to solve this. This was the simpliest test in the code: void MqttHandleHassClass::publishInverterNumber(
std::shared_ptr<InverterAbstract> inv, const char* caption, const char* icon, const char* category,
const char* commandTopic, const char* stateTopic, const char* unitOfMeasure,
int16_t min, int16_t max)
{
char buffer[2048];
size_t byte = 0;
String serial = inv->serialString();
String buttonId = caption;
buttonId.replace(" ", "_");
buttonId.toLowerCase();
String configTopic = "number/dtu_" + serial
+ "/" + buttonId
+ "/config";
String cmdTopic = MqttSettings.getPrefix() + serial + "/" + commandTopic;
String statTopic = MqttSettings.getPrefix() + serial + "/" + stateTopic;
DynamicJsonDocument root(2048);
root["name"] = String(inv->name()) + " " + caption;
Serial.printf("[MqttHandleHassClass::publishInverterNumber] root capacity of : %d \r\n", root.capacity());
byte = serializeJson(root, buffer);
MessageOutput.printf("[MqttHandleHassClass::publishInverterNumber] size of buffer(name): %d (%d) \r\n", byte, measureJson(root));
Serial.println(buffer); For my first inverter solar I get:
For my second inverter luna I always get:
Dumping the free heap in MqttHandleHassClass::publishField shows the decrease in memory:
At the moment I have no idea where to look for the memory leak. |
Beta Was this translation helpful? Give feedback.
-
Can you confirm this? If you can confirm this, I would open a issue at platform-espressif32. Even if the code is bad... the total amount of heap should not change except for maybe changes in the linker scripts? |
Beta Was this translation helpful? Give feedback.
-
I'm using a D1 mini board. @schlimmchen seems to have other values. If I'm using v6.4.0 in my fully configured productive board within seconds all free heap space is gone (see above). So values below are taken from a separate D1 mini board (unconfigured except network). Until now I couldn't find out, where the leak is. But yes, I could confirm that 34kB of heap is missing. |
Beta Was this translation helpful? Give feedback.
-
The heap issue seems to be something which is fixed in arduino core 2.0.12 (which depends on IDF 4.4.5 https://github.com/espressif/esp-idf/releases/tag/v4.4.5) |
Beta Was this translation helpful? Give feedback.
-
Unfortunately after merging v23.9.11 I encountered several issues, so I had to revoke the upstream code.
What I observed so far:
At the moment, I don't know which changes from the upstream repo are causing this. So best strategy I have for the moment, to cherry pick each commit from the upstream repo into a separate branch one after the other and test it. This will take some time.
If there is someone out there with more time, please feel free to review the changes in commit eb1c2db in the development branch.
Beta Was this translation helpful? Give feedback.
All reactions