From bf07aef10f834f68a119b68a25c731d9dab54d64 Mon Sep 17 00:00:00 2001 From: Tobias Blum Date: Sun, 16 Dec 2018 15:01:22 +0100 Subject: [PATCH 1/2] Update platfiormio.ini for ArduinoJSON 6.7.0 --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 26fa778..e2fa8a2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -49,7 +49,7 @@ upload_resetmethod = ${common.upload_resetmethod} lib_deps = WiFiManager@0.14 AsyncMqttClient - https://github.com/bblanchon/ArduinoJson.git#v6.6.0-beta + https://github.com/bblanchon/ArduinoJson.git#v6.7.0-beta WS2812FX NeoPixelBus WebSockets From c755fa2e8193c0432872a7d447c61d429503af84 Mon Sep 17 00:00:00 2001 From: Debashish Sahu Date: Sun, 16 Dec 2018 11:21:58 -0500 Subject: [PATCH 2/2] fix issues brught up regarding listModes() - All about memory mangement by ArduinoJSON v 6.7.0 --- Arduino/McLighting/request_handlers.h | 4 ++-- Arduino/McLighting/version.h | 2 +- Arduino/McLighting/version_info.ino | 3 +++ platformio.ini | 2 -- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Arduino/McLighting/request_handlers.h b/Arduino/McLighting/request_handlers.h index cdbfe67..743e04a 100644 --- a/Arduino/McLighting/request_handlers.h +++ b/Arduino/McLighting/request_handlers.h @@ -277,7 +277,7 @@ void handleSetWS2812FXMode(uint8_t * mypayload) { String listStatusJSON(void) { uint8_t tmp_mode = (mode == SET_MODE) ? (uint8_t) ws2812fx_mode : strip.getMode(); - const size_t bufferSize = JSON_ARRAY_SIZE(3) + JSON_OBJECT_SIZE(6); + const size_t bufferSize = JSON_ARRAY_SIZE(3) + JSON_OBJECT_SIZE(6) + 500; DynamicJsonDocument jsonBuffer(bufferSize); JsonObject root = jsonBuffer.to(); root["mode"] = (uint8_t) mode; @@ -302,7 +302,7 @@ void getStatusJSON() { } String listModesJSON(void) { - const size_t bufferSize = JSON_ARRAY_SIZE(strip.getModeCount()+1) + strip.getModeCount()*JSON_OBJECT_SIZE(2); + const size_t bufferSize = JSON_ARRAY_SIZE(strip.getModeCount()+1) + strip.getModeCount()*JSON_OBJECT_SIZE(2) + 1000; DynamicJsonDocument jsonBuffer(bufferSize); JsonArray json = jsonBuffer.to(); for (uint8_t i = 0; i < strip.getModeCount(); i++) { diff --git a/Arduino/McLighting/version.h b/Arduino/McLighting/version.h index 77f5215..3d0423e 100644 --- a/Arduino/McLighting/version.h +++ b/Arduino/McLighting/version.h @@ -1 +1 @@ -#define SKETCH_VERSION "2.1.9" \ No newline at end of file +#define SKETCH_VERSION "2.1.10" \ No newline at end of file diff --git a/Arduino/McLighting/version_info.ino b/Arduino/McLighting/version_info.ino index 7833f82..f93acc6 100644 --- a/Arduino/McLighting/version_info.ino +++ b/Arduino/McLighting/version_info.ino @@ -41,4 +41,7 @@ * - Bump ArduinoJson library requirment for v6.7.0-beta (better memory management) * - sendState() needs extra memory for jsonBuffer * - sensState() effect can be sent directly instead of copying from PROGMEM + * + * 16 Dec 2018 v 1.1.10 + * - more ArduinoJson library memory managment fixes */ diff --git a/platformio.ini b/platformio.ini index e2fa8a2..ea4a6cc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -44,8 +44,6 @@ monitor_speed = ${common.monitor_speed} upload_speed = ${common.upload_speed} upload_resetmethod = ${common.upload_resetmethod} - - lib_deps = WiFiManager@0.14 AsyncMqttClient