From 69cdacaac7cb33fb4f341effae6d9ec814e2503c Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 15 Dec 2023 11:33:12 +0100 Subject: [PATCH 01/11] Enhancement: log to syslog server instead of web-serial --- src/utils/syslog.cpp | 99 ++++++++++++++++++++++++++++++++++++++++++++ src/utils/syslog.h | 54 ++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 src/utils/syslog.cpp create mode 100644 src/utils/syslog.h diff --git a/src/utils/syslog.cpp b/src/utils/syslog.cpp new file mode 100644 index 00000000..5e73f287 --- /dev/null +++ b/src/utils/syslog.cpp @@ -0,0 +1,99 @@ +#include +#include "syslog.h" + +#ifdef ENABLE_SYSLOG + +#define SYSLOG_MAX_PACKET_SIZE 256 + + +//----------------------------------------------------------------------------- +void DbgSyslog::setup(settings_t *config) { + mConfig = config; + + // Syslog callback overrides web-serial callback + registerDebugCb(std::bind(&DbgSyslog::syslogCb, this, std::placeholders::_1)); // dbg.h +} + +//----------------------------------------------------------------------------- +void DbgSyslog::syslogCb (String msg) +{ + if (!mSyslogIP.isSet()) { + // use WiFi.hostByName to DNS lookup for IPAddress of syslog server + if (WiFi.status() == WL_CONNECTED) { + WiFi.hostByName(SYSLOG_HOST,mSyslogIP); + } + } + if (!mSyslogIP.isSet()) { + return; + } + uint16_t msgLength = msg.length(); + uint16_t msgPos = 0; + + do { + uint16_t charsToCopy = std::min(msgLength-msgPos,SYSLOG_BUF_SIZE - mSyslogBufFill); + + while (charsToCopy > 0) { + mSyslogBuffer[mSyslogBufFill] = msg[msgPos]; + msgPos++; + mSyslogBufFill++; + charsToCopy--; + } + mSyslogBuffer[mSyslogBufFill] = '\0'; + + bool isBufferFull = (mSyslogBufFill == SYSLOG_BUF_SIZE); + bool isEolFound = false; + if (mSyslogBufFill >= 2) { + isEolFound = (mSyslogBuffer[mSyslogBufFill-2] == '\r' && mSyslogBuffer[mSyslogBufFill-1] == '\n'); + } + // Get severity from input message + if (msgLength >= 2) { + if (':' == msg[1]) { + switch(msg[0]) { + case 'E': mSyslogSeverity = PRI_ERROR; break; + case 'W': mSyslogSeverity = PRI_WARNING; break; + case 'I': mSyslogSeverity = PRI_INFO; break; + case 'D': mSyslogSeverity = PRI_DEBUG; break; + default: mSyslogSeverity = PRI_NOTICE; break; + } + } + } + + if (isBufferFull || isEolFound) { + // Send mSyslogBuffer in chunks because mSyslogBuffer is larger than syslog packet size + int packetStart = 0; + int packetSize = 122; // syslog payload depends also on hostname and app + char saveChar; + if (isEolFound) { + mSyslogBuffer[mSyslogBufFill-2]=0; // skip \r\n + } + while(packetStart < mSyslogBufFill) { + saveChar = mSyslogBuffer[packetStart+packetSize]; + mSyslogBuffer[packetStart+packetSize] = 0; + log(mConfig->sys.deviceName,SYSLOG_FACILITY, mSyslogSeverity, &mSyslogBuffer[packetStart]); + mSyslogBuffer[packetStart+packetSize] = saveChar; + packetStart += packetSize; + } + mSyslogBufFill = 0; + } + + } while (msgPos < msgLength); // Message not completely processed + +} + +//----------------------------------------------------------------------------- +void DbgSyslog::log(const char *hostname, uint8_t facility, uint8_t severity, char* msg) { + // The PRI value is an integer number which calculates by the following metric: + uint8_t priority = (8 * facility) + severity; + + // This is a unit8 instead of a char because that's what udp.write() wants + uint8_t buffer[SYSLOG_MAX_PACKET_SIZE]; + int len = snprintf((char*)buffer, SYSLOG_MAX_PACKET_SIZE, "<%d>%s %s: %s", priority, hostname, SYSLOG_APP, msg); + //printf("syslog::log %s\n",mSyslogIP.toString().c_str()); + //printf("syslog::log %d %s\n",len,buffer); + // Send the raw UDP packet + mSyslogUdp.beginPacket(mSyslogIP, SYSLOG_PORT); + mSyslogUdp.write(buffer, len); + mSyslogUdp.endPacket(); +} + +#endif \ No newline at end of file diff --git a/src/utils/syslog.h b/src/utils/syslog.h new file mode 100644 index 00000000..aac9db14 --- /dev/null +++ b/src/utils/syslog.h @@ -0,0 +1,54 @@ + +#ifndef __SYSLOG_H__ +#define __SYSLOG_H__ + +#ifdef ESP8266 + #include +#elif defined(ESP32) + #include +#endif +#include +#include "../config/config.h" +#include "../config/settings.h" + +#ifdef ENABLE_SYSLOG + +#define SYSLOG_BUF_SIZE 255 + +#define PRI_EMERGENCY 0 +#define PRI_ALERT 1 +#define PRI_CRITICAL 2 +#define PRI_ERROR 3 +#define PRI_WARNING 4 +#define PRI_NOTICE 5 +#define PRI_INFO 6 +#define PRI_DEBUG 7 + +#define FAC_USER 1 +#define FAC_LOCAL0 16 +#define FAC_LOCAL1 17 +#define FAC_LOCAL2 18 +#define FAC_LOCAL3 19 +#define FAC_LOCAL4 20 +#define FAC_LOCAL5 21 +#define FAC_LOCAL6 22 +#define FAC_LOCAL7 23 + +class DbgSyslog { + public: + void setup (settings_t *config); + void syslogCb(String msg); + void log(const char *hostname, uint8_t facility, uint8_t severity, char* msg); + + private: + WiFiUDP mSyslogUdp; + IPAddress mSyslogIP; + settings_t *mConfig; + char mSyslogBuffer[SYSLOG_BUF_SIZE+1]; + uint16_t mSyslogBufFill = 0; + int mSyslogSeverity = PRI_NOTICE; +}; + +#endif + +#endif \ No newline at end of file From 21848bd5ae5f163e3add306db0163fbadf41567f Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 15 Dec 2023 11:33:48 +0100 Subject: [PATCH 02/11] Enhancement: log to syslog server instead of web-serial --- src/app.cpp | 3 +++ src/app.h | 4 ++++ src/config/config_override_example.h | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/src/app.cpp b/src/app.cpp index d670c696..82e25724 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -82,6 +82,9 @@ void app::setup() { mApi.setup(this, &mSys, mWeb.getWebSrvPtr(), mConfig); + #ifdef ENABLE_SYSLOG + mDbgSyslog.setup(mConfig); // be sure to init after mWeb.setup (webSerial uses also debug callback) + #endif // Plugins #if defined(PLUGIN_DISPLAY) if (mConfig->plugin.display.type != 0) diff --git a/src/app.h b/src/app.h index a71ee03c..a24cccb3 100644 --- a/src/app.h +++ b/src/app.h @@ -22,6 +22,7 @@ #include "utils/crc.h" #include "utils/dbg.h" #include "utils/scheduler.h" +#include "utils/syslog.h" #include "web/RestApi.h" #include "web/web.h" #include "hm/Communication.h" @@ -311,6 +312,9 @@ class app : public IApp, public ah::Scheduler { #endif /* defined(ETHERNET) */ WebType mWeb; RestApiType mApi; + #ifdef ENABLE_SYSLOG + DbgSyslog mDbgSyslog; + #endif //PayloadType mPayload; //MiPayloadType mMiPayload; PubSerialType mPubSerial; diff --git a/src/config/config_override_example.h b/src/config/config_override_example.h index c653bf10..b90bbdbd 100644 --- a/src/config/config_override_example.h +++ b/src/config/config_override_example.h @@ -35,4 +35,13 @@ // #define ENABLE_PROMETHEUS_EP +// to enable the syslog logging (will disable web-serial) +//#define ENABLE_SYSLOG +#ifdef ENABLE_SYSLOG +#define SYSLOG_HOST "" +#define SYSLOG_APP "ahoy" +#define SYSLOG_FACILITY FAC_USER +#define SYSLOG_PORT 514 +#endif + #endif /*__CONFIG_OVERRIDE_H__*/ From cf19423d919b5445d090e342329d9e6ebc943c03 Mon Sep 17 00:00:00 2001 From: lumapu Date: Fri, 29 Dec 2023 15:09:14 +0100 Subject: [PATCH 03/11] 0.8.32 * fix `start` / `stop` / `restart` commands #1287 * added message, if profile was not read until now #1300 --- src/CHANGES.md | 4 ++++ src/hm/Communication.h | 23 ++++++++++++++++++++--- src/hms/hmsRadio.h | 1 + src/web/RestApi.h | 4 ++++ src/web/html/system.html | 10 +++++----- src/web/html/visualization.html | 10 +++++++--- 6 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index 7839d420..cfa967f4 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,9 @@ # Development Changes +## 0.8.32 - 2023-12-29 +* fix `start` / `stop` / `restart` commands #1287 +* added message, if profile was not read until now #1300 + ## 0.8.31 - 2023-12-29 * added class to handle timeouts PR #1298 diff --git a/src/hm/Communication.h b/src/hm/Communication.h index 1ed45831..9f96533d 100644 --- a/src/hm/Communication.h +++ b/src/hm/Communication.h @@ -276,9 +276,10 @@ class Communication : public CommQueue<> { } else { DBGPRINT(F(" ")); DBGPRINT(String(p->rssi)); - DBGPRINT(F("dBm | ")); + DBGPRINT(F("dBm ")); } if(*mPrintWholeTrace) { + DBGPRINT(F("| ")); if(*mPrivacyMode) ah::dumpBuf(p->packet, p->len, 1, 8); else @@ -363,8 +364,24 @@ class Communication : public CommQueue<> { } inline bool parseDevCtrl(packet_t *p, const queue_s *q) { - if((p->packet[12] != ActivePowerContr) || (p->packet[13] != 0x00)) - return false; + switch(p->packet[12]) { + case ActivePowerContr: + if(p->packet[13] != 0x00) + return false; + break; + + case TurnOn: [[fallthrough]]; + case TurnOff: [[fallthrough]]; + case Restart: + return true; + break; + + default: + DPRINT(DBG_WARN, F("unknown dev ctrl: ")); + DBGHEXLN(p->packet[12]); + break; + } + bool accepted = true; if((p->packet[10] == 0x00) && (p->packet[11] == 0x00)) q->iv->powerLimitAck = true; diff --git a/src/hms/hmsRadio.h b/src/hms/hmsRadio.h index 2b147107..d2779012 100644 --- a/src/hms/hmsRadio.h +++ b/src/hms/hmsRadio.h @@ -99,6 +99,7 @@ class CmtRadio : public Radio { DHEX(mTxBuf[0]); DBGPRINT(F(" ")); DHEX(mTxBuf[10]); + DBGPRINT(F(" ")); DBGHEXLN(mTxBuf[9]); } } diff --git a/src/web/RestApi.h b/src/web/RestApi.h index f2c193cd..f3d70d26 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -316,7 +316,11 @@ class RestApi { void getHtmlReboot(AsyncWebServerRequest *request, JsonObject obj) { getGeneric(request, obj.createNestedObject(F("generic"))); + #if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3) + obj[F("refresh")] = 5; + #else obj[F("refresh")] = 20; + #endif obj[F("refresh_url")] = "/"; obj[F("html")] = F("rebooting ..."); } diff --git a/src/web/html/system.html b/src/web/html/system.html index b5596c7b..ef487ad5 100644 --- a/src/web/html/system.html +++ b/src/web/html/system.html @@ -119,21 +119,21 @@ function parse(obj) { if(null != obj) { - parseGeneric(obj["generic"]); + parseGeneric(obj.generic); - if(null != obj["refresh"]) { + if(null != obj.refresh) { var meta = document.createElement('meta'); meta.httpEquiv = "refresh" - meta.content = obj["refresh"] + "; URL=" + obj["refresh_url"]; + meta.content = obj.refresh + "; URL=" + obj.refresh_url; document.getElementsByTagName('head')[0].appendChild(meta); } else { parseRadio(obj.system); parseMqtt(obj.system.mqtt); - parseSysInfo(obj["system"]); + parseSysInfo(obj.system); getAjax('/api/index', parseIndex); } - document.getElementById("html").innerHTML = obj["html"]; + document.getElementById("html").innerHTML = obj.html; } } diff --git a/src/web/html/visualization.html b/src/web/html/visualization.html index 2c771f5a..d255d1c5 100644 --- a/src/web/html/visualization.html +++ b/src/web/html/visualization.html @@ -357,9 +357,13 @@ var content = []; var g = getGridType(glob.info.type, getGridIdentifier(glob)) if(null === g) { - content.push(ml("div", {class: "row"}, ml("div", {class: "col"}, ml("h5", {}, "Unknown Profile")))) - content.push(ml("div", {class: "row"}, ml("div", {class: "col"}, ml("p", {}, "Please open a new issue at https://github.com/lumapu/ahoy and copy the raw data into it.")))) - content.push(ml("div", {class: "row"}, ml("div", {class: "col my-2"}, ml("pre", {}, obj.grid)))) + if(0 == obj.grid.length) { + content.push(ml("div", {class: "row"}, ml("div", {class: "col"}, ml("p", {}, "Profile was not read until now, maybe turned off?")))) + } else { + content.push(ml("div", {class: "row"}, ml("div", {class: "col"}, ml("h5", {}, "Unknown Profile")))) + content.push(ml("div", {class: "row"}, ml("div", {class: "col"}, ml("p", {}, "Please open a new issue at https://github.com/lumapu/ahoy and copy the raw data into it.")))) + content.push(ml("div", {class: "row"}, ml("div", {class: "col my-2"}, ml("pre", {}, obj.grid)))) + } } else { content.push(ml("div", {class: "row"}, ml("div", {class: "col my-3"}, ml("h5", {}, g + " (Version " + getGridValue(glob).toString(16) + ")")) From a8b10eec6c3be29a4eb3cd74948d610ac24a8470 Mon Sep 17 00:00:00 2001 From: lumapu Date: Fri, 29 Dec 2023 15:12:47 +0100 Subject: [PATCH 04/11] 0.8.32 * added developer option to use 'syslog-server' instead of 'web-serail' #1299 --- src/CHANGES.md | 1 + src/utils/syslog.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index cfa967f4..8dde956c 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -3,6 +3,7 @@ ## 0.8.32 - 2023-12-29 * fix `start` / `stop` / `restart` commands #1287 * added message, if profile was not read until now #1300 +* added developer option to use 'syslog-server' instead of 'web-serail' #1299 ## 0.8.31 - 2023-12-29 * added class to handle timeouts PR #1298 diff --git a/src/utils/syslog.h b/src/utils/syslog.h index aac9db14..37bdc524 100644 --- a/src/utils/syslog.h +++ b/src/utils/syslog.h @@ -49,6 +49,6 @@ class DbgSyslog { int mSyslogSeverity = PRI_NOTICE; }; -#endif +#endif /*ENABLE_SYSLOG*/ -#endif \ No newline at end of file +#endif /*__SYSLOG_H__*/ \ No newline at end of file From b043f4c2ac098491b6d3f5e65ffa3c91d7b882d5 Mon Sep 17 00:00:00 2001 From: lumapu Date: Fri, 29 Dec 2023 15:48:25 +0100 Subject: [PATCH 05/11] 0.8.33 * improved communication thx @rejoe2 --- src/CHANGES.md | 3 +++ src/hm/hmRadio.h | 27 ++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index 8dde956c..8c1a56f0 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,8 @@ # Development Changes +## 0.8.33 - 2023-12-29 +* improved communication thx @rejoe2 + ## 0.8.32 - 2023-12-29 * fix `start` / `stop` / `restart` commands #1287 * added message, if profile was not read until now #1300 diff --git a/src/hm/hmRadio.h b/src/hm/hmRadio.h index d7ae594b..0754f83c 100644 --- a/src/hm/hmRadio.h +++ b/src/hm/hmRadio.h @@ -113,34 +113,51 @@ class HmRadio : public Radio { mNrf24->flush_tx(); // empty TX FIFO // start listening + uint8_t chOffset = 2; + mRxChIdx = (mTxChIdx + chOffset) % RF_CHANNELS; mNrf24->setChannel(mRfChLst[mRxChIdx]); mNrf24->startListening(); if(NULL == mLastIv) // prevent reading on NULL object! return; - uint32_t startMicros = micros(); + uint32_t innerLoopTimeout = 55000; uint32_t loopMillis = millis(); uint32_t outerLoopTimeout = (mLastIv->mIsSingleframeReq) ? 100 : ((mLastIv->mCmd != AlarmData) && (mLastIv->mCmd != GridOnProFilePara)) ? 400 : 600; + bool isRxInit = true; + while ((millis() - loopMillis) < outerLoopTimeout) { - startMicros = micros(); - while ((micros() - startMicros) < 5110) { // listen (4088us or?) 5110us to each channel + uint32_t startMicros = micros(); + while ((micros() - startMicros) < innerLoopTimeout) { // listen (4088us or?) 5110us to each channel if (mIrqRcvd) { mIrqRcvd = false; if (getReceived()) { // everything received return; } + + innerLoopTimeout = 4088*5; + if (isRxInit) { + isRxInit = false; + if (micros() - startMicros < 42000) { + innerLoopTimeout = 4088*12; + mRxChIdx = (mRxChIdx + 4) % RF_CHANNELS; + mNrf24->setChannel(mRfChLst[mRxChIdx]); + } + } + + startMicros = micros(); } yield(); } // switch to next RX channel - mRxChIdx = (mRxChIdx + 1) % RF_CHANNELS; + mRxChIdx = (mRxChIdx + 4) % RF_CHANNELS; mNrf24->setChannel(mRfChLst[mRxChIdx]); + innerLoopTimeout = 4088; + isRxInit = false; } // not finished but time is over - mRxChIdx = (mRxChIdx + 1) % RF_CHANNELS; return; } From b8c651e0a8a0c2f30dc526e4656c401986375153 Mon Sep 17 00:00:00 2001 From: lumapu Date: Fri, 29 Dec 2023 15:48:46 +0100 Subject: [PATCH 06/11] 0.8.33 --- src/defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/defines.h b/src/defines.h index b3c5089a..6eadb705 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 31 +#define VERSION_PATCH 33 //------------------------------------- typedef struct { From 3178325b42a59fe7555c3fd945917802bd46bf72 Mon Sep 17 00:00:00 2001 From: lumapu Date: Fri, 29 Dec 2023 17:01:07 +0100 Subject: [PATCH 07/11] 0.8.34 release --- src/CHANGES.md | 1019 ++---------------------------------------------- src/defines.h | 2 +- 2 files changed, 32 insertions(+), 989 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index 8c1a56f0..6aa9683d 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,992 +1,35 @@ -# Development Changes +Changelog v0.8.34 -## 0.8.33 - 2023-12-29 -* improved communication thx @rejoe2 - -## 0.8.32 - 2023-12-29 -* fix `start` / `stop` / `restart` commands #1287 -* added message, if profile was not read until now #1300 -* added developer option to use 'syslog-server' instead of 'web-serail' #1299 - -## 0.8.31 - 2023-12-29 -* added class to handle timeouts PR #1298 - -## 0.8.30 - 2023-12-28 -* added info if grid profile was not found -* merge PR #1293 -* merge PR #1295 fix ESP8266 pin settings -* merge PR #1297 fix layout for OLED displays - -## 0.8.29 - 2023-12-27 -* fix MqTT generic topic `comm_disabled` #1265 #1286 -* potential fix of #1285 (reset yield day) -* fix fraction of yield correction #1280 -* fix crash if `getLossRate` was read from inverter #1288 #1290 -* reduce reload time for opendtufusion ethernet variant to 5 seconds -* added basic grid parser -* added ESP32-C3 mini environment #1289 - -## 0.8.28 - 2023-12-23 -* fix bug heuristic -* add version information to clipboard once 'copy' was clicked -* add get loss rate @rejoe2 -* improve communication @rejoe2 - -## 0.8.27 - 2023-12-18 -* fix set power limit #1276 - -## 0.8.26 - 2023-12-17 -* read grid profile as HEX (`live` -> click inverter name -> `show grid profile`) - -## 0.8.25 - 2023-12-17 -* RX channel ID starts with fixed value #1277 -* fix static IP for Ethernet - -## 0.8.24 - 2023-12-16 -* fix NRF communication for opendtufusion ethernet variant - -## 0.8.23 - 2023-12-14 -* heuristics fix #1269 #1270 -* moved `sendInterval` in settings, **important:** *will be reseted to 15s after update to this version* -* try to prevent access to radio classes if they are not activated -* fixed millis in serial log -* changed 'print whole trace' = `false` as default -* added communication loop duration in [ms] to serial console -* don't print Hex-Payload if 'print whole trace' == `false` - -## 0.8.22 - 2023-12-13 -* fix communication state-machine regarding zero export #1267 - -## 0.8.21 - 2023-12-12 -* fix ethernet save inverter parameters #886 -* fix ethernet OTA update #886 -* improved radio statistics, fixed heuristic output for HMS and HMT inverters - -## 0.8.20 - 2023-12-12 -* improved HM communication #1259 #1249 -* fix `loadDefaults` for ethernet builds #1263 -* don't loop through radios which aren't in use #1264 - -## 0.8.19 - 2023-12-11 -* added ms to serial log -* added (debug) option to configure gap between inverter requests - -## 0.8.18 - 2023-12-10 -* copied even more from the original heuristic code #1259 -* added mDNS support #1262 - -## 0.8.17 - 2023-12-10 -* possible fix of NRF with opendtufusion (without ETH) -* small fix in heuristics (if conditions made assignment not comparisson) - -## 0.8.16 - 2023-12-09 -* fix crash if NRF is not enabled -* updated heuristic #1080 #1259 -* fix compile opendtufusion fusion ethernet - -## 0.8.15 - 2023-12-09 -* added support for opendtufusion fusion ethernet shield #886 -* fixed range of HMS / HMT frequencies to 863 to 870 MHz #1238 -* changed `yield effiency` per default to `1.0` #1243 -* small heuristics improvements #1258 -* added class to combine inverter heuristics fields #1258 - -## 0.8.14 - 2023-12-07 -* fixed decimal points for temperature (WebUI) PR #1254 #1251 -* fixed inverter statemachine available state PR #1252 #1253 -* fixed NTP update and sunrise calculation #1240 #886 -* display improvments #1248 #1247 -* fixed overflow in `hmRadio.h` #1244 - -## 0.8.13 - 2023-11-28 -* merge PR #1239 symbolic layout for OLED 128x64 + motion senser functionality -* fix MqTT IP addr for ETH connections PR #1240 -* added ethernet build for fusion board, not tested so far - -## 0.8.12 - 2023-11-20 -* added button `copy to clipboard` to `/serial` - -## 0.8.11 - 2023-11-20 -* improved communication, thx @rejoe2 -* improved heuristics, thx @rejoe2, @Oberfritze -* added option to strip payload of frames to significant area - -## 0.8.10 - 2023-11-19 -* fix Mi and HM inverter communication #1235 -* added privacy mode option #1211 -* changed serial debug option to work without reboot - -## 0.8.9 - 2023-11-19 -* merged PR #1234 -* added new alarm codes -* removed serial interval, was not in use anymore - -## 0.8.8 - 2023-11-16 -* fix ESP8266 save inverter #1232 - -## 0.8.7 - 2023-11-13 -* fix ESP8266 inverter settings #1226 -* send radio statistics via MqTT #1227 -* made night communication inverter depended -* added option to prevent adding values of inverter to total values (MqTT only) #1199 - -## 0.8.6 - 2023-11-12 -* merged PR #1225 -* improved heuristics (prevent update of statitistic during testing) - -## 0.8.5 - 2023-11-12 -* fixed endless loop while switching CMT frequency -* removed obsolete "retries" field from settings #1224 -* fixed crash while defining new invertes #1224 -* fixed default frequency settings -* added default input power to `400` while adding new inverters -* fixed color of wifi RSSI icon #1224 - -## 0.8.4 - 2023-11-10 -* changed MqTT alarm topic, removed retained flag #1212 -* reduce last_success MQTT messages (#1124) -* introduced tabs in WebGUI (inverter settings) -* added inverter-wise power level and frequency - -## 0.8.3 - 2023-11-09 -* fix yield day reset during day #848 -* add total AC Max Power to WebUI -* fix opendtufusion build (GxEPD patch) -* fix null ptr PR #1222 - -## 0.8.2 - 2023-11-08 -* beautified inverter settings in `setup` (preperation for future, settings become more inverter dependent) - -## 0.8.1 - 2023-11-05 -* added tx channel heuristics (per inverter) -* fix statistics counter - -## 0.8.0 - 2023-10-?? -* switched to new communication scheme - -## 0.7.66 - 2023-10-04 -* prepared PA-Level for CMT -* removed settings for number of retransmits, its fixed to `5` now -* added parentheses to have a excactly defined behaviour - -## 0.7.65 - 2023-10-02 -* MI control command review #1197 - -## 0.7.64 - 2023-10-02 -* moved active power control to modal in `live` view (per inverter) by click on current APC state - -## 0.7.63 - 2023-10-01 -* fix NRF24 communication #1200 - -## 0.7.62 - 2023-10-01 -* fix communication to inverters #1198 -* add timeout before payload is tried to process (necessary for HMS/HMT) - -## 0.7.61 - 2023-10-01 -* merged `hmPayload` and `hmsPayload` into single class -* merged generic radio functions into new parent class `radio.h` +* improve communication, all inverters are polled during interval +* add hardware info, click on inverter name (in `/live`) +* added RSSI info for HMS and HMT inverters (MqTT + REST API) +* add signal strength for NRF24 +* change ePaper text to symbols +* 2.42" display (SSD1309) integration +* moved active power control to modal in `/live` view (per inverter) by click on current APC state * moved radio statistics into the inverter - each inverter has now seperate statistics which can be accessed by click on the footer in `/live` -* fix compiler warnings #1191 -* fix ePaper logo during night time #1151 - -## 0.7.60 - 2023-09-27 -* fixed typos in changelog #1172 -* fixed MqTT manual clientId storage #1174 -* fixed inverter name length in setup #1181 -* added inverter name to the header of alarm list #1181 -* improved code to avoid warning during compilation #1182 -* fix scheduler #1188, #1179 - -## 0.7.59 - 2023-09-20 -* re-add another HM-400 hardware serial number accidentally removed with `0.7.45` (#1169) -* merge PR #1170 -* reduce last_success MQTT messages (#1124) -* add re-request if inverter is known to be online and first try fails -* add alarm reporting to MI (might need review!) -* rebuild MI limiting code closer to DTUSimMI example -* round APC in `W` to an integer #1171 - -## 0.7.58 -* fix ESP8266 save settings issue #1166 - -## 0.7.57 - 2023-09-18 -* fix Alarms are always in queue (since 0.7.56) -* fix display active power control to long for small devices #1165 - -## 0.7.56 - 2023-09-17 -* only request alarms which were not received before #1113 -* added flag if alarm was requested but not received and re-request it #1105 -* merge PR #1163 - -## 0.7.55 - 2023-09-17 -* fix prometheus builds -* fix ESP32 default pinout #1159 -* added `opendtufusion-dev` because of annoying `-DARDUINO_USB_CDC_ON_BOOT=1` flag -* fix display of current power on `index` -* fix OTA, was damaged by version `0.7.51`, need to use webinstaller (from `0.7.51` to `0.7.54`) - -## 0.7.54 - 2023-09-16 -* added active power control in `W` to live view #201, #673 -* updated docu, active power control related #706 -* added current AC-Power to `index` page and removed version #763 -* improved statistic data, moved to entire struct -* removed `/api/statistics` endpoint from REST-API - -## 0.7.53 - 2023-09-16 -* fix ePaper / display night behaviour #1151 -* fix ESP8266 compile error - -## 0.7.52 - 2023-09-16 -* fix CMT configurable pins #1150, #1159 -* update MqTT lib to version `1.4.5` - -## 0.7.51 - 2023-09-16 -* fix CMT configurable pins #1150 -* fix default CMT pins for opendtufusion -* beautified `system` -* changed main loops, fix resets #1125, #1135 - -## 0.7.50 - 2023-09-12 -* moved MqTT info to `system` -* added CMT info for ESP32 devices -* improved CMT settings, now `SCLK` and `SDIO` are configurable #1046, #1150 -* changed `Power-Limit` in live-view to `Active Power Control` -* increase length of update file selector #1132 - -## 0.7.49 - 2023-09-11 -* merge PR: symbolic icons for mono displays, PR #1136 -* merge MI code restructuring PR #1145 -* merge Prometheus PR #1148 -* add option to strip webUI for ESP8266 (reduce code size, add ESP32 special features; `IF_ESP32` directives) -* started to get CMT info into `system` - not finished - -## 0.7.48 - 2023-09-10 -* fix SSD1309 2.42" display pinout -* improved setup page: save and delete of inverters - -## 0.7.47 - 2023-09-07 -* fix boot loop #1140 -* fix regex in `setup` page -* fix MI serial number display `max-module-power` in `setup` #1142 -* renamed `opendtufusionv1` to `opendtufusion` - -## 0.7.46 - 2023-09-04 -* removed `delay` from ePaper -* started improvements of `/system` -* fix LEDs to check all configured inverters -* send loop skip disabled inverters fix -* print generated DTU SN to console -* HW Versions for MI series PR #1133 -* 2.42" display (SSD1309) integration PR #1139 -* update user manual PR #1121 -* add / rename alarm codes PR #1118 -* revert default pin ESP32 for NRF23-CE #1132 -* luminance of display can be changed during runtime #1106 - -## 0.7.45 - 2023-08-29 -* change ePaper text to symbols PR #1131 -* added some invertes to dev info list #1111 - -## 0.7.44 - 2023-08-28 -* fix `last_success` transmitted to often #1124 - -## 0.7.43 - 2023-08-28 -* improved RSSI for NRF24, now it's read per package (and inverter) #1129 -* arranged `heap` related info together in `/system` -* fix display navi during save -* clean up binary output, separated to folders - -## 0.7.42 - 2023-08-27 -* fix ePaper for opendtufusion_v2.x boards (Software SPI) -* add signal strength for NRF24 - PR #1119 -* refactor wifi class to support ESP32 S2 PR #1127 -* update platform for ESP32 to 6.3.2 -* fix opendtufusion LED (were mixed) -* fix `last_success` transmitted to often #1124 -* added ESP32-S3-mini to github actions -* added old Changelog Entries, to have full log of changes - -## 0.7.41 - 2023-08-26 -* merge PR #1117 code spelling fixes #1112 -* alarms were not read after the first day - -## 0.7.40 - 2023-08-21 +* serveral improvements for MI inverters +* add total AC Max Power to WebUI +* added inverter-wise power-level, frequency and night-communication +* added privacy mode option (`/serial`) +* added button `copy to clipboard` to `/serial` +* added ms to `/serial` +* fixed range of HMS / HMT frequencies to 863 to 870 MHz +* read grid profile (`live` -> click inverter name -> `show grid profile`) +* moved MqTT info to `/system` +* beautified `/system` +* added current AC-Power to `/index` page and removed version * added default pins for opendtu-fusion-v1 board -* fixed hw version display in `live` -* removed development builds, renamed environments in `platform.ini` - -## 0.7.39 - 2023-08-21 -* fix background color of invalid inputs -* add hardware info (click in `live` on inverter name) - -## 0.7.38 - 2023-08-21 -* reset alarms at midnight (if inverter is not available) #1105, #1096 -* add option to reset 'max' values on midnight #1102 -* added default pins for CMT2300A (matching OpenDTU) - -## 0.7.37 - 2023-08-18 -* fix alarm time on WebGui #1099 -* added RSSI info for HMS and HMT inverters (MqTT + REST API) - -# RELEASE 0.7.36 - 2023-08-18 - -## 0.7.35 - 2023-08-17 -* fixed timestamp for alarms send over MqTT -* auto-patch of `AsyncWebServer` #834, #1036 -* Update documentation in Git regarding `ESP8266` default NRF24 pin assignments - -## 0.7.34 - 2023-08-16 -* fixed timezone offset of alarms -* added `AC` and `DC` to `/live` #1098 -* changed `ESP8266` default NRF24 pin assignments (`D3` = `CE` and `D4` = `IRQ`) -* fixed background of modal window for bright color -* fix MI crashes -* fix some lost debug messages -* merged PR #1095, MI fixes for 0.7.x versions -* fix scheduled reboot #1097 -* added vector graphic logo `/doc/logo.svg` -* merge PR #1093, improved Nokia5110 display layout - -## 0.7.33 - 2023-08-15 -* add alarms overview to WebGui #608 -* fix webGui total values #1084 - -## 0.7.32 - 2023-08-14 -* fix colors of live view #1091 - -## 0.7.31 - 2023-08-13 -* fixed docu #1085 -* changed active power limit MqTT messages to QOS2 #1072 -* improved alarm messages, added alarm-id to log #1089 -* trigger power limit read on next day (if inverter was offline meanwhile) -* disabled improv implementation to check if it is related to 'Schwuppdizitaet' -* changed live view to gray once inverter isn't available -* added inverter status to API -* changed sum of totals on WebGui depending on inverter status #1084 -* merge maximum power (AC and DC) from PR #1080 - -## 0.7.30 - 2023-08-10 -* attempt to improve speed / response times (Schwuppdizitaet) #1075 - -## 0.7.29 - 2023-08-09 -* MqTT alarm data was never sent, fixed -* REST API: added alarm data -* REST API: made get record obsolete -* REST API: added power limit acknowledge `/api/inverter/id/[0-x]` #1072 - -## 0.7.28 - 2023-08-08 -* fix MI inverter support #1078 - -## 0.7.27 - 2023-08-08 -* added compile option for ethernet #886 -* fix ePaper configuration, missing `Busy`-Pin #1075 - -# RELEASE 0.7.26 - 2023-08-06 - -* fix MqTT `last_success` - -# RELEASE 0.7.25 - 2023-08-06 - -## 0.7.24 - 2023-08-05 -* merge PR #1069 make MqTT client ID configurable -* fix #1016, general MqTT status depending on inverter state machine -* changed icon for fully available inverter to a filled check mark #1070 -* fixed `last_success` update with MqTT #1068 -* removed `improv` esp-web-installer script, because it is not fully functional at this time - -## 0.7.23 - 2023-08-04 -* merge PR #1056, visualization html -* update MqTT library to 1.4.4 -* update RF24 library to 1.4.7 -* update ArduinoJson library to 6.21.3 -* set minimum invervall for `/live` to 5 seconds - -## 0.7.22 - 2023-08-04 -* attempt to fix homeassistant auto discovery #1066 - -## 0.7.21 - 2023-07-30 -* fix MqTT YieldDay Total goes to 0 several times #1016 - -## 0.7.20 - 2023-07-28 -* merge PR #1048 version and hash in API, fixes #1045 -* fix: no yield day update if yield day reads `0` after inverter reboot (mostly on evening) #848 -* try to fix Wifi override #1047 -* added information after NTP sync to WebUI #1040 - -## 0.7.19 - 2023-07-27 -* next attempt to fix yield day for multiple inverters #1016 -* reduced threshold for inverter state machine from 60min to 15min to go from state `WAS_ON` to `OFF` - -## 0.7.18 - 2023-07-26 -* next attempt to fix yield day for multiple inverters #1016 - -## 0.7.17 - 2023-07-25 -* next attempt to fix yield day for multiple inverters #1016 -* added two more states for the inverter status (also docu) - -## 0.7.16 - 2023-07-24 -* next attempt to fix yield day for multiple inverters #1016 -* fix export settings date #1040 -* fix time on WebUI (timezone was not observed) #913 #1016 - -## 0.7.15 - 2023-07-23 -* add NTP sync interval #1019 -* adjusted range of contrast / luminance setting #1041 -* use only ISO time format in Web-UI #913 - -## 0.7.14 - 2023-07-23 -* fix Contrast for Nokia Display #1041 -* attempt to fix #1016 by improving inverter status -* added option to adjust efficiency for yield (day/total) #1028 - -## 0.7.13 - 2023-07-19 -* merged display PR #1027 -* add date, time and version to export json #1024 - -## 0.7.12 - 2023-07-09 -* added inverter status - state-machine #1016 - -## 0.7.11 - 2023-07-09 -* fix MqTT endless loop #1013 - -## 0.7.10 - 2023-07-08 -* fix MqTT endless loop #1013 - -## 0.7.9 - 2023-07-08 -* added 'improve' functions to set wifi password directly with ESP web tools #1014 -* fixed MqTT publish while applying power limit #1013 -* slightly improved HMT live view (Voltage & Current) - -## 0.7.8 - 2023-07-05 -* fix `YieldDay`, `YieldTotal` and `P_AC` in `TotalValues` #929 -* fix some serial debug prints -* merge PR #1005 which fixes issue #889 -* merge homeassistant PR #963 -* merge PR #890 which gives option for scheduled reboot at midnight (default off) - -## 0.7.7 - 2023-07-03 -* attempt to fix MqTT `YieldDay` in `TotalValues` #927 -* attempt to fix MqTT `YieldDay` and `YieldTotal` even if inverters are not completely available #929 -* fix wrong message 'NRF not connected' if it is disabled #1007 - -## 0.7.6 - 2023-06-17 -* fix display of hidden SSID checkbox -* changed yield correction data type to `double`, now decimal places are supported -* corrected name of 0.91" display in settings -* attempt to fix MqTT zero values only if setting is there #980, #957 -* made AP password configurable #951 -* added option to start without time-sync, eg. for AP-only-mode #951 - -## 0.7.5 - 2023-06-16 -* fix yield day reset on midnight #957 -* improved tickers in `app.cpp` - -## 0.7.4 - 2023-06-15 -* fix MqTT `P_AC` send if inverters are available #987 -* fix assignments for HMS 1CH and 2CH devices -* fixed uptime overflow #990 - -## 0.7.3 - 2023-06-09 -* fix hidden SSID scan #983 -* improved NRF24 missing message on home screen #981 -* fix MqTT publishing only updated values #982 - -## 0.7.2 - 2023-06-08 -* fix HMS-800 and HMS-1000 assignments #981 -* make nrf enabled all the time for ESP8266 -* fix menu item `active` highlight for 'API' and 'Doku' -* fix MqTT totals issue #927, #980 -* reduce maximum number of inverters to 4 for ESP8266, increase to 16 for ESP32 - -## 0.7.1 - 2023-06-05 -* enabled power limit control for HMS / HMT devices -* changed NRF24 lib version back to 1.4.5 because of compile problems for EPS8266 - -## 0.7.0 - 2023-06-04 -* HMS / HMT support for ESP32 devices - -## 0.6.15 - 2023-05-25 -* improved Prometheus Endpoint PR #958 -* fix turn off ePaper only if setting was set #956 -* improved reset values and update MqTT #957 - -## 0.6.14 - 2023-05-21 -* merge PR #902 Mono-Display - -## 0.6.13 - 2023-05-16 -* merge PR #934 (fix JSON API) and #944 (update manual) - -## 0.6.12 - 2023-04-28 -* improved MqTT -* fix menu active item - -## 0.6.11 - 2023-04-27 -* added MqTT class for publishing all values in Arduino `loop` - -## 0.6.10 - HMS -* Version available in `HMS` branch - -# RELEASE 0.6.9 - 2023-04-19 - -## 0.6.8 - 2023-04-19 -* fix #892 `zeroYieldDay` loop was not applied to all channels - -## 0.6.7 - 2023-04-13 -* merge PR #883, improved store of settings and javascript, thx @tastendruecker123 -* support `.` and `,` as floating point separator in setup #881 - -## 0.6.6 - 2023-04-12 -* increased distance for `import` button in mobile view #879 -* changed `led_high_active` to `bool` #879 - -## 0.6.5 - 2023-04-11 -* fix #845 MqTT subscription for `ctrl/power/[IV-ID]` was missing -* merge PR #876, check JSON settings during read for existence -* **NOTE:** incompatible change: renamed `led_high_active` to `act_high`, maybe setting must be changed after update -* merge PR #861 do not send channel metric if channel is disabled - -## 0.6.4 - 2023-04-06 -* merge PR #846, improved NRF24 communication and MI, thx @beegee3 & @rejoe2 -* merge PR #859, fix burger menu height, thx @ThomasPohl - -## 0.6.3 - 2023-04-04 -* fix login, password length was not checked #852 -* merge PR #854 optimize browser caching, thx @tastendruecker123 #828 -* fix WiFi reconnect not working #851 -* updated issue templates #822 - -## 0.6.2 - 2023-04-04 -* fix login from multiple clients #819 -* fix login screen on small displays - -## 0.6.1 - 2023-04-01 -* merge LED fix - LED1 shows MqTT state, LED configurable active high/low #839 -* only publish new inverter data #826 -* potential fix of WiFi hostname during boot up #752 - -# RELEASE 0.6.0 - 2023-03-27 - -## 0.5.110 -* MQTT fix reconnection by new lib version #780 -* add `about` page -* improved documentation regarding SPI pins #814 -* improved documentation (getting started) #815 #816 -* improved MI 4-ch inverter #820 - -## 0.5.109 -* reduced heap fragmentation by optimizing MqTT #768 -* ePaper: centered text thx @knickohr - -## 0.5.108 -* merge: PR SPI pins configurable (ESP32) #807, #806 (requires manual set of MISO=19, MOSI=23, SCLK=18 in GUI for existing installs) -* merge: PR MI serial outputs #809 -* fix: no MQTT `total` sensor for autodiscover if only one inverter was found #805 -* fix: MQTT `total` renamed to `device_name` + `_TOTOL` for better visibility #805 - -## 0.5.107 -* fix: show save message -* fix: removed serial newline for `enqueueCmd` -* Merged improved Prometheus #808 - -## 0.5.106 -* merged MI and debug message changes #804 -* fixed MQTT autodiscover #794, #632 - -## 0.5.105 -* merged MI, thx @rejoe2 #788 -* fixed reboot message #793 - -## 0.5.104 -* further improved save settings -* removed `#` character from ePaper -* fixed saving pinout for `Nokia-Display` -* removed `Reset` Pin for monochrome displays -* improved wifi connection #652 - -## 0.5.103 -* merged MI improvements, thx @rejoe2 #778 -* changed display inverter online message -* merged heap improvements #772 - -## 0.5.102 -* Warning: old exports are not compatible any more! -* fix JSON import #775 -* fix save settings, at least already stored settings are not lost #771 -* further save settings improvements (only store inverters which are existing) -* improved display of settings save return value -* made save settings asynchronous (more heap memory is free) - -## 0.5.101 -* fix SSD1306 -* update documentation -* Update miPayload.h -* Update README.md -* MI - remarks to user manual -* MI - fix AC calc -* MI - fix status msg. analysis - -## 0.5.100 -* fix add inverter `setup.html` #766 -* fix MQTT retained flag for total values #726 -* renamed buttons for import and export `setup.html` -* added serial message `settings saved` - -## 0.5.99 -* fix limit in [User_Manual.md](../User_Manual.md) -* changed `contrast` to `luminance` in `setup.html` -* try to fix SSD1306 display #759 -* only show necessary display pins depending on setting - -## 0.5.98 -* fix SH1106 rotation and turn off during night #756 -* removed MQTT subscription `sync_ntp`, `set_time` with a value of `0` does the same #696 -* simplified MQTT subscription for `limit`. Check [User_Manual.md](../User_Manual.md) for new syntax #696, #713 -* repaired inverter wise limit control -* fix upload settings #686 - -## 0.5.97 -* Attention: re-ordered display types, check your settings! #746 -* improved saving settings of display #747, #746 -* disabled contrast for Nokia display #746 -* added Prometheus as compile option #719, #615 -* update MQTT lib to v1.4.1 -* limit decimal places to 2 in `live` -* added `-DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48` to esp8266 debug build #657 -* a `max-module-power` of `0` disables channel in live view `setup` -* merge MI improvements, get firmware information #753 - -## 0.5.96 -* added Nokia display again for ESP8266 #764 -* changed `var` / `VAr` to SI unit `var` #732 -* fix MQTT retained flags for totals (P_AC, P_DC) #726, #721 - -## 0.5.95 -* merged #742 MI Improvements -* merged #736 remove obsolete JSON Endpoint - -## 0.5.94 -* added ePaper (for ESP32 only!), thx @dAjaY85 #735 -* improved `/live` margins #732 -* renamed `var` to `VAr` #732 - -## 0.5.93 -* improved web API for `live` -* added dark mode option -* converted all forms to reponsive design -* repaired menu with password protection #720, #716, #709 -* merged MI series fixes #729 - -## 0.5.92 -* fix mobile menu -* fix inverters in select `serial.html` #709 - -## 0.5.91 -* improved html and navi, navi is visible even when API dies #660 -* reduced maximum allowed JSON size for API to 6000Bytes #660 -* small fix: output command at `prepareDevInformCmd` #692 -* improved inverter handling #671 - -## 0.5.90 -* merged PR #684, #698, #705 -* webserial minor overflow fix #660 -* web `index.html` improve version information #701 -* fix MQTT sets power limit to zero (0) #692 -* changed `reset at midnight` with timezone #697 - -## 0.5.89 -* reduced heap fragmentation (removed `strtok` completely) #644, #645, #682 -* added part of mac address to MQTT client ID to separate multiple ESPs in same network -* added dictionary for MQTT to reduce heap-fragmentation -* removed `last Alarm` from Live view, because it showed always the same alarm - will change in future - -## 0.5.88 -* MQTT Yield Day zero, next try to fix #671, thx @beegee3 -* added Solenso inverter to supported devices -* improved reconnection of MQTT #650 - -## 0.5.87 -* fix yield total correction as module (inverter input) value #570 -* reneabled instant start communication (once NTP is synced) #674 - -## 0.5.86 -* prevent send devcontrol request during disabled night communication -* changed yield total correction as module (inverter input) value #570 -* MQTT Yield Day zero, next try to fix #671 - -## 0.5.85 -* fix power-limit was not checked for max retransmits #667 -* fix blue LED lights up all the time #672 -* fix installing schedulers if NTP server isn't available -* improved zero values on triggers #671 -* hardcoded MQTT subtopics, because wildcard `#` leads to errors -* rephrased some messages on webif, thx to @Argafal #638 -* fixed 'polling stop message' on `index.html` #639 - -## 0.5.84 -* fix blue LED lights up all the time #672 -* added an instant start communication (once NTP is synced) -* add MI 3rd generation inverters (10x2 serial numbers) -* first decodings of messages from MI 2nd generation inverters - -## 0.5.83 -* fix MQTT publishing, `callback` was set but reset by following `setup()` - -## 0.5.82 -* fixed communication error #652 -* reset values is no bound to MQTT any more, setting moved to `inverter` #649 -* fixed wording on `index.hmtl` #661 - -## 0.5.81 -* started implementation of MI inverters (setup.html, own processing `MiPayload.h`) - -## 0.5.80 -* fixed communication #656 - -## 0.5.79 -* fixed mixed reset flags #648 -* fixed `mCbAlarm` if MQTT is not used #653 -* fixed MQTT `autodiscover` #630 thanks to @antibill51 -* next changes from @beegee many thanks for your contribution! -* replaced `CircularBuffer` by `std::queue` -* reworked `hmRadio.h` completely (interrupts, packaging) -* fix exception while `reboot` -* cleanup MQTT coding - -## 0.5.78 -* further improvements regarding wifi #611, fix connection if only one AP with same SSID is there -* fix endless loop in `zerovalues` #564 -* fix auto discover again #565 -* added total values to autodiscover #630 -* improved zero at midnight #625 - -## 0.5.77 -* fix wrong filename for automatically created manifest (online installer) #620 -* added rotate display feature #619 -* improved Prometheus endpoint #615, thx to @fsck-block -* improved wifi to connect always to strongest RSSI, thx to @beegee3 #611 - -## 0.5.76 -* reduce MQTT retry interval from maximum speed to one second -* fixed homeassistant autodiscovery #565 -* implemented `getNTPTime` improvements #609 partially #611 -* added alarm messages to MQTT #177, #600, #608 - -## 0.5.75 -* fix wakeup issue, once wifi was lost during night the communication didn't start in the morning -* re-enabled FlashStringHelper because of lacking RAM -* complete rewrite of monochrome display class, thx to @dAjaY85 -> displays are now configurable in setup -* fix power limit not possible #607 - -## 0.5.74 -* improved payload handling (retransmit all fragments on CRC error) -* improved `isAvailable`, checks all record structs, inverter becomes available more early because version is check first -* fix tickers were not set if NTP is not available -* disabled annoying `FlashStringHelper` it gives randomly Exceptions during development, feels more stable since then -* moved erase button to the bottom in settings, not nice but more functional -* split `tx_count` to `tx_cnt` and `retransmits` in `system.html` -* fix mqtt retransmit IP address #602 -* added debug infos for `scheduler` (web -> `/debug` as trigger prints list of tickers to serial console) - -## 0.5.73 -* improved payload handling (request / retransmit) #464 -* included alarm ID parse to serial console (in development) - -## 0.5.72 -* repaired system, scheduler was not called any more #596 - -## 0.5.71 -* improved wifi handling and tickers, many thanks to @beegee3 #571 -* fixed YieldTotal correction calculation #589 -* fixed serial output of power limit acknowledge #569 -* reviewed `sendDiscoveryConfig` #565 -* merged PR `Monodisplay`, many thanks to @dAjaY85 #566, Note: (settings are introduced but not able to be modified, will be included in next version) - -## 0.5.70 -* corrected MQTT `comm_disabled` #529 -* fix Prometheus and JSON endpoints (`config_override.h`) #561 -* publish MQTT with fixed interval even if inverter is not available #542 -* added JSON settings upload. NOTE: settings JSON download changed, so only settings should be uploaded starting from version `0.5.70` #551 -* MQTT topic and inverter name have more allowed characters: `[A-Za-z0-9./#$%&=+_-]+`, thx: @Mo Demman -* improved potential issue with `checkTicker`, thx @cbscpe -* MQTT option for reset values on midnight / not avail / communication stop #539 -* small fix in `tickIVCommunication` #534 -* add `YieldTotal` correction, eg. to have the option to zero at year start #512 - -## 0.5.69 -* merged SH1106 1.3" Display, thx @dAjaY85 -* added SH1106 to automatic build -* added IP address to MQTT (version, device and IP are retained and only transmitted once after boot) #556 -* added `set_power_limit` acknowledge MQTT publish #553 -* changed: version, device name are only published via MQTT once after boot -* added `Login` to menu if admin password is set #554 -* added `development` to second changelog link in `index.html` #543 -* added interval for MQTT (as option). With this settings MQTT live data is published in a fixed timing (only if inverter is available) #542, #523 -* added MQTT `comm_disabled` #529 -* changed name of binaries, moved GIT-Sha to the front #538 - -## 0.5.68 -* repaired receive payload -* Powerlimit is transferred immediately to inverter - -## 0.5.67 -* changed calculation of start / stop communication to 1 min after last comm. stop #515 -* moved payload send to `payload.h`, function `ivSend` #515 -* payload: if last frame is missing, request all frames again - -# RELEASE 0.5.66 - 2022-12-30 - -## 0.5.65 -* wifi, code optimization #509 - -## 0.5.64 -* channel name can use any character, not limited any more -* added `/` to MQTT topic and Inverter name -* trigger for `calcSunrise` is now using local time #515 -* fix reconnect timeout for WiFi #509 -* start AP only after boot, not on WiFi connection loss -* improved /system `free_heap` value (measured before JSON-tree is built) - -## 0.5.63 -* fix Update button protection (prevent double click #527) -* optimized scheduler #515 (thx @beegee3) -* potential fix of #526 duplicates in API `/api/record/live` -* added update information to `index.html` - -## 0.5.62 -* fix MQTT `status` update -* removed MQTT `available_text` (can be deducted from `available`) -* enhanced MQTT documentation in `User_Manual.md` -* removed `tickSunset` and `tickSunrise` from MQTT. It's not needed any more because of minute wise check of status (`processIvStatus`) -* changed MQTT topic `status` to nummeric value, check documentation in `User_Manual.md` -* fix regular expression of `setup.html` for inverter name and channel name - -## 0.5.61 -* fix #521 no reconnect at beginning of day -* added immediate (each minute) report of inverter status MQTT #522 -* added protection mask to select which pages should be protected -* update of monochrome display, show values also if nothing changed - -## 0.5.60 -* added regex to inverter name and MQTT topic (setup.html) -* beautified serial.html -* added ticker for wifi loop #515 - -## 0.5.59 -* fix night communication enable -* improved different WiFi connection scenarios (STA WiFi not found, reconnect #509, redirect for AP to configuration) -* increased MQTT user, pwd and topic length to 64 characters + `\0`. (The string end `\0` reduces the available size by one) #516 - -## 0.5.58 -* improved stability -* improved WiFi initial connection - especially if station WiFi is not available -* removed new operators from web.h (reduce dynamic allocation) -* improved sun calculation #515, #505 -* fixed WiFi auto reconnect #509 -* added disable night communication flag to MQTT #505 -* changed MQTT publish of `available` and `available_text` to sunset #468 - -## 0.5.57 -* improved stability -* added icons to index.html, added WiFi-strength symbol on each page -* moved packet stats and sun to system.html -* refactored communication offset (adjustable in minutes now) - -## 0.5.56 -* factory reset formats entire little fs -* renamed sunrise / sunset on index.html to start / stop communication -* show system information only if called directly from menu -* beautified system.html - -## 0.5.55 -* fixed static IP save - -## 0.5.54 -* changed sunrise / sunset calculation, angle is now `-3.5` instead of original `-0.83` -* improved scheduler (removed -1 from `reload`) #483 -* improved reboot flag in `app.h` -* fixed #493 no MQTT payload once display is defined - -## 0.5.53 -* Mono-Display: show values in offline mode #498 -* improved WiFi class #483 -* added communication enable / disable (to test multiple DTUs with the same inverter) -* fix factory reset #495 - -## 0.5.52 -* improved ahoyWifi class -* added interface class for app -* refactored web and webApi -> RestApi -* fix calcSunrise was not called every day -* added MQTT RX counter to index.html -* all values are displayed on /live even if they are 0 -* added MQTT /status to show status over all inverters - -## 0.5.51 -* improved scheduler, @beegee3 #483 -* refactored get NTP time, @beegee3 #483 -* generate `bin.gz` only for 1M device ESP8285 -* fix calcSunrise was not called every day -* increased number of allowed characters for MQTT user, broker and password, @DanielR92 -* added NRF24 info to Systeminfo, @DanielR92 -* added timezone for monochrome displays, @gh-fx2 -* added support for second inverter for monochrome displays, @gh-fx2 - -## 0.5.50 -* fixed scheduler, uptime and timestamp counted too fast -* added / renamed automatically build outputs -* fixed MQTT ESP uptime on reconnect (not zero any more) -* changed uptime on index.html to count each second, synced with ESP each 10 seconds - -## 0.5.49 -* fixed AP mode on brand new ESP modules -* fixed `last_success` MQTT message -* fixed MQTT inverter available status at sunset -* reordered enqueue commands after boot up to prevent same payload length for successive commands -* added automatic build for Nokia5110 and SSD1306 displays (ESP8266) - -## 0.5.48 -* added MQTT message send at sunset -* added monochrome display support -* added `once` and `onceAt` to scheduler to make code cleaner -* improved sunrise / sunset calculation - -## 0.5.47 -* refactored ahoyWifi class: AP is opened on every boot, once station connection is successful the AP will be closed -* improved NTP sync after boot, faster sync -* fix NRF24 details only on valid SPI connection - -## 0.5.46 -* fix sunrise / sunset calculation -* improved setup.html: `reboot on save` is checked as default - -## 0.5.45 -* changed MQTT last will topic from `status` to `mqtt` -* fix sunrise / sunset calculation -* fix time of serial web console - -## 0.5.44 -* marked some MQTT messages as retained -* moved global functions to global location (no duplicates) -* changed index.html interval to static 10 seconds -* fix static IP -* fix NTP with static IP -* print MQTT info only if MQTT was configured - -## 0.5.43 -* updated REST API and MQTT (both of them use the same functionality) -* added ESP-heap information as MQTT message -* changed output name of automatic development build to fixed name (to have a static link from https://ahoydtu.de) -* updated user manual to latest MQTT and API changes - -## 0.5.42 -* fix web logout (auto logout) -* switched MQTT library - -# RELEASE 0.5.41 - 2022-11-22 - -# RELEASE 0.5.28 - 2022-10-30 - -# RELEASE 0.5.17 - 2022-09-06 - -# RELEASE 0.5.16 - 2022-09-04 +* added default pins for ESP32 with CMT2300A (matching OpenDTU) +* added ethernet build for fusion board +* added ESP32-S2 to github actions +* added ESP32-S3-mini to github actions +* added ESP32-C3-mini to github actions +* add option to reset 'max' values on midnight +* luminance of display can be changed during runtime +* added developer option to use 'syslog-server' instead of 'web-serail' +* added / renamed alarm codes +* changed MqTT alarm topic, removed retained flag +* added default input power to `400` while adding new inverters +full version log: [Development Log](https://github.com/lumapu/ahoy/blob/development03/src/CHANGES.md) \ No newline at end of file diff --git a/src/defines.h b/src/defines.h index 6eadb705..ff7e9772 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 33 +#define VERSION_PATCH 34 //------------------------------------- typedef struct { From 35e530c0c9f6f06c00f7a3500d01e5f23741eb77 Mon Sep 17 00:00:00 2001 From: DanielR92 Date: Fri, 29 Dec 2023 19:55:10 +0100 Subject: [PATCH 08/11] Some changes in readme --- Getting_Started.md | 188 ++++++++++++++++++++++----------------------- README.md | 12 +-- ahoy_config.md | 65 ++++++++++++++++ 3 files changed, 166 insertions(+), 99 deletions(-) create mode 100644 ahoy_config.md diff --git a/Getting_Started.md b/Getting_Started.md index f6a89dde..81193ed0 100644 --- a/Getting_Started.md +++ b/Getting_Started.md @@ -1,12 +1,13 @@ + ## Overview -On this page, you'll find detailed instructions on how to wire the module of a Wemos D1 mini or ESP32 to the radio module, as well as how to flash it with the latest firmware. This information will enable you to communicate with compatible inverters. +This page contains detailed instructions on building a module and flashing it with the latest firmware. Following these instructions will allow you to communicate with compatible inverters. You find the full [User_Manual here](User_Manual.md) ## Compatiblity -The following inverters are currently supported out of the box: +Currently, the following inverters are supported: Hoymiles Inverters @@ -20,7 +21,6 @@ Hoymiles Inverters ## Table of Contents -- [Table of Contents](#table-of-contents) - [Overview](#overview) - [Compatiblity](#compatiblity) - [Things needed](#things-needed) @@ -38,7 +38,6 @@ Hoymiles Inverters - [ESP32 GPIO settings](#esp32-gpio-settings) - [Flash the Firmware on your Ahoy DTU Hardware](#flash-the-firmware-on-your-ahoy-dtu-hardware) - [Compiling your own Version](#compiling-your-own-version) - - [Optional Configuration before compilation](#optional-configuration-before-compilation) - [Using a ready-to-flash binary using nodemcu-pyflasher](#using-a-ready-to-flash-binary-using-nodemcu-pyflasher) - [Connect to your Ahoy DTU](#connect-to-your-ahoy-dtu) - [Your Ahoy DTU is very verbose using the Serial Console](#your-ahoy-dtu-is-very-verbose-using-the-serial-console) @@ -56,47 +55,52 @@ Solenso Inverters: ## Things needed -If you're interested in building your own AhoyDTU, you'll need a few things to get started. While we've provided a list of recommended boards below, keep in mind that the maker community is constantly developing new and innovative options that we may not have covered in this readme.. +To build your own AhoyDTU, you only need a few things. Remember that the maker community is always developing new and innovative options that we may not have covered in this readme. + +Start with an ESP8266 or ESP32, and combine it with an NRF24L01+ breakout board. Other ESP boards with at least 4MBytes of ROM may also be suitable. -For optimal performance, we recommend using a Wemos D1 mini or ESP32 along with a NRF24L01+ breakout board as a bare minimum. However, if you have experience working with other ESP boards, any board with at least 4MBytes of ROM may be suitable, depending on your skills. +Make sure to choose an NRF24L01+ module that includes the '+' in its name. This is important because we need the 250kbps features that are only available in the plus-variant. + +**Attention**: The NRF24L01+ can only communicate with the MI/HM/TSUN inverter. For the HMS/HMT it is needed to use a CMT2300A! -Just be sure that the NRF24L01+ module you choose includes the "+" in its name, as we rely on the 250kbps features that are only provided by the plus-variant. | **Parts** | **Price** | | --- | --- | -| D1 ESP8266 Mini WLAN Board Microcontroller | 4,40 Euro | -| NRF24L01+ SMD Modul 2,4 GHz Wi-Fi Funkmodul | 3,45 Euro | -| 100µF / 10V Capacitor Kondensator | 0,15 Euro | -| Jumper Wire Steckbrücken Steckbrett weiblich-weiblich | 2,49 Euro | -| **Total costs** | **10,34 Euro** | +| D1 ESP8266 Mini WLAN Board Microcontroller | 4,40 €| +| *NRF24L01+ SMD Modul 2,4 GHz Wi-Fi Funkmodul (not for HMS/HMT)* | *3,45 €*| +| *CMT2300A 868/915MHz (E49-900M20S)* | *4,59 €* | +| 100µF / 10V Capacitor Kondensator | 0,15 €| +| Jumper Wire Steckbrücken Steckbrett weiblich-weiblich | 2,49 €| +| **Total costs** | **10,34 € / 11,48 €** | -If you're interested in using our sister project OpenDTU or you want to future-proof your setup, we recommend investing in an ESP32 board that features two CPU cores. As Radio you can also use a NRF24L01+ module with an external antenna. While this option may cost a bit more, it will provide superior performance and ensure compatibility with upcoming developments. +To future-proof your setup and use our sister project OpenDTU, we recommend investing in an ESP32 board with two CPU cores. Additionally, you can use a NRF24L01+ module with an external antenna as a radio for superior performance and compatibility with upcoming developments. | **Parts** | **Price** | | --- | --- | -| ESP32 Dev Board NodeMCU WROOM32 WiFi | 7,90 Euro | -| NRF24L01+ PA LNA SMA mit Antenne Long | 4,50 Euro | -| 100µF / 10V Capacitor Kondensator | 0,15 Euro | -| Jumper Wire Steckbrücken Steckbrett weiblich-weiblich | 2,49 Euro | -| **Total costs** | **14,89 Euro** | +| ESP32 Dev Board NodeMCU WROOM32 WiFi | 7,90 €| +| *NRF24L01+ SMD Modul 2,4 GHz Wi-Fi Funkmodul (not for HMS/HMT)* | *3,45 €*| +| *CMT2300A 868/915MHz (E49-900M20S)* | *4,59 €* | +| 100µF / 10V Capacitor Kondensator | 0,15 €| +| Jumper Wire breadboard female-female | 2,49 €| +| **Total costs** | **13,99 € / 15,13 €** | #### There are fake NRF24L01+ Modules out there +Beware of fake NRF24L01+ modules that use rebranded NRF24L01 chips (without the +). +An example of this can be found in Issue #230 (https://github.com/lumapu/ahoy/issues/230). +If you have any additional examples of fake chips, please share them with us and we will add the information here. -Watch out, there are some fake NRF24L01+ Modules out there that seem to use rebranded NRF24L01 Chips (without the +).
-An example can be found in [Issue #230](https://github.com/lumapu/ahoy/issues/230).
-You are welcome to add more examples of faked chips. We will add that information here.
- -Some users reported better connection or longer range through more walls when using the -"E01-ML01DP5" EBYTE 2,4 GHz Wireless Modul nRF24L01 + PA + LNA RF Modul, SMA-K Antenna connector, -which has an eye-catching HF cover. But beware: It comes without the antenna! +#### NRF24L01+ improvements +Users have reported improved connections and longer range through walls when using these modules. +The "E01-ML01DP5" module is a 2.4 GHz wireless module that utilizes the nRF24L01+PA+LNA RF module and features an SMA-K antenna connector. +**The product includes an HF cover, but please note that it does not come with an antenna.** -In any case you should stabilize the Vcc power by a capacitor and don't exceed the Amplifier Power Level "LOW". -Users reporting good connection over 10m through walls / ceilings with Amplifier Power Level "MIN". -It is not always the bigger the better... +To achieve the best results, stabilize the Vcc power by using a capacitor and do not exceed the 'LOW' Amplifier Power Level. +Users have reported good connections over 10m through walls and ceilings when using the Amplifier Power Level 'MIN'. +It's important to remember that bigger is not always better. -Power levels "HIGH" and "MAX" are meant to wirings where the nRF24 is supplied by an extra 3.3 Volt regulator. -The bultin regulator on ESP boards has only low reserves in case WiFi and nRF are sending simultaneously. -If you operate additional interfaces like a display, the reserve is again reduced. +If you are using the NRF24 directly on the ESP board, make sure to set the transmission power to the lowest possible level (this can be adjusted later in the web interface). Using a high transmission power can potentially cause problems. +The ESP board's built-in controller has limited reserves in case both WiFi and nRF are transmitting simultaneously. +If you are using additional interfaces, such as a display, the reserves will be further reduced. ## Wiring things up @@ -117,15 +121,12 @@ Additional, there are 3 pins, which can be set individual: *These pins can be changed from the /setup URL.* #### ESP8266 wiring example on WEMOS D1 - -This is an example wiring using a Wemos D1 mini.
+This is an example wiring using a Wemos D1 mini. ##### Schematic - ![Schematic](https://ahoydtu.de/img/fritzing/esp8266_nrf_sch.png) ##### Symbolic view - ![Symbolic](https://ahoydtu.de/img/fritzing/esp8266_nrf.png) #### ESP8266 wiring example on 30pin Lolin NodeMCU v3 @@ -162,42 +163,34 @@ CE D2 (GPIO4) IRQ D0 (GPIO16 - no IRQ!) ``` -IMPORTANT: From development version 108/release 0.6.0 onwards, also MISO, MOSI, and SCLK -are configurable. On new installations, their defaults are correct for most ESP32 boards. -These pins cannot be configured for ESP82xx boards, as this chip cannot move them elsewhere. +**IMPORTANT**: Starting from development version 108/release 0.6.0, MISO, MOSI, and SCLK are also included. + For most ESP32 boards, the default settings are correct on new installations. +However, it is not possible to configure these pins for ESP82xx boards, as they cannot be moved elsewhere. -If you are upgrading an existing install though, you might see that these pins are set to '0' in the web GUI. -Communication with the NRF module wont work. For upgrading an existing installations, set MISO=19, MOSI=23, SCLK=18 in the settings. -This is the correct default for most ESP32 boards. On ESP82xx, simply saving the settings without changes should suffice. +If you are upgrading an existing installation, you may notice that the pins are set to '0' in the web GUI, which will prevent communication with the NRF module. +To resolve this, set MISO=19, MOSI=23, SCLK=18 in the settings. +This is the correct default for most ESP32 boards. For ESP82xx, simply saving the settings without changes should suffice. Save and reboot. ## Flash the Firmware on your Ahoy DTU Hardware -Once your Hardware is ready to run, you need to flash the Ahoy DTU Firmware to your Board. -You can either build your own using your own configuration or use one of our pre-compiled generic builds. +After preparing your hardware, you must flash the Ahoy DTU Firmware to your board. +You can either create your own firmware using your configuration or use one of our pre-compiled generic builds. + +Are you ready to flash? Then go to next Step here. ### Flash from your browser (easy) The easiest step for you is to flash online. A browser MS Edge or Google Chrome is required. [Here you go](https://ahoydtu.de/web_install/) -### Compiling your own Version - -This information suits you if you want to configure and build your own firmware. - -This code comes to you as a **PlatformIO** project and can be compiled using the **PlatformIO** Addon.
-Visual Studio Code, AtomIDE and other IDE's support the PlatformIO Addon.
-If you do not want to compile your own build, you can use one of our ready-to-flash binaries. - -##### Optional Configuration before compilation +### Compiling your own Version (expert) +This information is for those who wish to configure and build their own firmware. -- number of supported inverters (set to 3 by default) `config.h` -- DTU radio id `config.h` (default = 1234567801) -- unformatted list in webbrowser `/livedata` `config.h`, `LIVEDATA_VISUALIZED` - -Alternativly, instead of modifying `config.h`, `config_override_example.h` can be copied to `config_override.h` and customized. -config_override.h is excluded from version control and stays local. +The code is provided as a PlatformIO project and can be compiled using the PlatformIO Addon. +The PlatformIO Addon is supported by Visual Studio Code, AtomIDE, and other IDEs. +If you do not wish to compile your own build, you can use one of our pre-compiled binaries. #### Using a ready-to-flash binary using nodemcu-pyflasher @@ -217,7 +210,7 @@ This information suits you if you just want to use an easy way. Once your Ahoy DTU is running, you can use the Over The Air (OTA) capabilities to update your firmware. -! ATTENTION: If you update from a very low version to the newest, please make sure to wipe all flash data! +**! ATTENTION: If you update from a very low version to the newest, please make sure to wipe all flash data!** #### Flashing on Linux with `esptool.py` (ESP32) 1. install [esptool.py](https://docs.espressif.com/projects/esptool/en/latest/esp32/) if you haven't already. @@ -229,51 +222,56 @@ Once your Ahoy DTU is running, you can use the Over The Air (OTA) capabilities t ## Connect to your Ahoy DTU -When everything is wired up and the firmware is flashed, it is time to connect to your Ahoy DTU. +Once everything is wired and the firmware is flashed, it is time to connect to your Ahoy DTU. #### Your Ahoy DTU is very verbose using the Serial Console - When connected to your computer, you can open a Serial Console to obtain additional information.
- This might be useful in case of any troubles that might occur as well as to simply
- obtain information about the converted values which were read out of the inverter(s). + Once connected to your computer, you can open a serial console to get additional information. + This can be useful for troubleshooting, as well as simply to get + information about the converted values read from the inverter(s). #### Connect to the Ahoy DTU Webinterface using your Browser - After you have sucessfully flashed and powered your Ahoy DTU, you can access it via your Browser.
- If your Ahoy DTU was able to log into the configured WiFi Network, it will try to obtain an IP-Address
- from your local DHCP Server (in most cases thats your Router).

- In case it could not connect to your configured Network, it will provide its own WiFi Network that you can
- connect to for furter configuration.
- The WiFi SSID *(the WiFi Name)* and Passwort is configured in the config.h and defaults to the SSID "`AHOY-DTU`" with the Passwort "`esp_8266`".
- The Ahoy DTU will keep that Network open for a certain amount of time (also configurable in the config.h and defaults to 60secs).
- If nothing connects to it and that time runs up, it will retry to connect to the configured network an so on.
-
- If connected to your local Network, you just have to find out the used IP Address or try the default name [http://ahoy-dtu/](http://ahoy-dtu/). In most cases your Router will give you a hint.
- If you connect to the WiFi the Ahoy DTU opens in case it could not connect to any other Network, the IP-Address of your Ahoy DTU is [http://192.168.4.1/](http://192.168.4.1/).
- Just open the IP-Address in your browser.
-
- The webinterface has the following abilities: - -- OTA Update (Over The Air Update) -- Configuration (Wifi, inverter(s), NTP Server, Pinout, MQTT, Amplifier Power Level, Debug) -- visual display of the connected inverters / modules -- some statistics about communication (debug) + After you have successfully flashed and powered up your Ahoy DTU, you can access it from your browser.
+ If your Ahoy DTU was able to log on to the configured WiFi network, it will try to obtain an IP address from your local DHCP server (in most cases this is your router). + + If it cannot connect to your configured network, it will provide its own WiFi network that you can + to for further configuration. + + The WiFi SSID *(the WiFi name)* and password are pre-configured and are set to SSID "`AHOY-DTU`" and password "`esp_8266`" by default. + + The Ahoy DTU will keep this network open for a certain amount of time (default is 60sec). + If nothing connects to it and the time expires, it will retry to connect to the configured network, and so on. + + If you are connected to your local network, just find out the IP address used or try the default name [http://ahoy-dtu/](http://ahoy-dtu/). + In most cases, your router will give you a hint. + + If you connect to the WiFi the Ahoy DTU opens in case it could not connect to any other Network, the IP-Address of your Ahoy DTU is [http://192.168.4.1/](http://192.168.4.1/). + Just open the IP-Address in your browser. + + The web interface has the following capabilities: + +- Live data (values updated every 5 seconds) + Click on the title/name/alarm for more actions. +- Webserial (Debug) +- Settings (System Config, Network, Protection, Inverter, NTP Server, Sunrise/Sunset, MQTT, Display Config) +- Update (Over The Air Update) +- System (status about the modules) ##### HTTP based Pages - To take control of your Ahoy DTU, you can directly call one of the following sub-pages (e.g. [http://ahoy-dtu/setup](http://ahoy-dtu/setup) or [http://192.168.4.1/setup](http://192.168.4.1/setup) ).
+ To take control of your Ahoy DTU, you can directly call one of the following sub-pages (e.g. [http://ahoy-dtu/setup](http://ahoy-dtu/setup) or [http://192.168.4.1/setup](http://192.168.4.1/setup) ). | page | use | output | default availability | | ---- | ------ | ------ | ------ | -| /uptime | displays the uptime uf your Ahoy DTU | 0 Days, 01:37:34; now: 2022-08-21 11:13:53 | yes | +| /logout| logout the user from webinterface | | yes | | /reboot | reboots the Ahoy DTU | | yes | +| /system| show system inforamtion | | yes | +| /live | displays the live data | | yes | +| /save | | | yes | | /erase | erases the EEPROM | | yes | | /factory | resets to the factory defaults configured in config.h | | yes | | /setup | opens the setup page | | yes | -| /save | | | yes | -| /cmdstat | show stat from the home page | | yes | -| /visualization | displays the information from your converter | | yes | -| /livedata | displays the live data | | yes | | /metrics | gets live-data for prometheus | prometheus metrics from the livedata | no - enable via config_override.h | | /api | gets configuration and live-data in JSON format | json output from the configuration or livedata | yes | @@ -290,12 +288,14 @@ When everything is wired up and the firmware is flashed, it is time to connect t | `SPI` | 1.0 | LGPL-2.1 | | `Hash` | 1.0 | LGPL-2.1 | | `EEPROM` | 1.0 | LGPL-2.1 | -| `ESP Async WebServer` | 1.2.3 | LGPL-3.0 | -| `ESPAsyncTCP` | 1.2.2 | LGPL-3.0 | -| `Time` | 1.6.1 | LGPL-2.1 | -| `RF24` | 1.4.7 | GPL-2.0 | -| `espMqttClient` | 1.4.4 | MIT | -| `ArduinoJson` | 6.21.3 | MIT | +| `ESPAsyncWebServer` | 1.2.3 | LGPL-3.0 | +| [ESPAsyncTCP](https://github.com/me-no-dev/ESPAsyncTCP) | 1.2.2 | [LGPL-3.0 license](https://github.com/me-no-dev/ESPAsyncTCP#LGPL-3.0-1-ov-file) | +| [Time](https://github.com/PaulStoffregen/Time) | 1.6.1 | ? | +| [RF24](https://github.com/nRF24/RF24) | 1.4.8 | [GPL-2.0 license](https://github.com/nRF24/RF24#GPL-2.0-1-ov-file) | +| [espMqttClient](https://github.com/bertmelis/espMqttClient) | ? | [MIT license](https://github.com/bertmelis/espMqttClient#MIT-1-ov-file) | +| [ArduinoJson](https://github.com/bblanchon/ArduinoJson) | 6.21.3 | [MIT license](https://github.com/bblanchon/ArduinoJson#MIT-1-ov-file)| +| [GxEPD2](https://github.com/ZinggJM/GxEPD2) | 1.5.2 | [GPL-3.0 license](https://github.com/ZinggJM/GxEPD2#GPL-3.0-1-ov-file)| +| [U8g2_Arduino](https://registry.platformio.org/libraries/olikraus/U8g2) | [2.35.9](https://registry.platformio.org/libraries/olikraus/U8g2/versions) | [BSD-2-Clause](https://spdx.org/licenses/BSD-2-Clause.html) | ## ToDo diff --git a/README.md b/README.md index f774b568..cc85f1a2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ This work is licensed under a # 🖐 Ahoy! ![Logo](https://github.com/grindylow/ahoy/blob/main/doc/logo1_small.png?raw=true) -This repository offers hardware and software solutions for communicating with Hoymiles inverters via radio. With our system, you can easily obtain real-time values such as power, current, and daily energy. Additionally, you can set parameters like the power limit of your inverter to achieve zero export. You can access these functionalities through our user-friendly web interface, MQTT, or JSON. Whether you're monitoring your solar panel system's performance or fine-tuning its settings, our solutions make it easy to achieve your goals. +This repository provides hardware and software solutions for communicating with Hoymiles inverters via radio. Our system allows you to easily obtain real-time values, such as power, current, and daily energy, as well as set parameters like the power limit of your inverter to achieve zero export. You can access these functionalities through our user-friendly web interface, MQTT, or JSON. Our solutions simplify the process of monitoring and fine-tuning your solar panel system to help you achieve your goals. Table of approaches: @@ -32,9 +32,11 @@ Table of approaches: | [Others, C/C++](tools/nano/NRF24_SendRcv/) | ❌ | ✔️ | ❌ | | ## Getting Started -[Guide how to start with a ESP module](Getting_Started.md) +1. [Guide how to start with a ESP module](Getting_Started.md) -[ESP Webinstaller (Edge / Chrome Browser only)](https://ahoydtu.de/web_install) +2. [ESP Webinstaller (Edge / Chrome Browser only)](https://ahoydtu.de/web_install) + +3. [Ahoy Configuration ](ahoy_config.md) ## Our Website [https://ahoydtu.de](https://ahoydtu.de) @@ -43,11 +45,11 @@ Table of approaches: - [Getting the data into influxDB and visualize them in a Grafana Dashboard](https://grafana.com/grafana/dashboards/16850-pv-power-ahoy/) (thx @Carl) ## Support, Feedback, Information and Discussion -- [Discord Server (~ 3.800 Users)](https://discord.gg/WzhxEY62mB) +- [Discord Server (~ 7.300 Users)](https://discord.gg/WzhxEY62mB) - [The root of development](https://www.mikrocontroller.net/topic/525778) ### Development -If you run into any issues, please feel free to use the issue tracker here on Github. When describing your issue, please be as detailed and precise as possible, and take a moment to consider whether the issue is related to our software. This will help us to provide more effective solutions to your problem. +If you encounter any problems, use the issue tracker on Github. Provide a detailed description of the issue and consider if it is related to our software. This will help us provide effective solutions. **Contributors are always welcome!** diff --git a/ahoy_config.md b/ahoy_config.md new file mode 100644 index 00000000..5c2321de --- /dev/null +++ b/ahoy_config.md @@ -0,0 +1,65 @@ + + +## Ahoy configuration + + So far we have built our own DTU, written a program on it and put it into operation. +But how do I get my data from the inverter? + +To do this, we need to configure the DTU. + +The following steps are required: +1. Set the pinning to communicate with the radio module. +2. Check if Ahoy has a current time +3. Set inverter data + +### 1.) Set the pinning +Once you are in the web interface, you will find the "System Config" sub-item in the Setup area (left). + +This is where you tell the ESP how you connected the radio module. +Note the schematics you saw earlier. - If you haven't noticed them yet, here's another table of connections. + + +#### OpenDTU Fusion (ESP32-S3) +| NRF24 Pin | ESP Pin| +|---------| --------| +| CS (4) | GPIO37 +| CE (3)| GPIO38 +| IRQ (8) | GPIO47 +| SCLK (5)| GPIO36 +| MOSI (6)| GPIO35 +| MISO (7)| GPIO48 + +| CMT2300A | Pin | +|---------| --------| +| CMT| Enabled | +| SCLK| GPIO6 +| SDIO| GPIO5 +| CSB| GPIO4 +| FCSB| GPIO21 +| GPIO3| GPIO8 + +### 2.) Set current time (normal skip this step) +Ahoy needs a current date and time to talk to the inverter. +It works without, but it is recommended to include a time. This allows you to analyze information from the inverter in more detail. +Normally, a date/time should be automatically retrieved from the NTP server. However, it may happen that the firewall of some routers does not allow this. +In the section "Settings -> NTP Server" you can also get the time from your own computer. Or set up your own NTP server. + +### 3.) Set inverter data + +#### add new inverter +Now it's time to place the inverter. This is necessary because it is not the inverter that speaks first, but the DTU (Ahoy). + +Each inverter has its own S.Nr. This also serves as an identity for communication between the DTU and the inverter. + +The S.Nr is a 12-digit number. You can look it up [here (german)](https://github.com/lumapu/ahoy/wiki/Hardware#wie-ist-die-serien-nummer-der-inverter-aufgebaut) for more information. +#### set pv-modules (not necessary) +Click on "Add Inverter" and enter the S.No. and a name. Please keep the name short! +In the upper tab "Inputs" you can enter the data of the solar modules. These are only used directly in Ahoy for calculation and have no influence on the inverter. + +#### set radio parameter (not necessary, only for EU) +In the next tab "Radio" you can adjust the power and other parameters if necessary. However, these should be left as default (EU only). + +#### advanced options (not necessary) +In the "Advanced" section, you can customize more settings. + +# Done - Now check the live site From b5cdd775a77f2c1a350087714bbf230ac9124b9d Mon Sep 17 00:00:00 2001 From: lumapu Date: Sat, 30 Dec 2023 00:20:36 +0100 Subject: [PATCH 09/11] 0.8.35 * added dim option for LEDS * changed reload time for opendtufusion after update to 5s --- .github/workflows/compile_release.yml | 2 +- src/CHANGES.md | 1025 ++++++++++++++++++++++++- src/app.cpp | 22 +- src/config/settings.h | 29 +- src/defines.h | 2 +- src/web/RestApi.h | 3 +- src/web/html/setup.html | 6 +- src/web/web.h | 31 +- 8 files changed, 1051 insertions(+), 69 deletions(-) diff --git a/.github/workflows/compile_release.yml b/.github/workflows/compile_release.yml index 61c920b3..e65494ab 100644 --- a/.github/workflows/compile_release.yml +++ b/.github/workflows/compile_release.yml @@ -77,7 +77,7 @@ jobs: VERSION: ${{ steps.rename-binary-files.outputs.name }} - name: Create Artifact - run: zip --junk-paths ${{ steps.rename-binary-files.outputs.name }}.zip src/firmware/* rc/firmware/s3/* User_Manual.md + run: zip --junk-paths ${{ steps.rename-binary-files.outputs.name }}.zip src/firmware/* User_Manual.md - name: Upload Release id: upload-release diff --git a/src/CHANGES.md b/src/CHANGES.md index 6aa9683d..52f185f3 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,35 +1,998 @@ -Changelog v0.8.34 +# Development Changes -* improve communication, all inverters are polled during interval -* add hardware info, click on inverter name (in `/live`) -* added RSSI info for HMS and HMT inverters (MqTT + REST API) -* add signal strength for NRF24 -* change ePaper text to symbols -* 2.42" display (SSD1309) integration -* moved active power control to modal in `/live` view (per inverter) by click on current APC state -* moved radio statistics into the inverter - each inverter has now seperate statistics which can be accessed by click on the footer in `/live` -* serveral improvements for MI inverters -* add total AC Max Power to WebUI -* added inverter-wise power-level, frequency and night-communication -* added privacy mode option (`/serial`) +## 0.8.35 - 2023-12-30 +* added dim option for LEDS +* changed reload time for opendtufusion after update to 5s + +# RELEASE 0.8.34 - 2023-12-29 + +## 0.8.33 - 2023-12-29 +* improved communication thx @rejoe2 + +## 0.8.32 - 2023-12-29 +* fix `start` / `stop` / `restart` commands #1287 +* added message, if profile was not read until now #1300 +* added developer option to use 'syslog-server' instead of 'web-serail' #1299 + +## 0.8.31 - 2023-12-29 +* added class to handle timeouts PR #1298 + +## 0.8.30 - 2023-12-28 +* added info if grid profile was not found +* merge PR #1293 +* merge PR #1295 fix ESP8266 pin settings +* merge PR #1297 fix layout for OLED displays + +## 0.8.29 - 2023-12-27 +* fix MqTT generic topic `comm_disabled` #1265 #1286 +* potential fix of #1285 (reset yield day) +* fix fraction of yield correction #1280 +* fix crash if `getLossRate` was read from inverter #1288 #1290 +* reduce reload time for opendtufusion ethernet variant to 5 seconds +* added basic grid parser +* added ESP32-C3 mini environment #1289 + +## 0.8.28 - 2023-12-23 +* fix bug heuristic +* add version information to clipboard once 'copy' was clicked +* add get loss rate @rejoe2 +* improve communication @rejoe2 + +## 0.8.27 - 2023-12-18 +* fix set power limit #1276 + +## 0.8.26 - 2023-12-17 +* read grid profile as HEX (`live` -> click inverter name -> `show grid profile`) + +## 0.8.25 - 2023-12-17 +* RX channel ID starts with fixed value #1277 +* fix static IP for Ethernet + +## 0.8.24 - 2023-12-16 +* fix NRF communication for opendtufusion ethernet variant + +## 0.8.23 - 2023-12-14 +* heuristics fix #1269 #1270 +* moved `sendInterval` in settings, **important:** *will be reseted to 15s after update to this version* +* try to prevent access to radio classes if they are not activated +* fixed millis in serial log +* changed 'print whole trace' = `false` as default +* added communication loop duration in [ms] to serial console +* don't print Hex-Payload if 'print whole trace' == `false` + +## 0.8.22 - 2023-12-13 +* fix communication state-machine regarding zero export #1267 + +## 0.8.21 - 2023-12-12 +* fix ethernet save inverter parameters #886 +* fix ethernet OTA update #886 +* improved radio statistics, fixed heuristic output for HMS and HMT inverters + +## 0.8.20 - 2023-12-12 +* improved HM communication #1259 #1249 +* fix `loadDefaults` for ethernet builds #1263 +* don't loop through radios which aren't in use #1264 + +## 0.8.19 - 2023-12-11 +* added ms to serial log +* added (debug) option to configure gap between inverter requests + +## 0.8.18 - 2023-12-10 +* copied even more from the original heuristic code #1259 +* added mDNS support #1262 + +## 0.8.17 - 2023-12-10 +* possible fix of NRF with opendtufusion (without ETH) +* small fix in heuristics (if conditions made assignment not comparisson) + +## 0.8.16 - 2023-12-09 +* fix crash if NRF is not enabled +* updated heuristic #1080 #1259 +* fix compile opendtufusion fusion ethernet + +## 0.8.15 - 2023-12-09 +* added support for opendtufusion fusion ethernet shield #886 +* fixed range of HMS / HMT frequencies to 863 to 870 MHz #1238 +* changed `yield effiency` per default to `1.0` #1243 +* small heuristics improvements #1258 +* added class to combine inverter heuristics fields #1258 + +## 0.8.14 - 2023-12-07 +* fixed decimal points for temperature (WebUI) PR #1254 #1251 +* fixed inverter statemachine available state PR #1252 #1253 +* fixed NTP update and sunrise calculation #1240 #886 +* display improvments #1248 #1247 +* fixed overflow in `hmRadio.h` #1244 + +## 0.8.13 - 2023-11-28 +* merge PR #1239 symbolic layout for OLED 128x64 + motion senser functionality +* fix MqTT IP addr for ETH connections PR #1240 +* added ethernet build for fusion board, not tested so far + +## 0.8.12 - 2023-11-20 * added button `copy to clipboard` to `/serial` -* added ms to `/serial` -* fixed range of HMS / HMT frequencies to 863 to 870 MHz -* read grid profile (`live` -> click inverter name -> `show grid profile`) -* moved MqTT info to `/system` -* beautified `/system` -* added current AC-Power to `/index` page and removed version -* added default pins for opendtu-fusion-v1 board -* added default pins for ESP32 with CMT2300A (matching OpenDTU) -* added ethernet build for fusion board -* added ESP32-S2 to github actions -* added ESP32-S3-mini to github actions -* added ESP32-C3-mini to github actions -* add option to reset 'max' values on midnight -* luminance of display can be changed during runtime -* added developer option to use 'syslog-server' instead of 'web-serail' -* added / renamed alarm codes -* changed MqTT alarm topic, removed retained flag + +## 0.8.11 - 2023-11-20 +* improved communication, thx @rejoe2 +* improved heuristics, thx @rejoe2, @Oberfritze +* added option to strip payload of frames to significant area + +## 0.8.10 - 2023-11-19 +* fix Mi and HM inverter communication #1235 +* added privacy mode option #1211 +* changed serial debug option to work without reboot + +## 0.8.9 - 2023-11-19 +* merged PR #1234 +* added new alarm codes +* removed serial interval, was not in use anymore + +## 0.8.8 - 2023-11-16 +* fix ESP8266 save inverter #1232 + +## 0.8.7 - 2023-11-13 +* fix ESP8266 inverter settings #1226 +* send radio statistics via MqTT #1227 +* made night communication inverter depended +* added option to prevent adding values of inverter to total values (MqTT only) #1199 + +## 0.8.6 - 2023-11-12 +* merged PR #1225 +* improved heuristics (prevent update of statitistic during testing) + +## 0.8.5 - 2023-11-12 +* fixed endless loop while switching CMT frequency +* removed obsolete "retries" field from settings #1224 +* fixed crash while defining new invertes #1224 +* fixed default frequency settings * added default input power to `400` while adding new inverters +* fixed color of wifi RSSI icon #1224 + +## 0.8.4 - 2023-11-10 +* changed MqTT alarm topic, removed retained flag #1212 +* reduce last_success MQTT messages (#1124) +* introduced tabs in WebGUI (inverter settings) +* added inverter-wise power level and frequency + +## 0.8.3 - 2023-11-09 +* fix yield day reset during day #848 +* add total AC Max Power to WebUI +* fix opendtufusion build (GxEPD patch) +* fix null ptr PR #1222 + +## 0.8.2 - 2023-11-08 +* beautified inverter settings in `setup` (preperation for future, settings become more inverter dependent) + +## 0.8.1 - 2023-11-05 +* added tx channel heuristics (per inverter) +* fix statistics counter + +## 0.8.0 - 2023-10-?? +* switched to new communication scheme + +## 0.7.66 - 2023-10-04 +* prepared PA-Level for CMT +* removed settings for number of retransmits, its fixed to `5` now +* added parentheses to have a excactly defined behaviour + +## 0.7.65 - 2023-10-02 +* MI control command review #1197 + +## 0.7.64 - 2023-10-02 +* moved active power control to modal in `live` view (per inverter) by click on current APC state + +## 0.7.63 - 2023-10-01 +* fix NRF24 communication #1200 + +## 0.7.62 - 2023-10-01 +* fix communication to inverters #1198 +* add timeout before payload is tried to process (necessary for HMS/HMT) + +## 0.7.61 - 2023-10-01 +* merged `hmPayload` and `hmsPayload` into single class +* merged generic radio functions into new parent class `radio.h` +* moved radio statistics into the inverter - each inverter has now seperate statistics which can be accessed by click on the footer in `/live` +* fix compiler warnings #1191 +* fix ePaper logo during night time #1151 + +## 0.7.60 - 2023-09-27 +* fixed typos in changelog #1172 +* fixed MqTT manual clientId storage #1174 +* fixed inverter name length in setup #1181 +* added inverter name to the header of alarm list #1181 +* improved code to avoid warning during compilation #1182 +* fix scheduler #1188, #1179 + +## 0.7.59 - 2023-09-20 +* re-add another HM-400 hardware serial number accidentally removed with `0.7.45` (#1169) +* merge PR #1170 +* reduce last_success MQTT messages (#1124) +* add re-request if inverter is known to be online and first try fails +* add alarm reporting to MI (might need review!) +* rebuild MI limiting code closer to DTUSimMI example +* round APC in `W` to an integer #1171 + +## 0.7.58 +* fix ESP8266 save settings issue #1166 + +## 0.7.57 - 2023-09-18 +* fix Alarms are always in queue (since 0.7.56) +* fix display active power control to long for small devices #1165 + +## 0.7.56 - 2023-09-17 +* only request alarms which were not received before #1113 +* added flag if alarm was requested but not received and re-request it #1105 +* merge PR #1163 + +## 0.7.55 - 2023-09-17 +* fix prometheus builds +* fix ESP32 default pinout #1159 +* added `opendtufusion-dev` because of annoying `-DARDUINO_USB_CDC_ON_BOOT=1` flag +* fix display of current power on `index` +* fix OTA, was damaged by version `0.7.51`, need to use webinstaller (from `0.7.51` to `0.7.54`) + +## 0.7.54 - 2023-09-16 +* added active power control in `W` to live view #201, #673 +* updated docu, active power control related #706 +* added current AC-Power to `index` page and removed version #763 +* improved statistic data, moved to entire struct +* removed `/api/statistics` endpoint from REST-API + +## 0.7.53 - 2023-09-16 +* fix ePaper / display night behaviour #1151 +* fix ESP8266 compile error + +## 0.7.52 - 2023-09-16 +* fix CMT configurable pins #1150, #1159 +* update MqTT lib to version `1.4.5` + +## 0.7.51 - 2023-09-16 +* fix CMT configurable pins #1150 +* fix default CMT pins for opendtufusion +* beautified `system` +* changed main loops, fix resets #1125, #1135 + +## 0.7.50 - 2023-09-12 +* moved MqTT info to `system` +* added CMT info for ESP32 devices +* improved CMT settings, now `SCLK` and `SDIO` are configurable #1046, #1150 +* changed `Power-Limit` in live-view to `Active Power Control` +* increase length of update file selector #1132 + +## 0.7.49 - 2023-09-11 +* merge PR: symbolic icons for mono displays, PR #1136 +* merge MI code restructuring PR #1145 +* merge Prometheus PR #1148 +* add option to strip webUI for ESP8266 (reduce code size, add ESP32 special features; `IF_ESP32` directives) +* started to get CMT info into `system` - not finished + +## 0.7.48 - 2023-09-10 +* fix SSD1309 2.42" display pinout +* improved setup page: save and delete of inverters + +## 0.7.47 - 2023-09-07 +* fix boot loop #1140 +* fix regex in `setup` page +* fix MI serial number display `max-module-power` in `setup` #1142 +* renamed `opendtufusionv1` to `opendtufusion` + +## 0.7.46 - 2023-09-04 +* removed `delay` from ePaper +* started improvements of `/system` +* fix LEDs to check all configured inverters +* send loop skip disabled inverters fix +* print generated DTU SN to console +* HW Versions for MI series PR #1133 +* 2.42" display (SSD1309) integration PR #1139 +* update user manual PR #1121 +* add / rename alarm codes PR #1118 +* revert default pin ESP32 for NRF23-CE #1132 +* luminance of display can be changed during runtime #1106 + +## 0.7.45 - 2023-08-29 +* change ePaper text to symbols PR #1131 +* added some invertes to dev info list #1111 + +## 0.7.44 - 2023-08-28 +* fix `last_success` transmitted to often #1124 + +## 0.7.43 - 2023-08-28 +* improved RSSI for NRF24, now it's read per package (and inverter) #1129 +* arranged `heap` related info together in `/system` +* fix display navi during save +* clean up binary output, separated to folders + +## 0.7.42 - 2023-08-27 +* fix ePaper for opendtufusion_v2.x boards (Software SPI) +* add signal strength for NRF24 - PR #1119 +* refactor wifi class to support ESP32 S2 PR #1127 +* update platform for ESP32 to 6.3.2 +* fix opendtufusion LED (were mixed) +* fix `last_success` transmitted to often #1124 +* added ESP32-S3-mini to github actions +* added old Changelog Entries, to have full log of changes + +## 0.7.41 - 2023-08-26 +* merge PR #1117 code spelling fixes #1112 +* alarms were not read after the first day + +## 0.7.40 - 2023-08-21 +* added default pins for opendtu-fusion-v1 board +* fixed hw version display in `live` +* removed development builds, renamed environments in `platform.ini` + +## 0.7.39 - 2023-08-21 +* fix background color of invalid inputs +* add hardware info (click in `live` on inverter name) + +## 0.7.38 - 2023-08-21 +* reset alarms at midnight (if inverter is not available) #1105, #1096 +* add option to reset 'max' values on midnight #1102 +* added default pins for CMT2300A (matching OpenDTU) + +## 0.7.37 - 2023-08-18 +* fix alarm time on WebGui #1099 +* added RSSI info for HMS and HMT inverters (MqTT + REST API) + +# RELEASE 0.7.36 - 2023-08-18 + +## 0.7.35 - 2023-08-17 +* fixed timestamp for alarms send over MqTT +* auto-patch of `AsyncWebServer` #834, #1036 +* Update documentation in Git regarding `ESP8266` default NRF24 pin assignments + +## 0.7.34 - 2023-08-16 +* fixed timezone offset of alarms +* added `AC` and `DC` to `/live` #1098 +* changed `ESP8266` default NRF24 pin assignments (`D3` = `CE` and `D4` = `IRQ`) +* fixed background of modal window for bright color +* fix MI crashes +* fix some lost debug messages +* merged PR #1095, MI fixes for 0.7.x versions +* fix scheduled reboot #1097 +* added vector graphic logo `/doc/logo.svg` +* merge PR #1093, improved Nokia5110 display layout + +## 0.7.33 - 2023-08-15 +* add alarms overview to WebGui #608 +* fix webGui total values #1084 + +## 0.7.32 - 2023-08-14 +* fix colors of live view #1091 + +## 0.7.31 - 2023-08-13 +* fixed docu #1085 +* changed active power limit MqTT messages to QOS2 #1072 +* improved alarm messages, added alarm-id to log #1089 +* trigger power limit read on next day (if inverter was offline meanwhile) +* disabled improv implementation to check if it is related to 'Schwuppdizitaet' +* changed live view to gray once inverter isn't available +* added inverter status to API +* changed sum of totals on WebGui depending on inverter status #1084 +* merge maximum power (AC and DC) from PR #1080 + +## 0.7.30 - 2023-08-10 +* attempt to improve speed / response times (Schwuppdizitaet) #1075 + +## 0.7.29 - 2023-08-09 +* MqTT alarm data was never sent, fixed +* REST API: added alarm data +* REST API: made get record obsolete +* REST API: added power limit acknowledge `/api/inverter/id/[0-x]` #1072 + +## 0.7.28 - 2023-08-08 +* fix MI inverter support #1078 + +## 0.7.27 - 2023-08-08 +* added compile option for ethernet #886 +* fix ePaper configuration, missing `Busy`-Pin #1075 + +# RELEASE 0.7.26 - 2023-08-06 + +* fix MqTT `last_success` + +# RELEASE 0.7.25 - 2023-08-06 + +## 0.7.24 - 2023-08-05 +* merge PR #1069 make MqTT client ID configurable +* fix #1016, general MqTT status depending on inverter state machine +* changed icon for fully available inverter to a filled check mark #1070 +* fixed `last_success` update with MqTT #1068 +* removed `improv` esp-web-installer script, because it is not fully functional at this time + +## 0.7.23 - 2023-08-04 +* merge PR #1056, visualization html +* update MqTT library to 1.4.4 +* update RF24 library to 1.4.7 +* update ArduinoJson library to 6.21.3 +* set minimum invervall for `/live` to 5 seconds + +## 0.7.22 - 2023-08-04 +* attempt to fix homeassistant auto discovery #1066 + +## 0.7.21 - 2023-07-30 +* fix MqTT YieldDay Total goes to 0 several times #1016 + +## 0.7.20 - 2023-07-28 +* merge PR #1048 version and hash in API, fixes #1045 +* fix: no yield day update if yield day reads `0` after inverter reboot (mostly on evening) #848 +* try to fix Wifi override #1047 +* added information after NTP sync to WebUI #1040 + +## 0.7.19 - 2023-07-27 +* next attempt to fix yield day for multiple inverters #1016 +* reduced threshold for inverter state machine from 60min to 15min to go from state `WAS_ON` to `OFF` + +## 0.7.18 - 2023-07-26 +* next attempt to fix yield day for multiple inverters #1016 + +## 0.7.17 - 2023-07-25 +* next attempt to fix yield day for multiple inverters #1016 +* added two more states for the inverter status (also docu) + +## 0.7.16 - 2023-07-24 +* next attempt to fix yield day for multiple inverters #1016 +* fix export settings date #1040 +* fix time on WebUI (timezone was not observed) #913 #1016 + +## 0.7.15 - 2023-07-23 +* add NTP sync interval #1019 +* adjusted range of contrast / luminance setting #1041 +* use only ISO time format in Web-UI #913 + +## 0.7.14 - 2023-07-23 +* fix Contrast for Nokia Display #1041 +* attempt to fix #1016 by improving inverter status +* added option to adjust efficiency for yield (day/total) #1028 + +## 0.7.13 - 2023-07-19 +* merged display PR #1027 +* add date, time and version to export json #1024 + +## 0.7.12 - 2023-07-09 +* added inverter status - state-machine #1016 + +## 0.7.11 - 2023-07-09 +* fix MqTT endless loop #1013 + +## 0.7.10 - 2023-07-08 +* fix MqTT endless loop #1013 + +## 0.7.9 - 2023-07-08 +* added 'improve' functions to set wifi password directly with ESP web tools #1014 +* fixed MqTT publish while applying power limit #1013 +* slightly improved HMT live view (Voltage & Current) + +## 0.7.8 - 2023-07-05 +* fix `YieldDay`, `YieldTotal` and `P_AC` in `TotalValues` #929 +* fix some serial debug prints +* merge PR #1005 which fixes issue #889 +* merge homeassistant PR #963 +* merge PR #890 which gives option for scheduled reboot at midnight (default off) + +## 0.7.7 - 2023-07-03 +* attempt to fix MqTT `YieldDay` in `TotalValues` #927 +* attempt to fix MqTT `YieldDay` and `YieldTotal` even if inverters are not completely available #929 +* fix wrong message 'NRF not connected' if it is disabled #1007 + +## 0.7.6 - 2023-06-17 +* fix display of hidden SSID checkbox +* changed yield correction data type to `double`, now decimal places are supported +* corrected name of 0.91" display in settings +* attempt to fix MqTT zero values only if setting is there #980, #957 +* made AP password configurable #951 +* added option to start without time-sync, eg. for AP-only-mode #951 + +## 0.7.5 - 2023-06-16 +* fix yield day reset on midnight #957 +* improved tickers in `app.cpp` + +## 0.7.4 - 2023-06-15 +* fix MqTT `P_AC` send if inverters are available #987 +* fix assignments for HMS 1CH and 2CH devices +* fixed uptime overflow #990 + +## 0.7.3 - 2023-06-09 +* fix hidden SSID scan #983 +* improved NRF24 missing message on home screen #981 +* fix MqTT publishing only updated values #982 + +## 0.7.2 - 2023-06-08 +* fix HMS-800 and HMS-1000 assignments #981 +* make nrf enabled all the time for ESP8266 +* fix menu item `active` highlight for 'API' and 'Doku' +* fix MqTT totals issue #927, #980 +* reduce maximum number of inverters to 4 for ESP8266, increase to 16 for ESP32 + +## 0.7.1 - 2023-06-05 +* enabled power limit control for HMS / HMT devices +* changed NRF24 lib version back to 1.4.5 because of compile problems for EPS8266 + +## 0.7.0 - 2023-06-04 +* HMS / HMT support for ESP32 devices + +## 0.6.15 - 2023-05-25 +* improved Prometheus Endpoint PR #958 +* fix turn off ePaper only if setting was set #956 +* improved reset values and update MqTT #957 + +## 0.6.14 - 2023-05-21 +* merge PR #902 Mono-Display + +## 0.6.13 - 2023-05-16 +* merge PR #934 (fix JSON API) and #944 (update manual) + +## 0.6.12 - 2023-04-28 +* improved MqTT +* fix menu active item + +## 0.6.11 - 2023-04-27 +* added MqTT class for publishing all values in Arduino `loop` + +## 0.6.10 - HMS +* Version available in `HMS` branch + +# RELEASE 0.6.9 - 2023-04-19 + +## 0.6.8 - 2023-04-19 +* fix #892 `zeroYieldDay` loop was not applied to all channels + +## 0.6.7 - 2023-04-13 +* merge PR #883, improved store of settings and javascript, thx @tastendruecker123 +* support `.` and `,` as floating point separator in setup #881 + +## 0.6.6 - 2023-04-12 +* increased distance for `import` button in mobile view #879 +* changed `led_high_active` to `bool` #879 + +## 0.6.5 - 2023-04-11 +* fix #845 MqTT subscription for `ctrl/power/[IV-ID]` was missing +* merge PR #876, check JSON settings during read for existence +* **NOTE:** incompatible change: renamed `led_high_active` to `act_high`, maybe setting must be changed after update +* merge PR #861 do not send channel metric if channel is disabled + +## 0.6.4 - 2023-04-06 +* merge PR #846, improved NRF24 communication and MI, thx @beegee3 & @rejoe2 +* merge PR #859, fix burger menu height, thx @ThomasPohl + +## 0.6.3 - 2023-04-04 +* fix login, password length was not checked #852 +* merge PR #854 optimize browser caching, thx @tastendruecker123 #828 +* fix WiFi reconnect not working #851 +* updated issue templates #822 + +## 0.6.2 - 2023-04-04 +* fix login from multiple clients #819 +* fix login screen on small displays + +## 0.6.1 - 2023-04-01 +* merge LED fix - LED1 shows MqTT state, LED configurable active high/low #839 +* only publish new inverter data #826 +* potential fix of WiFi hostname during boot up #752 + +# RELEASE 0.6.0 - 2023-03-27 + +## 0.5.110 +* MQTT fix reconnection by new lib version #780 +* add `about` page +* improved documentation regarding SPI pins #814 +* improved documentation (getting started) #815 #816 +* improved MI 4-ch inverter #820 + +## 0.5.109 +* reduced heap fragmentation by optimizing MqTT #768 +* ePaper: centered text thx @knickohr + +## 0.5.108 +* merge: PR SPI pins configurable (ESP32) #807, #806 (requires manual set of MISO=19, MOSI=23, SCLK=18 in GUI for existing installs) +* merge: PR MI serial outputs #809 +* fix: no MQTT `total` sensor for autodiscover if only one inverter was found #805 +* fix: MQTT `total` renamed to `device_name` + `_TOTOL` for better visibility #805 + +## 0.5.107 +* fix: show save message +* fix: removed serial newline for `enqueueCmd` +* Merged improved Prometheus #808 + +## 0.5.106 +* merged MI and debug message changes #804 +* fixed MQTT autodiscover #794, #632 + +## 0.5.105 +* merged MI, thx @rejoe2 #788 +* fixed reboot message #793 + +## 0.5.104 +* further improved save settings +* removed `#` character from ePaper +* fixed saving pinout for `Nokia-Display` +* removed `Reset` Pin for monochrome displays +* improved wifi connection #652 + +## 0.5.103 +* merged MI improvements, thx @rejoe2 #778 +* changed display inverter online message +* merged heap improvements #772 + +## 0.5.102 +* Warning: old exports are not compatible any more! +* fix JSON import #775 +* fix save settings, at least already stored settings are not lost #771 +* further save settings improvements (only store inverters which are existing) +* improved display of settings save return value +* made save settings asynchronous (more heap memory is free) + +## 0.5.101 +* fix SSD1306 +* update documentation +* Update miPayload.h +* Update README.md +* MI - remarks to user manual +* MI - fix AC calc +* MI - fix status msg. analysis + +## 0.5.100 +* fix add inverter `setup.html` #766 +* fix MQTT retained flag for total values #726 +* renamed buttons for import and export `setup.html` +* added serial message `settings saved` + +## 0.5.99 +* fix limit in [User_Manual.md](../User_Manual.md) +* changed `contrast` to `luminance` in `setup.html` +* try to fix SSD1306 display #759 +* only show necessary display pins depending on setting + +## 0.5.98 +* fix SH1106 rotation and turn off during night #756 +* removed MQTT subscription `sync_ntp`, `set_time` with a value of `0` does the same #696 +* simplified MQTT subscription for `limit`. Check [User_Manual.md](../User_Manual.md) for new syntax #696, #713 +* repaired inverter wise limit control +* fix upload settings #686 + +## 0.5.97 +* Attention: re-ordered display types, check your settings! #746 +* improved saving settings of display #747, #746 +* disabled contrast for Nokia display #746 +* added Prometheus as compile option #719, #615 +* update MQTT lib to v1.4.1 +* limit decimal places to 2 in `live` +* added `-DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48` to esp8266 debug build #657 +* a `max-module-power` of `0` disables channel in live view `setup` +* merge MI improvements, get firmware information #753 + +## 0.5.96 +* added Nokia display again for ESP8266 #764 +* changed `var` / `VAr` to SI unit `var` #732 +* fix MQTT retained flags for totals (P_AC, P_DC) #726, #721 + +## 0.5.95 +* merged #742 MI Improvements +* merged #736 remove obsolete JSON Endpoint + +## 0.5.94 +* added ePaper (for ESP32 only!), thx @dAjaY85 #735 +* improved `/live` margins #732 +* renamed `var` to `VAr` #732 + +## 0.5.93 +* improved web API for `live` +* added dark mode option +* converted all forms to reponsive design +* repaired menu with password protection #720, #716, #709 +* merged MI series fixes #729 + +## 0.5.92 +* fix mobile menu +* fix inverters in select `serial.html` #709 + +## 0.5.91 +* improved html and navi, navi is visible even when API dies #660 +* reduced maximum allowed JSON size for API to 6000Bytes #660 +* small fix: output command at `prepareDevInformCmd` #692 +* improved inverter handling #671 + +## 0.5.90 +* merged PR #684, #698, #705 +* webserial minor overflow fix #660 +* web `index.html` improve version information #701 +* fix MQTT sets power limit to zero (0) #692 +* changed `reset at midnight` with timezone #697 + +## 0.5.89 +* reduced heap fragmentation (removed `strtok` completely) #644, #645, #682 +* added part of mac address to MQTT client ID to separate multiple ESPs in same network +* added dictionary for MQTT to reduce heap-fragmentation +* removed `last Alarm` from Live view, because it showed always the same alarm - will change in future + +## 0.5.88 +* MQTT Yield Day zero, next try to fix #671, thx @beegee3 +* added Solenso inverter to supported devices +* improved reconnection of MQTT #650 + +## 0.5.87 +* fix yield total correction as module (inverter input) value #570 +* reneabled instant start communication (once NTP is synced) #674 + +## 0.5.86 +* prevent send devcontrol request during disabled night communication +* changed yield total correction as module (inverter input) value #570 +* MQTT Yield Day zero, next try to fix #671 + +## 0.5.85 +* fix power-limit was not checked for max retransmits #667 +* fix blue LED lights up all the time #672 +* fix installing schedulers if NTP server isn't available +* improved zero values on triggers #671 +* hardcoded MQTT subtopics, because wildcard `#` leads to errors +* rephrased some messages on webif, thx to @Argafal #638 +* fixed 'polling stop message' on `index.html` #639 + +## 0.5.84 +* fix blue LED lights up all the time #672 +* added an instant start communication (once NTP is synced) +* add MI 3rd generation inverters (10x2 serial numbers) +* first decodings of messages from MI 2nd generation inverters + +## 0.5.83 +* fix MQTT publishing, `callback` was set but reset by following `setup()` + +## 0.5.82 +* fixed communication error #652 +* reset values is no bound to MQTT any more, setting moved to `inverter` #649 +* fixed wording on `index.hmtl` #661 + +## 0.5.81 +* started implementation of MI inverters (setup.html, own processing `MiPayload.h`) + +## 0.5.80 +* fixed communication #656 + +## 0.5.79 +* fixed mixed reset flags #648 +* fixed `mCbAlarm` if MQTT is not used #653 +* fixed MQTT `autodiscover` #630 thanks to @antibill51 +* next changes from @beegee many thanks for your contribution! +* replaced `CircularBuffer` by `std::queue` +* reworked `hmRadio.h` completely (interrupts, packaging) +* fix exception while `reboot` +* cleanup MQTT coding + +## 0.5.78 +* further improvements regarding wifi #611, fix connection if only one AP with same SSID is there +* fix endless loop in `zerovalues` #564 +* fix auto discover again #565 +* added total values to autodiscover #630 +* improved zero at midnight #625 + +## 0.5.77 +* fix wrong filename for automatically created manifest (online installer) #620 +* added rotate display feature #619 +* improved Prometheus endpoint #615, thx to @fsck-block +* improved wifi to connect always to strongest RSSI, thx to @beegee3 #611 + +## 0.5.76 +* reduce MQTT retry interval from maximum speed to one second +* fixed homeassistant autodiscovery #565 +* implemented `getNTPTime` improvements #609 partially #611 +* added alarm messages to MQTT #177, #600, #608 + +## 0.5.75 +* fix wakeup issue, once wifi was lost during night the communication didn't start in the morning +* re-enabled FlashStringHelper because of lacking RAM +* complete rewrite of monochrome display class, thx to @dAjaY85 -> displays are now configurable in setup +* fix power limit not possible #607 + +## 0.5.74 +* improved payload handling (retransmit all fragments on CRC error) +* improved `isAvailable`, checks all record structs, inverter becomes available more early because version is check first +* fix tickers were not set if NTP is not available +* disabled annoying `FlashStringHelper` it gives randomly Exceptions during development, feels more stable since then +* moved erase button to the bottom in settings, not nice but more functional +* split `tx_count` to `tx_cnt` and `retransmits` in `system.html` +* fix mqtt retransmit IP address #602 +* added debug infos for `scheduler` (web -> `/debug` as trigger prints list of tickers to serial console) + +## 0.5.73 +* improved payload handling (request / retransmit) #464 +* included alarm ID parse to serial console (in development) + +## 0.5.72 +* repaired system, scheduler was not called any more #596 + +## 0.5.71 +* improved wifi handling and tickers, many thanks to @beegee3 #571 +* fixed YieldTotal correction calculation #589 +* fixed serial output of power limit acknowledge #569 +* reviewed `sendDiscoveryConfig` #565 +* merged PR `Monodisplay`, many thanks to @dAjaY85 #566, Note: (settings are introduced but not able to be modified, will be included in next version) + +## 0.5.70 +* corrected MQTT `comm_disabled` #529 +* fix Prometheus and JSON endpoints (`config_override.h`) #561 +* publish MQTT with fixed interval even if inverter is not available #542 +* added JSON settings upload. NOTE: settings JSON download changed, so only settings should be uploaded starting from version `0.5.70` #551 +* MQTT topic and inverter name have more allowed characters: `[A-Za-z0-9./#$%&=+_-]+`, thx: @Mo Demman +* improved potential issue with `checkTicker`, thx @cbscpe +* MQTT option for reset values on midnight / not avail / communication stop #539 +* small fix in `tickIVCommunication` #534 +* add `YieldTotal` correction, eg. to have the option to zero at year start #512 + +## 0.5.69 +* merged SH1106 1.3" Display, thx @dAjaY85 +* added SH1106 to automatic build +* added IP address to MQTT (version, device and IP are retained and only transmitted once after boot) #556 +* added `set_power_limit` acknowledge MQTT publish #553 +* changed: version, device name are only published via MQTT once after boot +* added `Login` to menu if admin password is set #554 +* added `development` to second changelog link in `index.html` #543 +* added interval for MQTT (as option). With this settings MQTT live data is published in a fixed timing (only if inverter is available) #542, #523 +* added MQTT `comm_disabled` #529 +* changed name of binaries, moved GIT-Sha to the front #538 + +## 0.5.68 +* repaired receive payload +* Powerlimit is transferred immediately to inverter + +## 0.5.67 +* changed calculation of start / stop communication to 1 min after last comm. stop #515 +* moved payload send to `payload.h`, function `ivSend` #515 +* payload: if last frame is missing, request all frames again + +# RELEASE 0.5.66 - 2022-12-30 + +## 0.5.65 +* wifi, code optimization #509 + +## 0.5.64 +* channel name can use any character, not limited any more +* added `/` to MQTT topic and Inverter name +* trigger for `calcSunrise` is now using local time #515 +* fix reconnect timeout for WiFi #509 +* start AP only after boot, not on WiFi connection loss +* improved /system `free_heap` value (measured before JSON-tree is built) + +## 0.5.63 +* fix Update button protection (prevent double click #527) +* optimized scheduler #515 (thx @beegee3) +* potential fix of #526 duplicates in API `/api/record/live` +* added update information to `index.html` + +## 0.5.62 +* fix MQTT `status` update +* removed MQTT `available_text` (can be deducted from `available`) +* enhanced MQTT documentation in `User_Manual.md` +* removed `tickSunset` and `tickSunrise` from MQTT. It's not needed any more because of minute wise check of status (`processIvStatus`) +* changed MQTT topic `status` to nummeric value, check documentation in `User_Manual.md` +* fix regular expression of `setup.html` for inverter name and channel name + +## 0.5.61 +* fix #521 no reconnect at beginning of day +* added immediate (each minute) report of inverter status MQTT #522 +* added protection mask to select which pages should be protected +* update of monochrome display, show values also if nothing changed + +## 0.5.60 +* added regex to inverter name and MQTT topic (setup.html) +* beautified serial.html +* added ticker for wifi loop #515 + +## 0.5.59 +* fix night communication enable +* improved different WiFi connection scenarios (STA WiFi not found, reconnect #509, redirect for AP to configuration) +* increased MQTT user, pwd and topic length to 64 characters + `\0`. (The string end `\0` reduces the available size by one) #516 + +## 0.5.58 +* improved stability +* improved WiFi initial connection - especially if station WiFi is not available +* removed new operators from web.h (reduce dynamic allocation) +* improved sun calculation #515, #505 +* fixed WiFi auto reconnect #509 +* added disable night communication flag to MQTT #505 +* changed MQTT publish of `available` and `available_text` to sunset #468 + +## 0.5.57 +* improved stability +* added icons to index.html, added WiFi-strength symbol on each page +* moved packet stats and sun to system.html +* refactored communication offset (adjustable in minutes now) + +## 0.5.56 +* factory reset formats entire little fs +* renamed sunrise / sunset on index.html to start / stop communication +* show system information only if called directly from menu +* beautified system.html + +## 0.5.55 +* fixed static IP save + +## 0.5.54 +* changed sunrise / sunset calculation, angle is now `-3.5` instead of original `-0.83` +* improved scheduler (removed -1 from `reload`) #483 +* improved reboot flag in `app.h` +* fixed #493 no MQTT payload once display is defined + +## 0.5.53 +* Mono-Display: show values in offline mode #498 +* improved WiFi class #483 +* added communication enable / disable (to test multiple DTUs with the same inverter) +* fix factory reset #495 + +## 0.5.52 +* improved ahoyWifi class +* added interface class for app +* refactored web and webApi -> RestApi +* fix calcSunrise was not called every day +* added MQTT RX counter to index.html +* all values are displayed on /live even if they are 0 +* added MQTT /status to show status over all inverters + +## 0.5.51 +* improved scheduler, @beegee3 #483 +* refactored get NTP time, @beegee3 #483 +* generate `bin.gz` only for 1M device ESP8285 +* fix calcSunrise was not called every day +* increased number of allowed characters for MQTT user, broker and password, @DanielR92 +* added NRF24 info to Systeminfo, @DanielR92 +* added timezone for monochrome displays, @gh-fx2 +* added support for second inverter for monochrome displays, @gh-fx2 + +## 0.5.50 +* fixed scheduler, uptime and timestamp counted too fast +* added / renamed automatically build outputs +* fixed MQTT ESP uptime on reconnect (not zero any more) +* changed uptime on index.html to count each second, synced with ESP each 10 seconds + +## 0.5.49 +* fixed AP mode on brand new ESP modules +* fixed `last_success` MQTT message +* fixed MQTT inverter available status at sunset +* reordered enqueue commands after boot up to prevent same payload length for successive commands +* added automatic build for Nokia5110 and SSD1306 displays (ESP8266) + +## 0.5.48 +* added MQTT message send at sunset +* added monochrome display support +* added `once` and `onceAt` to scheduler to make code cleaner +* improved sunrise / sunset calculation + +## 0.5.47 +* refactored ahoyWifi class: AP is opened on every boot, once station connection is successful the AP will be closed +* improved NTP sync after boot, faster sync +* fix NRF24 details only on valid SPI connection + +## 0.5.46 +* fix sunrise / sunset calculation +* improved setup.html: `reboot on save` is checked as default + +## 0.5.45 +* changed MQTT last will topic from `status` to `mqtt` +* fix sunrise / sunset calculation +* fix time of serial web console + +## 0.5.44 +* marked some MQTT messages as retained +* moved global functions to global location (no duplicates) +* changed index.html interval to static 10 seconds +* fix static IP +* fix NTP with static IP +* print MQTT info only if MQTT was configured + +## 0.5.43 +* updated REST API and MQTT (both of them use the same functionality) +* added ESP-heap information as MQTT message +* changed output name of automatic development build to fixed name (to have a static link from https://ahoydtu.de) +* updated user manual to latest MQTT and API changes + +## 0.5.42 +* fix web logout (auto logout) +* switched MQTT library + +# RELEASE 0.5.41 - 2022-11-22 + +# RELEASE 0.5.28 - 2022-10-30 + +# RELEASE 0.5.17 - 2022-09-06 + +# RELEASE 0.5.16 - 2022-09-04 -full version log: [Development Log](https://github.com/lumapu/ahoy/blob/development03/src/CHANGES.md) \ No newline at end of file diff --git a/src/app.cpp b/src/app.cpp index 22e2f045..5a5a54a0 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -102,14 +102,14 @@ void app::setup() { //----------------------------------------------------------------------------- void app::loop(void) { - ah::Scheduler::loop(); - if(mConfig->nrf.enabled) mNrfRadio.loop(); #if defined(ESP32) if(mConfig->cmt.enabled) mCmtRadio.loop(); #endif + + ah::Scheduler::loop(); mCommunication.loop(); if (mMqttEnabled && mNetworkConnected) @@ -449,22 +449,22 @@ void app::mqttSubRxCb(JsonObject obj) { //----------------------------------------------------------------------------- void app::setupLed(void) { - uint8_t led_off = (mConfig->led.led_high_active) ? LOW : HIGH; + uint8_t led_off = (mConfig->led.high_active) ? 0 : 255; if (mConfig->led.led0 != DEF_PIN_OFF) { pinMode(mConfig->led.led0, OUTPUT); - digitalWrite(mConfig->led.led0, led_off); + analogWrite(mConfig->led.led0, led_off); } if (mConfig->led.led1 != DEF_PIN_OFF) { pinMode(mConfig->led.led1, OUTPUT); - digitalWrite(mConfig->led.led1, led_off); + analogWrite(mConfig->led.led1, led_off); } } //----------------------------------------------------------------------------- void app::updateLed(void) { - uint8_t led_off = (mConfig->led.led_high_active) ? LOW : HIGH; - uint8_t led_on = (mConfig->led.led_high_active) ? HIGH : LOW; + uint8_t led_off = (mConfig->led.high_active) ? 0 : 255; + uint8_t led_on = (mConfig->led.high_active) ? (mConfig->led.luminance) : (255-mConfig->led.luminance); if (mConfig->led.led0 != DEF_PIN_OFF) { Inverter<> *iv; @@ -473,20 +473,20 @@ void app::updateLed(void) { if (NULL != iv) { if (iv->isProducing()) { // turn on when at least one inverter is producing - digitalWrite(mConfig->led.led0, led_on); + analogWrite(mConfig->led.led0, led_on); break; } else if(iv->config->enabled) - digitalWrite(mConfig->led.led0, led_off); + analogWrite(mConfig->led.led0, led_off); } } } if (mConfig->led.led1 != DEF_PIN_OFF) { if (getMqttIsConnected()) { - digitalWrite(mConfig->led.led1, led_on); + analogWrite(mConfig->led.led1, led_on); } else { - digitalWrite(mConfig->led.led1, led_off); + analogWrite(mConfig->led.led1, led_off); } } } diff --git a/src/config/settings.h b/src/config/settings.h index 8acb0942..c797cad8 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -30,7 +30,7 @@ * https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#flash-layout * */ -#define CONFIG_VERSION 6 +#define CONFIG_VERSION 7 #define PROT_MASK_INDEX 0x0001 @@ -117,9 +117,10 @@ typedef struct { } cfgSerial_t; typedef struct { - uint8_t led0; // first LED pin - uint8_t led1; // second LED pin - bool led_high_active; // determines if LEDs are high or low active + uint8_t led0; // first LED pin + uint8_t led1; // second LED pin + bool high_active; // determines if LEDs are high or low active + uint8_t luminance; // luminance of LED } cfgLed_t; typedef struct { @@ -450,9 +451,10 @@ class settings { mCfg.inst.iv[i].add2Total = true; } - mCfg.led.led0 = DEF_LED0; - mCfg.led.led1 = DEF_LED1; - mCfg.led.led_high_active = LED_HIGH_ACTIVE; + mCfg.led.led0 = DEF_LED0; + mCfg.led.led1 = DEF_LED1; + mCfg.led.high_active = LED_HIGH_ACTIVE; + mCfg.led.luminance = 255; memset(&mCfg.inst, 0, sizeof(cfgInst_t)); @@ -493,6 +495,9 @@ class settings { mCfg.inst.gapMs = 500; mCfg.inst.readGrid = true; } + if(mCfg.configVersion < 7) { + mCfg.led.luminance = 255; + } } } @@ -667,13 +672,15 @@ class settings { void jsonLed(JsonObject obj, bool set = false) { if(set) { - obj[F("0")] = mCfg.led.led0; - obj[F("1")] = mCfg.led.led1; - obj[F("act_high")] = mCfg.led.led_high_active; + obj[F("0")] = mCfg.led.led0; + obj[F("1")] = mCfg.led.led1; + obj[F("act_high")] = mCfg.led.high_active; + obj[F("lum")] = mCfg.led.luminance; } else { getVal(obj, F("0"), &mCfg.led.led0); getVal(obj, F("1"), &mCfg.led.led1); - getVal(obj, F("act_high"), &mCfg.led.led_high_active); + getVal(obj, F("act_high"), &mCfg.led.high_active); + getVal(obj, F("lum"), &mCfg.led.luminance); } } diff --git a/src/defines.h b/src/defines.h index ff7e9772..2b0909cd 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 34 +#define VERSION_PATCH 35 //------------------------------------- typedef struct { diff --git a/src/web/RestApi.h b/src/web/RestApi.h index f3d70d26..169e1d2d 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -564,7 +564,8 @@ class RestApi { obj[F("miso")] = mConfig->nrf.pinMiso; obj[F("led0")] = mConfig->led.led0; obj[F("led1")] = mConfig->led.led1; - obj[F("led_high_active")] = mConfig->led.led_high_active; + obj[F("led_high_active")] = mConfig->led.high_active; + obj[F("led_lum")] = mConfig->led.luminance; } #if defined(ESP32) diff --git a/src/web/html/setup.html b/src/web/html/setup.html index 8e415c2c..f172f925 100644 --- a/src/web/html/setup.html +++ b/src/web/html/setup.html @@ -918,8 +918,12 @@ ml("div", { class: "row mb-3" }, [ ml("div", { class: "col-12 col-sm-3 my-2" }, "LED polarity"), ml("div", { class: "col-12 col-sm-9" }, - sel('pinLedHighActive', led_high_active, obj['led_high_active']) + sel('pinLedHighActive', led_high_active, obj.led_high_active) ) + ]), + ml("div", { class: "row mb-3" }, [ + ml("div", { class: "col-12 col-sm-3 my-2" }, "LED luminance (0-255)"), + ml("div", { class: "col-12 col-sm-9" }, ml("input", {class: "text", type: "number", name: "pinLedLum", value: obj.led_lum, min: 0, max: 255}, null)) ]) ) } diff --git a/src/web/web.h b/src/web/web.h index 451dc656..b60e6791 100644 --- a/src/web/web.h +++ b/src/web/web.h @@ -39,7 +39,7 @@ #define WEB_SERIAL_BUF_SIZE 2048 -const char* const pinArgNames[] = {"pinCs", "pinCe", "pinIrq", "pinSclk", "pinMosi", "pinMiso", "pinLed0", "pinLed1", "pinLedHighActive", "pinCmtSclk", "pinSdio", "pinCsb", "pinFcsb", "pinGpio3"}; +const char* const pinArgNames[] = {"pinCs", "pinCe", "pinIrq", "pinSclk", "pinMosi", "pinMiso", "pinLed0", "pinLed1", "pinLedHighActive", "pinLedLum", "pinCmtSclk", "pinSdio", "pinCsb", "pinFcsb", "pinGpio3"}; template class Web { @@ -284,12 +284,18 @@ class Web { bool reboot = (!Update.hasError()); - String html = F("UpdateUpdate: "); + String html = F("UpdateUpdate: "); if (reboot) html += "success"; else html += "failed"; - html += F("

rebooting ... auto reload after 20s"); + html += F("

rebooting ..."); AsyncWebServerResponse *response = request->beginResponse(200, F("text/html; charset=UTF-8"), html); response->addHeader("Connection", "close"); @@ -521,7 +527,7 @@ class Web { // pinout uint8_t pin; - for (uint8_t i = 0; i < 14; i++) { + for (uint8_t i = 0; i < 15; i++) { pin = request->arg(String(pinArgNames[i])).toInt(); switch(i) { case 0: mConfig->nrf.pinCs = ((pin != 0xff) ? pin : DEF_NRF_CS_PIN); break; @@ -530,14 +536,15 @@ class Web { case 3: mConfig->nrf.pinSclk = ((pin != 0xff) ? pin : DEF_NRF_SCLK_PIN); break; case 4: mConfig->nrf.pinMosi = ((pin != 0xff) ? pin : DEF_NRF_MOSI_PIN); break; case 5: mConfig->nrf.pinMiso = ((pin != 0xff) ? pin : DEF_NRF_MISO_PIN); break; - case 6: mConfig->led.led0 = pin; break; - case 7: mConfig->led.led1 = pin; break; - case 8: mConfig->led.led_high_active = pin; break; // this is not really a pin but a polarity, but handling it close to here makes sense - case 9: mConfig->cmt.pinSclk = pin; break; - case 10: mConfig->cmt.pinSdio = pin; break; - case 11: mConfig->cmt.pinCsb = pin; break; - case 12: mConfig->cmt.pinFcsb = pin; break; - case 13: mConfig->cmt.pinIrq = pin; break; + case 6: mConfig->led.led0 = pin; break; + case 7: mConfig->led.led1 = pin; break; + case 8: mConfig->led.high_active = pin; break; // this is not really a pin but a polarity, but handling it close to here makes sense + case 9: mConfig->led.luminance = pin; break; // this is not really a pin but a polarity, but handling it close to here makes sense + case 10: mConfig->cmt.pinSclk = pin; break; + case 11: mConfig->cmt.pinSdio = pin; break; + case 12: mConfig->cmt.pinCsb = pin; break; + case 13: mConfig->cmt.pinFcsb = pin; break; + case 14: mConfig->cmt.pinIrq = pin; break; } } From 86ff9f054a166a19f2558f9760019ec97de88dee Mon Sep 17 00:00:00 2001 From: lumapu Date: Sat, 30 Dec 2023 02:33:57 +0100 Subject: [PATCH 10/11] 0.8.35 * changed reload time for opendtufusion after update to 5s * fix default interval and gap for communication * fix serial number in exported json (was decimal, now correct as hexdecimal number) * beautified factory reset * added second stage for erase settings * increased maximal number of inverters to 32 for opendtufusion board (ESP32-S3) * fixed crash if CMT inverter is enabled, but CMT isn't configured --- .github/workflows/compile_release.yml | 2 +- src/CHANGES.md | 6 ++++ src/app.cpp | 3 ++ src/config/config.h | 6 +++- src/config/settings.h | 6 ++-- src/web/RestApi.h | 48 +++++++++++++++++++++++++++ src/web/html/system.html | 3 +- src/web/web.h | 47 ++++++++------------------ 8 files changed, 79 insertions(+), 42 deletions(-) diff --git a/.github/workflows/compile_release.yml b/.github/workflows/compile_release.yml index e65494ab..a7e3511d 100644 --- a/.github/workflows/compile_release.yml +++ b/.github/workflows/compile_release.yml @@ -77,7 +77,7 @@ jobs: VERSION: ${{ steps.rename-binary-files.outputs.name }} - name: Create Artifact - run: zip --junk-paths ${{ steps.rename-binary-files.outputs.name }}.zip src/firmware/* User_Manual.md + run: zip --junk-paths ${{ steps.rename-binary-files.outputs.name }}.zip src/firmware/* User_Manual.md - name: Upload Release id: upload-release diff --git a/src/CHANGES.md b/src/CHANGES.md index 52f185f3..7c243356 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -3,6 +3,12 @@ ## 0.8.35 - 2023-12-30 * added dim option for LEDS * changed reload time for opendtufusion after update to 5s +* fix default interval and gap for communication +* fix serial number in exported json (was decimal, now correct as hexdecimal number) +* beautified factory reset +* added second stage for erase settings +* increased maximal number of inverters to 32 for opendtufusion board (ESP32-S3) +* fixed crash if CMT inverter is enabled, but CMT isn't configured # RELEASE 0.8.34 - 2023-12-29 diff --git a/src/app.cpp b/src/app.cpp index 5a5a54a0..0bba14da 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -354,6 +354,9 @@ void app::tickSend(void) { continue; } + if(!iv->radio->isChipConnected()) + continue; + iv->tickSend([this, iv](uint8_t cmd, bool isDevControl) { if(isDevControl) mCommunication.addImportant(iv, cmd); diff --git a/src/config/config.h b/src/config/config.h index c8fd86dc..2cb9bcd3 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -153,7 +153,11 @@ // number of configurable inverters #if defined(ESP32) - #define MAX_NUM_INVERTERS 16 + #if defined(CONFIG_IDF_TARGET_ESP32S3) + #define MAX_NUM_INVERTERS 32 + #else + #define MAX_NUM_INVERTERS 16 + #endif #else #define MAX_NUM_INVERTERS 4 #endif diff --git a/src/config/settings.h b/src/config/settings.h index c797cad8..fe2ad1b0 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -425,7 +425,7 @@ class settings { mCfg.serial.showIv = false; mCfg.serial.debug = false; mCfg.serial.privacyLog = true; - mCfg.serial.printWholeTrace = true; + mCfg.serial.printWholeTrace = false; mCfg.mqtt.port = DEF_MQTT_PORT; snprintf(mCfg.mqtt.broker, MQTT_ADDR_LEN, "%s", DEF_MQTT_BROKER); @@ -441,7 +441,7 @@ class settings { mCfg.inst.startWithoutTime = false; mCfg.inst.rstMaxValsMidNight = false; mCfg.inst.yieldEffiency = 1.0f; - mCfg.inst.gapMs = 2000; + mCfg.inst.gapMs = 500; mCfg.inst.readGrid = true; for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) { @@ -456,8 +456,6 @@ class settings { mCfg.led.high_active = LED_HIGH_ACTIVE; mCfg.led.luminance = 255; - memset(&mCfg.inst, 0, sizeof(cfgInst_t)); - mCfg.plugin.display.pwrSaveAtIvOffline = false; mCfg.plugin.display.contrast = 60; mCfg.plugin.display.screenSaver = 1; // default: 1 .. pixelshift for OLED for downward compatibility diff --git a/src/web/RestApi.h b/src/web/RestApi.h index 169e1d2d..a74f4f14 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -88,6 +88,10 @@ class RestApi { else if(path == "html/logout") getHtmlLogout(request, root); else if(path == "html/reboot") getHtmlReboot(request, root); else if(path == "html/save") getHtmlSave(request, root); + else if(path == "html/erase") getHtmlErase(request, root); + else if(path == "html/erasetrue") getHtmlEraseTrue(request, root); + else if(path == "html/factory") getHtmlFactory(request, root); + else if(path == "html/factorytrue") getHtmlFactoryTrue(request, root); else if(path == "system") getSysInfo(request, root); else if(path == "generic") getGeneric(request, root); else if(path == "reboot") getReboot(request, root); @@ -214,6 +218,16 @@ class RestApi { tmp.remove(i, tmp.indexOf("\"", i)-i); } } + i = 0; + // convert all serial numbers to hexadecimal + while (i != -1) { + i = tmp.indexOf("\"sn\":", i); + if(-1 != i) { + i+=5; + String sn = tmp.substring(i, tmp.indexOf("\"", i)-1); + tmp.replace(sn, String(atoll(sn.c_str()), HEX)); + } + } response = request->beginResponse(200, F("application/json; charset=utf-8"), tmp); } @@ -337,6 +351,40 @@ class RestApi { #endif } + void getHtmlErase(AsyncWebServerRequest *request, JsonObject obj) { + getGeneric(request, obj.createNestedObject(F("generic"))); + obj[F("html")] = F("Erase settings (not WiFi)? yes no"); + } + + void getHtmlEraseTrue(AsyncWebServerRequest *request, JsonObject obj) { + getGeneric(request, obj.createNestedObject(F("generic"))); + mApp->eraseSettings(false); + mApp->setRebootFlag(); + obj[F("html")] = F("Erase settings: success"); + #if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3) + obj[F("reload")] = 5; + #else + obj[F("reload")] = 20; + #endif + } + + void getHtmlFactory(AsyncWebServerRequest *request, JsonObject obj) { + getGeneric(request, obj.createNestedObject(F("generic"))); + obj[F("html")] = F("Factory reset? yes no"); + } + + void getHtmlFactoryTrue(AsyncWebServerRequest *request, JsonObject obj) { + getGeneric(request, obj.createNestedObject(F("generic"))); + mApp->eraseSettings(true); + mApp->setRebootFlag(); + obj[F("html")] = F("Factory reset: success"); + #if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3) + obj[F("reload")] = 5; + #else + obj[F("reload")] = 20; + #endif + } + void getReboot(AsyncWebServerRequest *request, JsonObject obj) { getGeneric(request, obj.createNestedObject(F("generic"))); obj[F("refresh")] = 10; diff --git a/src/web/html/system.html b/src/web/html/system.html index ef487ad5..eb25d5fa 100644 --- a/src/web/html/system.html +++ b/src/web/html/system.html @@ -126,8 +126,7 @@ meta.httpEquiv = "refresh" meta.content = obj.refresh + "; URL=" + obj.refresh_url; document.getElementsByTagName('head')[0].appendChild(meta); - } - else { + } else if(null != obj.system) { parseRadio(obj.system); parseMqtt(obj.system.mqtt); parseSysInfo(obj.system); diff --git a/src/web/web.h b/src/web/web.h index b60e6791..1e87547b 100644 --- a/src/web/web.h +++ b/src/web/web.h @@ -71,14 +71,15 @@ class Web { mWeb.onNotFound ( std::bind(&Web::showNotFound, this, std::placeholders::_1)); mWeb.on("/reboot", HTTP_ANY, std::bind(&Web::onReboot, this, std::placeholders::_1)); mWeb.on("/system", HTTP_ANY, std::bind(&Web::onSystem, this, std::placeholders::_1)); - mWeb.on("/erase", HTTP_ANY, std::bind(&Web::showErase, this, std::placeholders::_1)); - mWeb.on("/factory", HTTP_ANY, std::bind(&Web::showFactoryRst, this, std::placeholders::_1)); + mWeb.on("/erase", HTTP_ANY, std::bind(&Web::showHtml, this, std::placeholders::_1)); + mWeb.on("/erasetrue", HTTP_ANY, std::bind(&Web::showHtml, this, std::placeholders::_1)); + mWeb.on("/factory", HTTP_ANY, std::bind(&Web::showHtml, this, std::placeholders::_1)); + mWeb.on("/factorytrue", HTTP_ANY, std::bind(&Web::showHtml, this, std::placeholders::_1)); mWeb.on("/setup", HTTP_GET, std::bind(&Web::onSetup, this, std::placeholders::_1)); mWeb.on("/save", HTTP_POST, std::bind(&Web::showSave, this, std::placeholders::_1)); mWeb.on("/live", HTTP_ANY, std::bind(&Web::onLive, this, std::placeholders::_1)); - //mWeb.on("/api1", HTTP_POST, std::bind(&Web::showWebApi, this, std::placeholders::_1)); #ifdef ENABLE_PROMETHEUS_EP mWeb.on("/metrics", HTTP_ANY, std::bind(&Web::showMetrics, this, std::placeholders::_1)); @@ -197,6 +198,11 @@ class Web { #if !defined(ETHERNET) strncpy(mConfig->sys.stationPwd, pwd, PWD_LEN); // restore WiFi PWD #endif + for(uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) { + if((mConfig->inst.iv[i].serial.u64 != 0) && (mConfig->inst.iv[i].serial.u64 < 138999999999)) { // hexadecimal + mConfig->inst.iv[i].serial.u64 = ah::Serial2u64(String(mConfig->inst.iv[i].serial.u64).c_str()); + } + } mApp->saveSettings(true); } if (!mUploadFail) @@ -426,39 +432,12 @@ class Web { request->send(response); } - void showErase(AsyncWebServerRequest *request) { + void showHtml(AsyncWebServerRequest *request) { checkProtection(request); - DPRINTLN(DBG_VERBOSE, F("showErase")); - mApp->eraseSettings(false); - onReboot(request); - } - - void showFactoryRst(AsyncWebServerRequest *request) { - checkProtection(request); - - DPRINTLN(DBG_VERBOSE, F("showFactoryRst")); - String content = ""; - int refresh = 3; - if (request->args() > 0) { - if (request->arg("reset").toInt() == 1) { - refresh = 10; - if (mApp->eraseSettings(true)) - content = F("factory reset: success\n\nrebooting ... "); - else - content = F("factory reset: failed\n\nrebooting ... "); - } else { - content = F("factory reset: aborted"); - refresh = 3; - } - } else { - content = F("

Factory Reset

" - "

RESET

CANCEL

"); - refresh = 120; - } - request->send(200, F("text/html; charset=UTF-8"), F("Factory Reset") + content + F("")); - if (refresh == 10) - onReboot(request); + AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), system_html, system_html_len); + response->addHeader(F("Content-Encoding"), "gzip"); + request->send(response); } void onSetup(AsyncWebServerRequest *request) { From 8ca0cc5d27db70f0b685b0907067fba466a34668 Mon Sep 17 00:00:00 2001 From: DanielR92 Date: Sat, 30 Dec 2023 10:21:00 +0100 Subject: [PATCH 11/11] move to folder --- Getting_Started.md => manual/Getting_Started.md | 0 User_Manual.md => manual/User_Manual.md | 0 ahoy_config.md => manual/ahoy_config.md | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename Getting_Started.md => manual/Getting_Started.md (100%) rename User_Manual.md => manual/User_Manual.md (100%) rename ahoy_config.md => manual/ahoy_config.md (100%) diff --git a/Getting_Started.md b/manual/Getting_Started.md similarity index 100% rename from Getting_Started.md rename to manual/Getting_Started.md diff --git a/User_Manual.md b/manual/User_Manual.md similarity index 100% rename from User_Manual.md rename to manual/User_Manual.md diff --git a/ahoy_config.md b/manual/ahoy_config.md similarity index 100% rename from ahoy_config.md rename to manual/ahoy_config.md