mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-10 15:36:38 +02:00
0.8.44
* fix MqTT transmission of data #1326 * live data is read much earlier / faster and more often
This commit is contained in:
parent
21d77f58ca
commit
b4ba35e6ab
4 changed files with 33 additions and 22 deletions
|
@ -1,5 +1,9 @@
|
|||
# Development Changes
|
||||
|
||||
## 0.8.44 - 2024-01-05
|
||||
* fix MqTT transmission of data #1326
|
||||
* live data is read much earlier / faster and more often
|
||||
|
||||
## 0.8.43 - 2024-01-04
|
||||
* fix display of sunrise in `/system` #1308
|
||||
* fix overflow of `getLossRate` calculation #1318
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//-------------------------------------
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 8
|
||||
#define VERSION_PATCH 43
|
||||
#define VERSION_PATCH 44
|
||||
|
||||
//-------------------------------------
|
||||
typedef struct {
|
||||
|
|
|
@ -498,6 +498,7 @@ class Communication : public CommQueue<> {
|
|||
for (uint8_t i = 0; i < rec->length; i++) {
|
||||
q->iv->addValue(i, mPayload, rec);
|
||||
}
|
||||
rec->mqttSentStatus = MqttSentStatus::NEW_DATA;
|
||||
|
||||
q->iv->rssi = rssi;
|
||||
q->iv->doCalculations();
|
||||
|
|
|
@ -186,28 +186,33 @@ class Inverter {
|
|||
if(mDevControlRequest) {
|
||||
cb(devControlCmd, true);
|
||||
mDevControlRequest = false;
|
||||
} else if (IV_MI != ivGen) {
|
||||
} else if (IV_MI != ivGen) { // HM / HMS / HMT
|
||||
mGetLossInterval++;
|
||||
if((alarmLastId != alarmMesIndex) && (alarmMesIndex != 0))
|
||||
cb(AlarmData, false); // get last alarms
|
||||
else if(0 == getFwVersion())
|
||||
cb(InverterDevInform_All, false); // get firmware version
|
||||
else if(0 == getHwVersion())
|
||||
cb(InverterDevInform_Simple, false); // get hardware version
|
||||
else 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;
|
||||
} 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(GetLossRate, false);
|
||||
} else
|
||||
if(mNextLive)
|
||||
cb(RealTimeRunData_Debug, false); // get live data
|
||||
} else {
|
||||
else {
|
||||
mNextLive = true;
|
||||
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;
|
||||
} else if((alarmLastId != alarmMesIndex) && (alarmMesIndex != 0))
|
||||
cb(AlarmData, false); // get last alarms
|
||||
else if(0 == getFwVersion())
|
||||
cb(InverterDevInform_All, false); // get firmware version
|
||||
else if(0 == getHwVersion())
|
||||
cb(InverterDevInform_Simple, false); // get hardware version
|
||||
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(GetLossRate, false);
|
||||
} else
|
||||
cb(RealTimeRunData_Debug, false); // get live data
|
||||
}
|
||||
} else { // MI
|
||||
if(0 == getFwVersion())
|
||||
cb(0x0f, false); // get firmware version; for MI, this makes part of polling the device software and hardware version number
|
||||
else {
|
||||
|
@ -319,10 +324,10 @@ class Inverter {
|
|||
rec->record[pos] = (REC_TYP)(val);
|
||||
}
|
||||
}
|
||||
rec->mqttSentStatus = MqttSentStatus::NEW_DATA;
|
||||
}
|
||||
|
||||
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) {
|
||||
|
@ -832,6 +837,7 @@ class Inverter {
|
|||
uint16_t mIvRxCnt = 0;
|
||||
uint16_t mIvTxCnt = 0;
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue