Skip to content

Commit ad1e7e1

Browse files
committed
WIP: print info on publishes
1 parent a509cea commit ad1e7e1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Wippersnapper.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,6 +2664,19 @@ bool Wippersnapper::publish(const char *topic, uint8_t *payload, uint16_t bLen,
26642664
uint8_t qos) {
26652665
// runNetFSM(); // NOTE: Removed for now, causes error with virtual _connect
26662666
// method when caused with WS object in another file.
2667+
#ifdef ARDUINO_ARCH_ESP32
2668+
// print stack and heap usage
2669+
WS_DEBUG_PRINT("Free Heap: ");
2670+
WS_DEBUG_PRINTLN(ESP.getFreeHeap());
2671+
WS_DEBUG_PRINT("Min Free Heap: ");
2672+
WS_DEBUG_PRINTLN(ESP.getMinFreeHeap());
2673+
WS_DEBUG_PRINT("Max Alloc Heap: ");
2674+
WS_DEBUG_PRINTLN(ESP.getMaxAllocHeap());
2675+
WS_DEBUG_PRINT("Heap Size: ");
2676+
WS_DEBUG_PRINTLN(ESP.getHeapSize());
2677+
WS_DEBUG_PRINT("Free Stack: ");
2678+
WS_DEBUG_PRINTLN(uxTaskGetStackHighWaterMark(NULL));
2679+
#endif
26672680
WS.feedWDT();
26682681
bool response = WS._mqtt->publish(topic, payload, bLen, qos);
26692682
if (!response) {

0 commit comments

Comments
 (0)