Browse Source

Individual rx-channel offset

per inverter (based on serial, but unfortunately not working yet)
pull/1394/head
rejoe2 1 year ago
committed by GitHub
parent
commit
1b4b5874df
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/hm/hmInverter.h
  2. 9
      src/hm/hmRadio.h
  3. 2
      src/hm/hmSystem.h

2
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<alarm_t, 10> 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);

9
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);

2
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

Loading…
Cancel
Save