Browse Source

0.8.69

* merge PR: Dynamic retries, pendular first rx chan #1394
pull/1402/head
lumapu 1 year ago
parent
commit
f89fd66dbf
  1. 3
      src/CHANGES.md
  2. 4
      src/defines.h
  3. 69
      src/hm/hmInverter.h
  4. 2
      src/web/lang.json

3
src/CHANGES.md

@ -1,5 +1,8 @@
# Development Changes # Development Changes
## 0.8.69 - 2024-01-31
* merge PR: Dynamic retries, pendular first rx chan #1394
## 0.8.68 - 2024-01-29 ## 0.8.68 - 2024-01-29
* fix HMS / HMT startup * fix HMS / HMT startup
* added `flush_rx` to NRF on TX * added `flush_rx` to NRF on TX

4
src/defines.h

@ -13,7 +13,7 @@
//------------------------------------- //-------------------------------------
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 8 #define VERSION_MINOR 8
#define VERSION_PATCH 68 #define VERSION_PATCH 69
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {
@ -22,8 +22,6 @@ typedef struct {
int8_t rssi; int8_t rssi;
uint8_t packet[MAX_RF_PAYLOAD_SIZE]; uint8_t packet[MAX_RF_PAYLOAD_SIZE];
uint16_t millis; uint16_t millis;
uint8_t arc;
uint8_t plos;
} packet_t; } packet_t;
typedef enum { typedef enum {

69
src/hm/hmInverter.h

@ -190,44 +190,37 @@ class Inverter {
mDevControlRequest = false; mDevControlRequest = false;
} else if (IV_MI != ivGen) { // HM / HMS / HMT } else if (IV_MI != ivGen) { // HM / HMS / HMT
mGetLossInterval++; mGetLossInterval++;
if(mNextLive) if(INV_RADIO_TYPE_NRF == ivRadioType) {
cb(RealTimeRunData_Debug, false); // get live data // get live data until quality reaches maximum
else { if(!heuristics.isTxAtMax()) {
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
cb(RealTimeRunData_Debug, false); // get live data 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 } else { // MI
cb(((type == INV_TYPE_4CH) ? MI_REQ_4CH : MI_REQ_CH1), false); cb(((type == INV_TYPE_4CH) ? MI_REQ_4CH : MI_REQ_CH1), false);
mGetLossInterval++; mGetLossInterval++;
@ -279,21 +272,18 @@ class Inverter {
} }
const char *getFieldName(uint8_t pos, record_t<> *rec) { const char *getFieldName(uint8_t pos, record_t<> *rec) {
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getFieldName"));
if(NULL != rec) if(NULL != rec)
return fields[rec->assign[pos].fieldId]; return fields[rec->assign[pos].fieldId];
return notAvail; return notAvail;
} }
const char *getUnit(uint8_t pos, record_t<> *rec) { const char *getUnit(uint8_t pos, record_t<> *rec) {
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getUnit"));
if(NULL != rec) if(NULL != rec)
return units[rec->assign[pos].unitId]; return units[rec->assign[pos].unitId];
return notAvail; return notAvail;
} }
uint8_t getChannel(uint8_t pos, record_t<> *rec) { uint8_t getChannel(uint8_t pos, record_t<> *rec) {
DPRINTLN(DBG_VERBOSE, F("hmInverter.h:getChannel"));
if(NULL != rec) if(NULL != rec)
return rec->assign[pos].ch; return rec->assign[pos].ch;
return 0; return 0;
@ -350,7 +340,6 @@ class Inverter {
} }
if(rec == &recordMeas) { if(rec == &recordMeas) {
mNextLive = false; // live data received
DPRINTLN(DBG_VERBOSE, "add real time"); DPRINTLN(DBG_VERBOSE, "add real time");
// get last alarm message index and save it in the inverter object // get last alarm message index and save it in the inverter object
if (getPosByChFld(0, FLD_EVT, rec) == pos) { if (getPosByChFld(0, FLD_EVT, rec) == pos) {
@ -363,7 +352,6 @@ class Inverter {
} }
} }
else { else {
mNextLive = true;
if (rec->assign == InfoAssignment) { if (rec->assign == InfoAssignment) {
DPRINTLN(DBG_DEBUG, "add info"); DPRINTLN(DBG_DEBUG, "add info");
// eg. fw version ... // eg. fw version ...
@ -868,7 +856,6 @@ class Inverter {
uint8_t mGridLen = 0; uint8_t mGridLen = 0;
uint8_t mGridProfile[MAX_GRID_LENGTH]; uint8_t mGridProfile[MAX_GRID_LENGTH];
uint8_t mAlarmNxtWrPos = 0; // indicates the position in array (rolling buffer) 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: public:
uint16_t mDtuRxCnt = 0; uint16_t mDtuRxCnt = 0;

2
src/web/lang.json

@ -1396,7 +1396,7 @@
{ {
"token": "CMD_RECEIVED_WAIT_ACK", "token": "CMD_RECEIVED_WAIT_ACK",
"en": "received command, waiting for inverter acknowledge ...", "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", "token": "COMMAND_RECEIVED",

Loading…
Cancel
Save