mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-29 08:27:17 +02:00
Add freeheap to cloud payload
This commit is contained in:
@ -1150,6 +1150,9 @@ static void sendDataToServer(void) {
|
|||||||
"Online mode and isPostToAirGradient = true: watchdog reset");
|
"Online mode and isPostToAirGradient = true: watchdog reset");
|
||||||
Serial.println();
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Log current free heap size */
|
||||||
|
Serial.printf("Free heap: %u\n", ESP.getFreeHeap());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tempHumUpdate(void) {
|
static void tempHumUpdate(void) {
|
||||||
|
@ -612,6 +612,10 @@ String Measurements::toString(bool localServer, AgFirmwareMode fwMode, int rssi,
|
|||||||
root["serialno"] = ag.deviceId();
|
root["serialno"] = ag.deviceId();
|
||||||
root["firmware"] = ag.getVersion();
|
root["firmware"] = ag.getVersion();
|
||||||
root["model"] = AgFirmwareModeName(fwMode);
|
root["model"] = AgFirmwareModeName(fwMode);
|
||||||
|
} else {
|
||||||
|
#ifndef ESP8266
|
||||||
|
root["freeHeap"] = ESP.getFreeHeap();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
String result = JSON.stringify(root);
|
String result = JSON.stringify(root);
|
||||||
|
Reference in New Issue
Block a user