mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-25 23:06:11 +02:00
0.7.20
* 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
This commit is contained in:
parent
a893ae17ef
commit
53ff04b689
6 changed files with 49 additions and 14 deletions
|
@ -1,5 +1,11 @@
|
|||
# Development Changes
|
||||
|
||||
## 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`
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//-------------------------------------
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 7
|
||||
#define VERSION_PATCH 19
|
||||
#define VERSION_PATCH 20
|
||||
|
||||
//-------------------------------------
|
||||
typedef struct {
|
||||
|
|
|
@ -68,6 +68,7 @@ class PubMqttIvData {
|
|||
void stateStart() {
|
||||
mLastIvId = 0;
|
||||
mTotalFound = false;
|
||||
mSendTotalYd = true;
|
||||
mAllTotalFound = true;
|
||||
if(!mSendList->empty()) {
|
||||
mCmd = mSendList->front().cmd;
|
||||
|
@ -136,9 +137,14 @@ class PubMqttIvData {
|
|||
case FLD_YT:
|
||||
mTotal[1] += mIv->getValue(mPos, rec);
|
||||
break;
|
||||
case FLD_YD:
|
||||
mTotal[2] += mIv->getValue(mPos, rec);
|
||||
case FLD_YD: {
|
||||
uint8_t val = mIv->getValue(mPos, rec);
|
||||
if(0 == val) // inverter restarted during day
|
||||
mSendTotalYd = false;
|
||||
else
|
||||
mTotal[2] += val;
|
||||
break;
|
||||
}
|
||||
case FLD_PDC:
|
||||
mTotal[3] += mIv->getValue(mPos, rec);
|
||||
break;
|
||||
|
@ -180,7 +186,7 @@ class PubMqttIvData {
|
|||
fieldId = FLD_YT;
|
||||
break;
|
||||
case 2:
|
||||
if(!mAllTotalFound) {
|
||||
if((!mAllTotalFound) || (!mSendTotalYd)) {
|
||||
mPos++;
|
||||
return;
|
||||
}
|
||||
|
@ -210,7 +216,7 @@ class PubMqttIvData {
|
|||
|
||||
uint8_t mCmd;
|
||||
uint8_t mLastIvId;
|
||||
bool mSendTotals, mTotalFound, mAllTotalFound;
|
||||
bool mSendTotals, mTotalFound, mAllTotalFound, mSendTotalYd;
|
||||
float mTotal[4];
|
||||
|
||||
Inverter<> *mIv, *mIvSend;
|
||||
|
|
|
@ -197,6 +197,7 @@ class RestApi {
|
|||
void getGeneric(AsyncWebServerRequest *request, JsonObject obj) {
|
||||
obj[F("wifi_rssi")] = (WiFi.status() != WL_CONNECTED) ? 0 : WiFi.RSSI();
|
||||
obj[F("ts_uptime")] = mApp->getUptime();
|
||||
obj[F("ts_now")] = mApp->getTimestamp();
|
||||
obj[F("version")] = String(mApp->getVersion());
|
||||
obj[F("build")] = String(AUTO_GIT_HASH);
|
||||
obj[F("menu_prot")] = mApp->getProtection(request);
|
||||
|
|
|
@ -200,13 +200,17 @@
|
|||
<div class="col-12 col-sm-9"><input type="number" name="ntpIntvl"/></div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 col-sm-3 my-2">set system time</div>
|
||||
<div class="col-12 col-sm-3 my-2">set System time</div>
|
||||
<div class="col-12 col-sm-9">
|
||||
<input type="button" name="ntpBtn" id="ntpBtn" class="btn" value="from browser" onclick="setTime()"/>
|
||||
<input type="button" name="ntpSync" id="ntpSync" class="btn" value="sync NTP" onclick="syncTime()"/>
|
||||
<input type="button" name="ntpSync" id="ntpSync" class="btn" value="sync NTP" onclick="syncTime()"/><br/>
|
||||
<span id="apiResultNtp"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 col-sm-3 my-2">System Time</div>
|
||||
<div class="col-12 col-sm-9 my-2"><span id="date"></span></div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
@ -333,6 +337,7 @@
|
|||
<script type="text/javascript">
|
||||
var highestId = 0;
|
||||
var maxInv = 0;
|
||||
var ts = 0;
|
||||
|
||||
var esp8266pins = [
|
||||
[255, "off / default"],
|
||||
|
@ -474,11 +479,17 @@
|
|||
function apiCbNtp(obj) {
|
||||
var e = document.getElementById("apiResultNtp");
|
||||
if(obj["success"])
|
||||
e.innerHTML = "command excuted";
|
||||
e.innerHTML = "command excuted, set new time ...";
|
||||
else
|
||||
e.innerHTML = "Error: " + obj["error"];
|
||||
}
|
||||
|
||||
function apiCbNtp2(obj) {
|
||||
var e = document.getElementById("apiResultNtp");
|
||||
var date = new Date(obj["ts_now"] * 1000);
|
||||
e.innerHTML = "synced at: " + toIsoDateStr(date) + ", difference: " + (ts - obj["ts_now"]) + "ms";
|
||||
}
|
||||
|
||||
function apiCbMqtt(obj) {
|
||||
var e = document.getElementById("apiResultMqtt");
|
||||
if(obj["success"])
|
||||
|
@ -493,6 +504,7 @@
|
|||
obj.cmd = "set_time";
|
||||
obj.val = parseInt(date.getTime() / 1000);
|
||||
getAjax("/api/setup", apiCbNtp, "POST", JSON.stringify(obj));
|
||||
setTimeout(function() {getAjax('/api/index', apiCbNtp2)}, 2000);
|
||||
}
|
||||
|
||||
function scan() {
|
||||
|
@ -506,6 +518,7 @@
|
|||
var obj = new Object();
|
||||
obj.cmd = "sync_ntp";
|
||||
getAjax("/api/setup", apiCbNtp, "POST", JSON.stringify(obj));
|
||||
setTimeout(function() {getAjax('/api/index', apiCbNtp2)}, 2000);
|
||||
}
|
||||
|
||||
function sendDiscoveryConfig() {
|
||||
|
@ -664,6 +677,9 @@
|
|||
parseNav(obj);
|
||||
parseESP(obj);
|
||||
parseRssi(obj);
|
||||
|
||||
ts = obj["ts_now"];
|
||||
window.setInterval("tick()", 1000);
|
||||
}
|
||||
|
||||
function parseStaticIp(obj) {
|
||||
|
@ -869,6 +885,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
function tick() {
|
||||
document.getElementById("date").innerHTML = toIsoDateStr((new Date((++ts) * 1000)));
|
||||
}
|
||||
|
||||
function parse(root) {
|
||||
if(null != root) {
|
||||
parseSys(root["system"]);
|
||||
|
|
|
@ -54,15 +54,17 @@ void ahoywifi::setupWifi(bool startAP = false) {
|
|||
}
|
||||
#endif
|
||||
#if !defined(AP_ONLY)
|
||||
if(mConfig->valid) {
|
||||
#if !defined(FB_WIFI_OVERRIDDEN)
|
||||
if(strncmp(mConfig->sys.stationSsid, FB_WIFI_SSID, 14) != 0)
|
||||
#if defined(FB_WIFI_OVERRIDDEN)
|
||||
snprintf(mConfig->sys.stationSsid, SSID_LEN, "%s", FB_WIFI_SSID);
|
||||
snprintf(mConfig->sys.stationPwd, PWD_LEN, "%s", FB_WIFI_PWD);
|
||||
setupStation();
|
||||
#else
|
||||
if(mConfig->valid) {
|
||||
if(strncmp(mConfig->sys.stationSsid, FB_WIFI_SSID, 14) != 0)
|
||||
setupStation();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue