Fixed red HAN after 49.7 days

This commit is contained in:
Gunnar Skjold
2023-08-31 09:18:48 +02:00
parent 719ceb610c
commit 61c5500fdd
5 changed files with 15 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
#include "IEC6205621.h"
#include "Uptime.h"
IEC6205621::IEC6205621(const char* p, Timezone* tz) {
if(strlen(p) < 16)
@@ -6,7 +7,7 @@ IEC6205621::IEC6205621(const char* p, Timezone* tz) {
String payload(p+1);
lastUpdateMillis = millis();
lastUpdateMillis = millis64();
listId = payload.substring(payload.startsWith("/") ? 1 : 0, payload.indexOf("\n"));
if(listId.startsWith(F("ADN"))) {

View File

@@ -2,6 +2,7 @@
#include "lwip/def.h"
#include "Timezone.h"
#include "ntohll.h"
#include "Uptime.h"
IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterConfig, DataParserContext &ctx) {
float val;
@@ -127,7 +128,7 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterCo
reactiveExportCounter = ntohl(data->dlu.data) / 1000.0;
}
lastUpdateMillis = millis();
lastUpdateMillis = millis64();
} else if(listId.startsWith("ISK")) { // Iskra special case
this->listId = listId;
meterType = AmsTypeIskra;
@@ -181,7 +182,7 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterCo
data = getCosemDataAt(idx++, ((char *) (d)));
l3activeExportPower = ntohl(data->dlu.data);
lastUpdateMillis = millis();
lastUpdateMillis = millis64();
} else if(data->base.length == 0x0C) {
listType = 3;
idx += 4;
@@ -199,7 +200,7 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterCo
data = getCosemDataAt(idx++, ((char *) (d)));
reactiveExportCounter = ntohl(data->dlu.data) / 1000.0;
lastUpdateMillis = millis();
lastUpdateMillis = millis64();
}
}
} else if(useMeterType == AmsTypeKaifa && data->base.type == CosemTypeDLongUnsigned) {
@@ -207,7 +208,7 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterCo
listType = 1;
meterType = AmsTypeKaifa;
activeImportPower = ntohl(data->dlu.data);
lastUpdateMillis = millis();
lastUpdateMillis = millis64();
}
// Kaifa end
} else {
@@ -451,7 +452,7 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterCo
}
}
lastUpdateMillis = millis();
lastUpdateMillis = millis64();
}
if(meterConfig->wattageMultiplier > 0) {

View File

@@ -1,6 +1,7 @@
#include "LNG.h"
#include "lwip/def.h"
#include "ntohll.h"
#include "Uptime.h"
LNG::LNG(const char* payload, uint8_t useMeterType, MeterConfig* meterConfig, DataParserContext &ctx, RemoteDebug* debugger) {
LngHeader* h = (LngHeader*) payload;
@@ -117,7 +118,7 @@ LNG::LNG(const char* payload, uint8_t useMeterType, MeterConfig* meterConfig, Da
data += 3;
}
lastUpdateMillis = millis();
lastUpdateMillis = millis64();
}
}
}

View File

@@ -1,4 +1,5 @@
#include "LNG2.h"
#include "Uptime.h"
LNG2::LNG2(const char* payload, uint8_t useMeterType, MeterConfig* meterConfig, DataParserContext &ctx, RemoteDebug* debugger) {
CosemBasic* h = (CosemBasic*) payload;
@@ -26,7 +27,7 @@ LNG2::LNG2(const char* payload, uint8_t useMeterType, MeterConfig* meterConfig,
this->meterId = String(str);
}
listType = 3;
lastUpdateMillis = millis();
lastUpdateMillis = millis64();
}
}