From 0af6c8d9e1beb6059005b2ca33d08d1dddfbd4ca Mon Sep 17 00:00:00 2001 From: Stuart Pittaway <1201909+stuartpittaway@users.noreply.github.com> Date: Tue, 24 May 2022 09:12:38 +0100 Subject: [PATCH] Fix for issue #123 --- ESPController/src/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ESPController/src/main.cpp b/ESPController/src/main.cpp index dfdb128..3b35db6 100644 --- a/ESPController/src/main.cpp +++ b/ESPController/src/main.cpp @@ -716,13 +716,22 @@ void setupInfluxClient() String poststring; + uint8_t index=0; + for (uint8_t bank = 0; bank < mysettings.totalNumberOfBanks; bank++) { //TODO: We should send a request per bank not just a single POST as we are likely to exceed capabilities of ESP for (uint8_t i = 0; i < mysettings.totalNumberOfSeriesModules; i++) { //Data in LINE PROTOCOL format https://docs.influxdata.com/influxdb/v1.7/write_protocols/line_protocol_tutorial/ - poststring = poststring + "cells," + "cell=" + String(bank) + "_" + String(i) + " v=" + String((float)cmi[i].voltagemV / 1000.0, 3) + ",i=" + String(cmi[i].internalTemp) + "i" + ",e=" + String(cmi[i].externalTemp) + "i" + ",b=" + (cmi[i].inBypass ? String("true") : String("false")) + "\n"; + poststring = poststring + "cells," + "cell=" + String(bank) + "_" + + String(i) + + " v=" + + String((float)cmi[index].voltagemV / 1000.0, 3) + + ",i=" + String(cmi[index].internalTemp) + + "i" + ",e=" + String(cmi[index].externalTemp) + + "i" + ",b=" + (cmi[index].inBypass ? String("true") : String("false")) + "\n"; + index++; } }