From c2c5855e6a7b78d40290b18ab4ade85951b86bc5 Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Thu, 2 Feb 2023 16:15:03 +0100 Subject: [PATCH] Fixed issue where authentication key got corrupted from configfile upload --- src/AmsToMqttBridge.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AmsToMqttBridge.ino b/src/AmsToMqttBridge.ino index 49af085a..f458867e 100644 --- a/src/AmsToMqttBridge.ino +++ b/src/AmsToMqttBridge.ino @@ -1600,7 +1600,7 @@ void configFileParse() { fromHex(meter.encryptionKey, String(buf+19), 16); } else if(strncmp_P(buf, PSTR("meterAuthenticationKey "), 23) == 0) { if(!lMeter) { config.getMeterConfig(meter); lMeter = true; }; - fromHex(meter.authenticationKey, String(buf+19), 16); + fromHex(meter.authenticationKey, String(buf+23), 16); } else if(strncmp_P(buf, PSTR("gpioHanPin "), 11) == 0) { if(!lGpio) { config.getGpioConfig(gpio); lGpio = true; }; gpio.hanPin = String(buf+11).toInt();