More Diag-Infos Heap-memory

This commit is contained in:
2025-03-24 17:09:19 +01:00
parent fc5d77c97b
commit 360c925cfc
+9 -3
View File
@@ -266,8 +266,10 @@ bool setBambuSpool(String payload) {
JsonDocument doc; JsonDocument doc;
DeserializationError error = deserializeJson(doc, payload); DeserializationError error = deserializeJson(doc, payload);
if (error) { if (error) {
Serial.print("Error parsing JSON: "); Serial.print("Error parsing setBambuSpool-JSON: ");
Serial.println(error.c_str()); Serial.println(error.c_str());
Serial.print("Free Heap-Memory: ");
Serial.println(ESP.getFreeHeap());
return false; return false;
} }
@@ -475,7 +477,9 @@ void mqtt_callback(char* topic, byte* payload, unsigned int length) {
message = ""; message = "";
if (error) if (error)
{ {
Serial.print("Fehler beim Parsen des JSON: "); Serial.print("Free Heap-Memory: ");
Serial.println(ESP.getFreeHeap());
Serial.print("Error parsing MQTT-JSON: ");
Serial.println(error.c_str()); Serial.println(error.c_str());
return; return;
} }
@@ -682,10 +686,12 @@ void mqtt_loop(void * parameter) {
} }
// Periodically check connection status // Periodically check connection status
if (now - lastCheck > 30000) { // Check every 30 seconds if (now - lastCheck > 60000) { // Check every 60 seconds
Serial.print("MQTT Status Check - Connected: "); Serial.print("MQTT Status Check - Connected: ");
Serial.println(client.connected() ? "Yes" : "No"); Serial.println(client.connected() ? "Yes" : "No");
lastCheck = now; lastCheck = now;
Serial.print("Free Heap-Memory: ");
Serial.println(ESP.getFreeHeap());
} }
client.loop(); client.loop();