diff --git a/src/hm/hmInverter.h b/src/hm/hmInverter.h index bcf732ea..00f05c79 100644 --- a/src/hm/hmInverter.h +++ b/src/hm/hmInverter.h @@ -133,6 +133,7 @@ class Inverter { bool isConnected; // shows if inverter was successfully identified (fw version and hardware info) InverterStatus status; // indicates the current inverter status std::array lastAlarm; // holds last 10 alarms + uint8_t rxOffset; // holds the default channel offset between tx and rx channel (nRF only) int8_t rssi; // RSSI uint16_t alarmCnt; // counts the total number of occurred alarms uint16_t alarmLastId; // lastId which was received @@ -179,7 +180,6 @@ class Inverter { tsMaxAcPower = 0; memset(&radioStatistics, 0, sizeof(statistics_t)); - memset(heuristics.txRfQuality, -6, 5); memset(mOffYD, 0, sizeof(float) * 6); memset(mLastYD, 0, sizeof(float) * 6); diff --git a/src/hm/hmRadio.h b/src/hm/hmRadio.h index bc1e3652..fbb23b57 100644 --- a/src/hm/hmRadio.h +++ b/src/hm/hmRadio.h @@ -154,11 +154,11 @@ class HmRadio : public Radio { mLastIv->mAckCount++; //mRxChIdx = (mTxChIdx + 2) % RF_CHANNELS; - mRxChIdx = (mTxChIdx + 3) % RF_CHANNELS; + mRxChIdx = (mTxChIdx + mLastIv->rxOffset) % RF_CHANNELS; mNrf24->setChannel(mRfChLst[mRxChIdx]); mNrf24->startListening(); mTimeslotStart = millis(); - tempRxChIdx = mRxChIdx; + tempRxChIdx = mRxChIdx; // might be better to start off with one channel less? rxPendular = false; mNRFloopChannels = (mLastIv->ivGen == IV_MI); @@ -369,7 +369,10 @@ class HmRadio : public Radio { DBGPRINT(String(mRfChLst[mTxChIdx])); DBGPRINT(F(", ")); DBGPRINT(String(mTxRetriesNext)); - DBGPRINT(F(" retries | ")); + //DBGPRINT(F(" retries | ")); + DBGPRINT(F(" ret., rx offset: ")); + DBGPRINT(String(iv->rxOffset)); + DBGPRINT(F(" | ")); if(*mPrintWholeTrace) { if(*mPrivacyMode) ah::dumpBuf(mTxBuf, len, 1, 4); diff --git a/src/hm/hmSystem.h b/src/hm/hmSystem.h index 8229378e..1e8641cb 100644 --- a/src/hm/hmSystem.h +++ b/src/hm/hmSystem.h @@ -28,6 +28,8 @@ class HmSystem { iv->config = &mInverter[0].generalConfig->iv[id]; DPRINT(DBG_VERBOSE, "SERIAL: " + String(iv->config->serial.b[5], HEX)); DPRINTLN(DBG_VERBOSE, " " + String(iv->config->serial.b[4], HEX)); + //iv->rxOffset = 5 - (iv->config->serial.b[2] % 5); //RF_CHANNELS; + iv->rxOffset = (iv->config->serial.b[1] % 5); //RF_CHANNELS; if((iv->config->serial.b[5] == 0x11) || (iv->config->serial.b[5] == 0x10)) { switch(iv->config->serial.b[4]) { case 0x24: // HMS-500