From d2f93c07bd7095acc7ba34c4c8e555251867d56b Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Thu, 13 Feb 2020 20:50:13 +0100 Subject: [PATCH] Not sure if this does anything, but increased json and mqtt limits to see if Kamstrup list 3 is received --- lib/HanToJson/src/HanToJson.cpp | 1 + src/AmsToMqttBridge.ino | 2 +- src/web/AmsWebServer.cpp | 2 +- src/web/AmsWebServer.h | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/HanToJson/src/HanToJson.cpp b/lib/HanToJson/src/HanToJson.cpp index e7ae4c19..6aea6cf3 100644 --- a/lib/HanToJson/src/HanToJson.cpp +++ b/lib/HanToJson/src/HanToJson.cpp @@ -194,6 +194,7 @@ static void hanToJsonKamstrup3phase(int listSize, JsonObject& data, HanReader& h { if (listSize >= (int)Kamstrup::List3PhaseShort) { + data["ls"] = listSize; data["lv"] = hanReader.getString( (int)Kamstrup_List3Phase::ListVersionIdentifier); data["id"] = hanReader.getString( (int)Kamstrup_List3Phase::MeterID); data["type"] = hanReader.getString( (int)Kamstrup_List3Phase::MeterType); diff --git a/src/AmsToMqttBridge.ino b/src/AmsToMqttBridge.ino index 75cae7c8..08c17c72 100644 --- a/src/AmsToMqttBridge.ino +++ b/src/AmsToMqttBridge.ino @@ -202,7 +202,7 @@ void readHanPort() if (debugger) debugger->println(time); // Define a json object to keep the data - StaticJsonDocument<500> json; + StaticJsonDocument<1024> json; // Any generic useful info here json["id"] = WiFi.macAddress(); diff --git a/src/web/AmsWebServer.cpp b/src/web/AmsWebServer.cpp index d8c15b24..ff52f5ba 100644 --- a/src/web/AmsWebServer.cpp +++ b/src/web/AmsWebServer.cpp @@ -41,7 +41,7 @@ void AmsWebServer::loop() { server.handleClient(); } -void AmsWebServer::setJson(StaticJsonDocument<500> json) { +void AmsWebServer::setJson(StaticJsonDocument<1024> json) { if(!json.isNull()) { p = json["data"]["P"].as(); diff --git a/src/web/AmsWebServer.h b/src/web/AmsWebServer.h index cc9e0d01..317a78b9 100644 --- a/src/web/AmsWebServer.h +++ b/src/web/AmsWebServer.h @@ -24,12 +24,12 @@ class AmsWebServer { public: void setup(configuration* config, Stream* debugger); void loop(); - void setJson(StaticJsonDocument<500> json); + void setJson(StaticJsonDocument<1024> json); private: configuration* config; Stream* debugger; - StaticJsonDocument<500> json; + StaticJsonDocument<1024> json; int maxPwr; int p; double u1, u2, u3, i1, i2, i3;