* fixed crash once firmware version was read and sent via MqTT #1428
* possible fix: reset yield offset on midnight #1429
This commit is contained in:
lumapu 2024-02-15 23:22:24 +01:00
parent bd532805a6
commit 8c132048e6
5 changed files with 27 additions and 24 deletions

View file

@ -1,5 +1,9 @@
# Development Changes
## 0.8.82 - 2024-02-15
* fixed crash once firmware version was read and sent via MqTT #1428
* possible fix: reset yield offset on midnight #1429
## 0.8.81 - 2024-02-13
* fixed authentication with empty token #1415
* added new setting for future function to send log via MqTT

View file

@ -466,8 +466,6 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) {
continue; // skip to next inverter
if (!iv->config->enabled)
continue; // skip to next inverter
if (iv->commEnabled)
continue; // skip to next inverter
if (checkAvail) {
if (!iv->isAvailable())
@ -495,6 +493,7 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) {
pos = iv->getPosByChFld(ch, FLD_MP, rec);
iv->setValue(pos, rec, 0.0f);
}
iv->resetAlarms();
iv->doCalculations();
}

View file

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 81
#define VERSION_PATCH 82
//-------------------------------------
typedef struct {

View file

@ -149,9 +149,6 @@ class Inverter {
uint32_t tsMaxAcPower = 0; // holds the timestamp when the MaxAC power was seen
bool commEnabled = true; // 'pause night communication' sets this field to false
static uint32_t *timestamp; // system timestamp
static cfgInst_t *generalConfig; // general inverter configuration from setup
public:
Inverter() {
@ -826,20 +823,23 @@ class Inverter {
radioId.b[0] = 0x01;
}
private:
float mOffYD[6], mLastYD[6];
bool mDevControlRequest = false; // true if change needed
uint8_t mGridLen = 0;
std::array<uint8_t, MAX_GRID_LENGTH> mGridProfile;
uint8_t mAlarmNxtWrPos = 0; // indicates the position in array (rolling buffer)
public:
static uint32_t *timestamp; // system timestamp
static cfgInst_t *generalConfig; // general inverter configuration from setup
uint16_t mDtuRxCnt = 0;
uint16_t mDtuTxCnt = 0;
uint8_t mGetLossInterval = 0; // request iv every AHOY_GET_LOSS_INTERVAL RealTimeRunData_Debug
uint16_t mIvRxCnt = 0;
uint16_t mIvTxCnt = 0;
uint16_t mAckCount = 0;
private:
float mOffYD[6], mLastYD[6];
bool mDevControlRequest = false; // true if change needed
uint8_t mGridLen = 0;
std::array<uint8_t, MAX_GRID_LENGTH> mGridProfile;
uint8_t mAlarmNxtWrPos = 0; // indicates the position in array (rolling buffer)
};
template <class REC_TYP>

View file

@ -179,20 +179,20 @@ class PubMqttIvData {
if (MqttSentStatus::LAST_SUCCESS_SENT == rec->mqttSentStatus) {
if(InverterDevInform_All == mCmd) {
snprintf(mSubTopic.data(), mSubTopic.size(), "%s/firmware", mIv->config->name);
snprintf(mVal.data(), mVal.size(), "{\"version\":%d,\"build_year\":\"%s\",\"build_month_day\":%d,\"build_hour_min\":%d,\"bootloader\":%d}",
mIv->getChannelFieldValue(CH0, FLD_FW_VERSION, rec),
mIv->getChannelFieldValue(CH0, FLD_FW_BUILD_YEAR, rec),
mIv->getChannelFieldValue(CH0, FLD_FW_BUILD_MONTH_DAY, rec),
mIv->getChannelFieldValue(CH0, FLD_FW_BUILD_HOUR_MINUTE, rec),
mIv->getChannelFieldValue(CH0, FLD_BOOTLOADER_VER, rec));
snprintf(mVal.data(), mVal.size(), "{\"version\":%d,\"build_year\":\"%d\",\"build_month_day\":%d,\"build_hour_min\":%d,\"bootloader\":%d}",
static_cast<int>(mIv->getChannelFieldValue(CH0, FLD_FW_VERSION, rec)),
static_cast<int>(mIv->getChannelFieldValue(CH0, FLD_FW_BUILD_YEAR, rec)),
static_cast<int>(mIv->getChannelFieldValue(CH0, FLD_FW_BUILD_MONTH_DAY, rec)),
static_cast<int>(mIv->getChannelFieldValue(CH0, FLD_FW_BUILD_HOUR_MINUTE, rec)),
static_cast<int>(mIv->getChannelFieldValue(CH0, FLD_BOOTLOADER_VER, rec)));
retained = true;
} else if(InverterDevInform_Simple == mCmd) {
snprintf(mSubTopic.data(), mSubTopic.size(), "%s/hardware", mIv->config->name);
snprintf(mVal.data(), mVal.size(), "{\"part\":%d,\"version\":\"%s\",\"grid_profile_code\":%d,\"grid_profile_version\":%d}",
mIv->getChannelFieldValue(CH0, FLD_PART_NUM, rec),
mIv->getChannelFieldValue(CH0, FLD_HW_VERSION, rec),
mIv->getChannelFieldValue(CH0, FLD_GRID_PROFILE_CODE, rec),
mIv->getChannelFieldValue(CH0, FLD_GRID_PROFILE_VERSION, rec));
snprintf(mVal.data(), mVal.size(), "{\"part\":%d,\"version\":\"%d\",\"grid_profile_code\":%d,\"grid_profile_version\":%d}",
static_cast<int>(mIv->getChannelFieldValue(CH0, FLD_PART_NUM, rec)),
static_cast<int>(mIv->getChannelFieldValue(CH0, FLD_HW_VERSION, rec)),
static_cast<int>(mIv->getChannelFieldValue(CH0, FLD_GRID_PROFILE_CODE, rec)),
static_cast<int>(mIv->getChannelFieldValue(CH0, FLD_GRID_PROFILE_VERSION, rec)));
retained = true;
} else {
snprintf(mSubTopic.data(), mSubTopic.size(), "%s/ch%d/%s", mIv->config->name, rec->assign[mPos].ch, fields[rec->assign[mPos].fieldId]);