From 4994d59f9b7367808f955ec1239779584244cffc Mon Sep 17 00:00:00 2001 From: debsahu Date: Tue, 19 Jun 2018 19:25:01 -0400 Subject: [PATCH] fix JSON memory allocation for '/esp_status' - removed predefined memory allocation for DynamicJsonDocument as the size could vary depeneding on what options are enabled --- Arduino/McLighting/McLighting.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arduino/McLighting/McLighting.ino b/Arduino/McLighting/McLighting.ino index fe582db..0c6a7fe 100644 --- a/Arduino/McLighting/McLighting.ino +++ b/Arduino/McLighting/McLighting.ino @@ -492,7 +492,7 @@ void setup() { }, handleFileUpload); //get heap status, analog input value and all GPIO statuses in one json call server.on("/esp_status", HTTP_GET, []() { - DynamicJsonDocument jsonBuffer(JSON_OBJECT_SIZE(9)); + DynamicJsonDocument jsonBuffer; JsonObject& json = jsonBuffer.to(); json["HOSTNAME"] = HOSTNAME;