mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-01 11:16:20 +02:00
0.8.3
* fix yield day reset during day #848 * add total AC Max Power to WebUI * fix opendtufusion build (GxEPD patch)
This commit is contained in:
parent
975f6923d3
commit
56a1f3beaf
6 changed files with 36 additions and 17 deletions
|
@ -14,7 +14,7 @@ index 1588444..592869b 100644
|
||||||
{
|
{
|
||||||
_initial_write = true;
|
_initial_write = true;
|
||||||
_initial_refresh = true;
|
_initial_refresh = true;
|
||||||
@@ -67,27 +67,30 @@ void GxEPD2_EPD::init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset
|
@@ -71,27 +71,30 @@ void GxEPD2_EPD::init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset
|
||||||
{
|
{
|
||||||
pinMode(_busy, INPUT);
|
pinMode(_busy, INPUT);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ index 1588444..592869b 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxEPD2_EPD::setBusyCallback(void (*busyCallback)(const void*), const void* busy_callback_parameter)
|
void GxEPD2_EPD::setBusyCallback(void (*busyCallback)(const void*), const void* busy_callback_parameter)
|
||||||
@@ -96,12 +99,6 @@ void GxEPD2_EPD::setBusyCallback(void (*busyCallback)(const void*), const void*
|
@@ -100,12 +103,6 @@ void GxEPD2_EPD::setBusyCallback(void (*busyCallback)(const void*), const void*
|
||||||
_busy_callback_parameter = busy_callback_parameter;
|
_busy_callback_parameter = busy_callback_parameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ index 1588444..592869b 100644
|
||||||
void GxEPD2_EPD::_reset()
|
void GxEPD2_EPD::_reset()
|
||||||
{
|
{
|
||||||
if (_rst >= 0)
|
if (_rst >= 0)
|
||||||
@@ -168,115 +165,201 @@ void GxEPD2_EPD::_waitWhileBusy(const char* comment, uint16_t busy_time)
|
@@ -174,115 +169,201 @@ void GxEPD2_EPD::_waitWhileBusy(const char* comment, uint16_t busy_time)
|
||||||
|
|
||||||
void GxEPD2_EPD::_writeCommand(uint8_t c)
|
void GxEPD2_EPD::_writeCommand(uint8_t c)
|
||||||
{
|
{
|
||||||
|
@ -334,7 +334,7 @@ index ef2318f..50aa961 100644
|
||||||
protected:
|
protected:
|
||||||
void _reset();
|
void _reset();
|
||||||
void _waitWhileBusy(const char* comment = 0, uint16_t busy_time = 5000);
|
void _waitWhileBusy(const char* comment = 0, uint16_t busy_time = 5000);
|
||||||
@@ -111,16 +115,21 @@ class GxEPD2_EPD
|
@@ -111,9 +115,14 @@ class GxEPD2_EPD
|
||||||
void _startTransfer();
|
void _startTransfer();
|
||||||
void _transfer(uint8_t value);
|
void _transfer(uint8_t value);
|
||||||
void _endTransfer();
|
void _endTransfer();
|
||||||
|
@ -351,8 +351,7 @@ index ef2318f..50aa961 100644
|
||||||
bool _diag_enabled, _pulldown_rst_mode;
|
bool _diag_enabled, _pulldown_rst_mode;
|
||||||
- SPIClass* _pSPIx;
|
- SPIClass* _pSPIx;
|
||||||
SPISettings _spi_settings;
|
SPISettings _spi_settings;
|
||||||
bool _initial_write, _initial_refresh;
|
@@ -123,5 +124,5 @@ class GxEPD2_EPD
|
||||||
bool _power_is_on, _using_partial_mode, _hibernating;
|
|
||||||
uint16_t _reset_duration;
|
uint16_t _reset_duration;
|
||||||
- void (*_busy_callback)(const void*);
|
- void (*_busy_callback)(const void*);
|
||||||
+ void (*_busy_callback)(const void*);
|
+ void (*_busy_callback)(const void*);
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
# Development Changes
|
# Development Changes
|
||||||
|
|
||||||
|
## 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)
|
||||||
|
|
||||||
## 0.8.2 - 2023-11-08
|
## 0.8.2 - 2023-11-08
|
||||||
* beautified inverter settings in `setup` (preperation for future, settings become more inverter dependent)
|
* beautified inverter settings in `setup` (preperation for future, settings become more inverter dependent)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 8
|
#define VERSION_MINOR 8
|
||||||
#define VERSION_PATCH 2
|
#define VERSION_PATCH 3
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -150,6 +150,9 @@ class Inverter {
|
||||||
rssi = -127;
|
rssi = -127;
|
||||||
memset(&radioStatistics, 0, sizeof(statistics_t));
|
memset(&radioStatistics, 0, sizeof(statistics_t));
|
||||||
memset(txRfQuality, -6, 5);
|
memset(txRfQuality, -6, 5);
|
||||||
|
|
||||||
|
memset(mOffYD, 0, sizeof(float) * 6);
|
||||||
|
memset(mLastYD, 0, sizeof(float) * 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tickSend(std::function<void(uint8_t cmd, bool isDevControl)> cb) {
|
void tickSend(std::function<void(uint8_t cmd, bool isDevControl)> cb) {
|
||||||
|
@ -266,7 +269,12 @@ class Inverter {
|
||||||
} else if (FLD_YT == rec->assign[pos].fieldId) {
|
} else if (FLD_YT == rec->assign[pos].fieldId) {
|
||||||
rec->record[pos] = ((REC_TYP)(val) / (REC_TYP)(div) * generalConfig->yieldEffiency) + ((REC_TYP)config->yieldCor[rec->assign[pos].ch-1]);
|
rec->record[pos] = ((REC_TYP)(val) / (REC_TYP)(div) * generalConfig->yieldEffiency) + ((REC_TYP)config->yieldCor[rec->assign[pos].ch-1]);
|
||||||
} else if (FLD_YD == rec->assign[pos].fieldId) {
|
} else if (FLD_YD == rec->assign[pos].fieldId) {
|
||||||
rec->record[pos] = (REC_TYP)(val) / (REC_TYP)(div) * generalConfig->yieldEffiency;
|
float actYD = (REC_TYP)(val) / (REC_TYP)(div) * generalConfig->yieldEffiency;
|
||||||
|
uint8_t idx = rec->assign[pos].ch - 1;
|
||||||
|
if (mLastYD[idx] > actYD)
|
||||||
|
mOffYD[idx] += mLastYD[idx];
|
||||||
|
mLastYD[idx] = actYD;
|
||||||
|
rec->record[pos] = mOffYD[idx] + actYD;
|
||||||
} else {
|
} else {
|
||||||
if ((REC_TYP)(div) > 1)
|
if ((REC_TYP)(div) > 1)
|
||||||
rec->record[pos] = (REC_TYP)(val) / (REC_TYP)(div);
|
rec->record[pos] = (REC_TYP)(val) / (REC_TYP)(div);
|
||||||
|
@ -540,6 +548,9 @@ class Inverter {
|
||||||
alarmNxtWrPos = 0;
|
alarmNxtWrPos = 0;
|
||||||
alarmCnt = 0;
|
alarmCnt = 0;
|
||||||
alarmLastId = 0;
|
alarmLastId = 0;
|
||||||
|
|
||||||
|
memset(mOffYD, 0, sizeof(float) * 6);
|
||||||
|
memset(mLastYD, 0, sizeof(float) * 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t parseAlarmLog(uint8_t id, uint8_t pyld[], uint8_t len) {
|
uint16_t parseAlarmLog(uint8_t id, uint8_t pyld[], uint8_t len) {
|
||||||
|
@ -662,7 +673,9 @@ class Inverter {
|
||||||
radioId.b[0] = 0x01;
|
radioId.b[0] = 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mDevControlRequest; // true if change needed
|
private:
|
||||||
|
float mOffYD[6], mLastYD[6];
|
||||||
|
bool mDevControlRequest; // true if change needed
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class REC_TYP>
|
template <class REC_TYP>
|
||||||
|
|
|
@ -30,7 +30,7 @@ lib_deps =
|
||||||
https://github.com/bertmelis/espMqttClient#v1.4.5
|
https://github.com/bertmelis/espMqttClient#v1.4.5
|
||||||
bblanchon/ArduinoJson @ ^6.21.3
|
bblanchon/ArduinoJson @ ^6.21.3
|
||||||
https://github.com/JChristensen/Timezone @ ^1.2.4
|
https://github.com/JChristensen/Timezone @ ^1.2.4
|
||||||
olikraus/U8g2 @ ^2.34.17
|
olikraus/U8g2 @ ^2.35.7
|
||||||
https://github.com/zinggjm/GxEPD2 @ ^1.5.2
|
https://github.com/zinggjm/GxEPD2 @ ^1.5.2
|
||||||
build_flags =
|
build_flags =
|
||||||
-std=c++17
|
-std=c++17
|
||||||
|
@ -98,7 +98,7 @@ lib_deps =
|
||||||
https://github.com/bertmelis/espMqttClient#v1.4.4
|
https://github.com/bertmelis/espMqttClient#v1.4.4
|
||||||
bblanchon/ArduinoJson @ ^6.21.3
|
bblanchon/ArduinoJson @ ^6.21.3
|
||||||
https://github.com/JChristensen/Timezone @ ^1.2.4
|
https://github.com/JChristensen/Timezone @ ^1.2.4
|
||||||
olikraus/U8g2 @ ^2.34.17
|
olikraus/U8g2 @ ^2.35.7
|
||||||
zinggjm/GxEPD2 @ ^1.5.2
|
zinggjm/GxEPD2 @ ^1.5.2
|
||||||
build_flags = ${env.build_flags}
|
build_flags = ${env.build_flags}
|
||||||
-D ETHERNET
|
-D ETHERNET
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
var units, ivEn;
|
var units, ivEn;
|
||||||
var mIvHtml = [];
|
var mIvHtml = [];
|
||||||
var mNum = 0;
|
var mNum = 0;
|
||||||
var total = Array(5).fill(0);
|
var total = Array(6).fill(0);
|
||||||
var tPwrAck;
|
var tPwrAck;
|
||||||
|
|
||||||
function parseGeneric(obj) {
|
function parseGeneric(obj) {
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function totals() {
|
function totals() {
|
||||||
for(var i = 0; i < 5; i++) {
|
for(var i = 0; i < 6; i++) {
|
||||||
total[i] = Math.round(total[i] * 100) / 100;
|
total[i] = Math.round(total[i] * 100) / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,8 +80,9 @@
|
||||||
]),
|
]),
|
||||||
ml("div", {class: "hr"}),
|
ml("div", {class: "hr"}),
|
||||||
ml("div", {class: "row"}, [
|
ml("div", {class: "row"}, [
|
||||||
numMid(total[3], "W", "DC Power"),
|
numMid(total[3], "W", "Max Power"),
|
||||||
numMid(total[4], "var", "Reactive Power")
|
numMid(total[4], "W", "DC Power"),
|
||||||
|
numMid(total[5], "var", "Reactive Power")
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
@ -90,8 +91,9 @@
|
||||||
function ivHead(obj) {
|
function ivHead(obj) {
|
||||||
if(0 != obj.status) { // only add totals if inverter is online
|
if(0 != obj.status) { // only add totals if inverter is online
|
||||||
total[0] += obj.ch[0][2]; // P_AC
|
total[0] += obj.ch[0][2]; // P_AC
|
||||||
total[3] += obj.ch[0][8]; // P_DC
|
total[3] += obj.ch[0][11]; // MAX P_AC
|
||||||
total[4] += obj.ch[0][10]; // Q_AC
|
total[4] += obj.ch[0][8]; // P_DC
|
||||||
|
total[5] += obj.ch[0][10]; // Q_AC
|
||||||
}
|
}
|
||||||
total[1] += obj.ch[0][7]; // YieldDay
|
total[1] += obj.ch[0][7]; // YieldDay
|
||||||
total[2] += obj.ch[0][6]; // YieldTotal
|
total[2] += obj.ch[0][6]; // YieldTotal
|
||||||
|
|
Loading…
Add table
Reference in a new issue