Skip to content

Commit

Permalink
Fix config not load correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
dzungpv committed Nov 7, 2023
1 parent ce08592 commit 0f96f3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ unsigned long requestWifiScanTime = 0;
#define WIFI_SCAN_PERIOD 120000
unsigned lastWifiScanMillis;

const PROGMEM char *m2mqtt_version = "2023.11.0";
const PROGMEM char *m2mqtt_version = "2023.11.1";

// Define global variables for files
#ifdef ESP32
Expand Down
8 changes: 4 additions & 4 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ bool loadWifi()
return false;
}
// Allocate document capacity.
const size_t capacity = JSON_OBJECT_SIZE(4) + size;
const size_t capacity = JSON_OBJECT_SIZE(4) + 130;
DynamicJsonDocument doc(capacity);
deserializeJson(doc, configFile);
// Check key exist to prevent data is "null"
Expand Down Expand Up @@ -378,7 +378,7 @@ bool loadMqtt()
return false;
}
// Allocate document capacity.
const size_t capacity = JSON_OBJECT_SIZE(6) + size;
const size_t capacity = JSON_OBJECT_SIZE(6) + 400;
DynamicJsonDocument doc(capacity);
deserializeJson(doc, configFile);
// check key to prevent data is "null" if not exist
Expand Down Expand Up @@ -464,7 +464,7 @@ bool loadUnit()
return false;
}
// Allocate document capacity.
const size_t capacity = JSON_OBJECT_SIZE(3) + size;
const size_t capacity = JSON_OBJECT_SIZE(3) + 200;
DynamicJsonDocument doc(capacity);
deserializeJson(doc, configFile);
// unit
Expand Down Expand Up @@ -519,7 +519,7 @@ bool loadOthers()
return false;
}
// Allocate document capacity.
const size_t capacity = JSON_OBJECT_SIZE(4) + size;
const size_t capacity = JSON_OBJECT_SIZE(4) + 200;
DynamicJsonDocument doc(capacity);
deserializeJson(doc, configFile);
// unit
Expand Down

0 comments on commit 0f96f3a

Please sign in to comment.