Skip to content

Commit

Permalink
0.8.69
Browse files Browse the repository at this point in the history
* merge PR: Dynamic retries, pendular first rx chan #1394
  • Loading branch information
lumapu committed Jan 31, 2024
1 parent 349184a commit f89fd66
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 45 deletions.
3 changes: 3 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Development Changes

## 0.8.69 - 2024-01-31
* merge PR: Dynamic retries, pendular first rx chan #1394

## 0.8.68 - 2024-01-29
* fix HMS / HMT startup
* added `flush_rx` to NRF on TX
Expand Down
4 changes: 1 addition & 3 deletions 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 68
#define VERSION_PATCH 69

//-------------------------------------
typedef struct {
Expand All @@ -22,8 +22,6 @@ typedef struct {
int8_t rssi;
uint8_t packet[MAX_RF_PAYLOAD_SIZE];
uint16_t millis;
uint8_t arc;
uint8_t plos;
} packet_t;

typedef enum {
Expand Down
69 changes: 28 additions & 41 deletions src/hm/hmInverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,44 +190,37 @@ class Inverter {
mDevControlRequest = false;
} else if (IV_MI != ivGen) { // HM / HMS / HMT
mGetLossInterval++;
if(mNextLive)
cb(RealTimeRunData_Debug, false); // get live data
else {
if(INV_RADIO_TYPE_NRF == ivRadioType) {
// get live data until quality reaches maximum
if(!heuristics.isTxAtMax()) {
cb(RealTimeRunData_Debug, false); // get live data
return;
}
}

if(actPowerLimit == 0xffff) {
cb(SystemConfigPara, false); // power limit info
cb(RealTimeRunData_Debug, false);
} else if(InitDataState != devControlCmd) {
cb(devControlCmd, false); // custom command which was received by API
devControlCmd = InitDataState;
mGetLossInterval = 1;
} else if(0 == getFwVersion()) {
cb(InverterDevInform_All, false); // get firmware version
if(INV_RADIO_TYPE_NRF == ivRadioType) {
// get live data until quality reaches maximum
if(!heuristics.isTxAtMax()) {
cb(RealTimeRunData_Debug, false); // get live data
return;
}
else if(0 == getHwVersion()) {
cb(InverterDevInform_Simple, false); // get hardware version
cb(RealTimeRunData_Debug, false); // get live data
} else if((alarmLastId != alarmMesIndex) && (alarmMesIndex != 0)) {
cb(AlarmData, false); // get last alarms
cb(RealTimeRunData_Debug, false); // get live data
} else if((0 == mGridLen) && generalConfig->readGrid) { // read grid profile
cb(GridOnProFilePara, false);
cb(RealTimeRunData_Debug, false); // get live data
} else if (mGetLossInterval > AHOY_GET_LOSS_INTERVAL) { // get loss rate
mGetLossInterval = 1;
cb(RealTimeRunData_Debug, false); // get live data
cb(GetLossRate, false);
} else
cb(RealTimeRunData_Debug, false); // get live data
}

if(actPowerLimit == 0xffff) {
cb(SystemConfigPara, false); // power limit info
} else if(InitDataState != devControlCmd) {
cb(devControlCmd, false); // custom command which was received by API
devControlCmd = InitDataState;
mGetLossInterval = 1;
return;
} else if(0 == getFwVersion()) {
cb(InverterDevInform_All, false); // get firmware version
} else if(0 == getHwVersion()) {
cb(InverterDevInform_Simple, false); // get hardware version
} else if((alarmLastId != alarmMesIndex) && (alarmMesIndex != 0)) {
cb(AlarmData, false); // get last alarms
} else if((0 == mGridLen) && generalConfig->readGrid) { // read grid profile
cb(GridOnProFilePara, false);
} else if (mGetLossInterval > AHOY_GET_LOSS_INTERVAL) { // get loss rate
mGetLossInterval = 1;
cb(RealTimeRunData_Debug, false); // get live data
cb(GetLossRate, false);
return;
}

cb(RealTimeRunData_Debug, false); // get live data
} else { // MI
cb(((type == INV_TYPE_4CH) ? MI_REQ_4CH : MI_REQ_CH1), false);
mGetLossInterval++;
Expand Down Expand Up @@ -279,21 +272,18 @@ class Inverter {
}

const char *getFieldName(uint8_t pos, record_t<> *rec) {
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getFieldName"));
if(NULL != rec)
return fields[rec->assign[pos].fieldId];
return notAvail;
}

const char *getUnit(uint8_t pos, record_t<> *rec) {
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getUnit"));
if(NULL != rec)
return units[rec->assign[pos].unitId];
return notAvail;
}

uint8_t getChannel(uint8_t pos, record_t<> *rec) {
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getChannel"));
if(NULL != rec)
return rec->assign[pos].ch;
return 0;
Expand Down Expand Up @@ -350,7 +340,6 @@ class Inverter {
}

if(rec == &recordMeas) {
mNextLive = false; // live data received
DPRINTLN(DBG_VERBOSE, "add real time");
// get last alarm message index and save it in the inverter object
if (getPosByChFld(0, FLD_EVT, rec) == pos) {
Expand All @@ -363,7 +352,6 @@ class Inverter {
}
}
else {
mNextLive = true;
if (rec->assign == InfoAssignment) {
DPRINTLN(DBG_DEBUG, "add info");
// eg. fw version ...
Expand Down Expand Up @@ -868,7 +856,6 @@ class Inverter {
uint8_t mGridLen = 0;
uint8_t mGridProfile[MAX_GRID_LENGTH];
uint8_t mAlarmNxtWrPos = 0; // indicates the position in array (rolling buffer)
bool mNextLive = true; // first read live data after booting up then version etc.

public:
uint16_t mDtuRxCnt = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/web/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@
{
"token": "CMD_RECEIVED_WAIT_ACK",
"en": "received command, waiting for inverter acknowledge ...",
"de": "Befehl erhalten, warte auf Best&auml;igung von Wechselrichter ..."
"de": "Befehl erhalten, warte auf Best&auml;igung vom Wechselrichter ..."
},
{
"token": "COMMAND_RECEIVED",
Expand Down

0 comments on commit f89fd66

Please sign in to comment.