Skip to content

Commit

Permalink
0.8.82
Browse files Browse the repository at this point in the history
* fixed crash once firmware version was read and sent via MqTT #1428
* possible fix: reset yield offset on midnight #1429
  • Loading branch information
lumapu committed Feb 15, 2024
1 parent bd53280 commit 8c13204
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 24 deletions.
4 changes: 4 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 81
#define VERSION_PATCH 82

//-------------------------------------
typedef struct {
Expand Down
20 changes: 10 additions & 10 deletions src/hm/hmInverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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>
Expand Down
22 changes: 11 additions & 11 deletions src/publisher/pubMqttIvData.h
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 8c13204

Please sign in to comment.