From 181ff7f1d7ac779ce0ab8b8a0bbac193e72b5f90 Mon Sep 17 00:00:00 2001 From: Debashish Sahu <debashish.sahu@gmail.com> Date: Tue, 11 Dec 2018 22:24:46 -0500 Subject: [PATCH] fix #283 For some reason defining the exact size is causing mqtt_user and mqtt_pass are not stored in SPIFFs. Dynamic assignment should take care of this. Should take care of expception 28 --- Arduino/McLighting/request_handlers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Arduino/McLighting/request_handlers.h b/Arduino/McLighting/request_handlers.h index 5e0949a..bb10c1f 100644 --- a/Arduino/McLighting/request_handlers.h +++ b/Arduino/McLighting/request_handlers.h @@ -1196,7 +1196,7 @@ bool writeConfigFS(bool saveConfig){ //FS save updateFS = true; DBG_OUTPUT_PORT.print("Saving config: "); - DynamicJsonDocument jsonBuffer(JSON_OBJECT_SIZE(4)); + DynamicJsonDocument jsonBuffer; JsonObject json = jsonBuffer.to<JsonObject>(); json["mqtt_host"] = mqtt_host; json["mqtt_port"] = mqtt_port; @@ -1265,7 +1265,7 @@ bool writeStateFS(){ updateFS = true; //save the strip state to FS JSON DBG_OUTPUT_PORT.print("Saving cfg: "); - DynamicJsonDocument jsonBuffer(JSON_OBJECT_SIZE(7)); + DynamicJsonDocument jsonBuffer; JsonObject json = jsonBuffer.to<JsonObject>(); json["mode"] = static_cast<int>(mode); json["strip_mode"] = (int) strip.getMode();