Browse Source
			
			
			Individual rx-channel offset
			
				per inverter (based on serial, but unfortunately not working yet)
			
			
				pull/1394/head
			
			
		 
		
			
				
					
						 rejoe2
					
					2 years ago
						rejoe2
					
					2 years ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: B5690EEEBB952194
						
					
				
			
		
		
		
	
		
			
				 3 changed files with 
9 additions and 
4 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/hm/hmInverter.h
				
- 
					
					
					 
					src/hm/hmRadio.h
				
- 
					
					
					 
					src/hm/hmSystem.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); | 
			
		
	
	
		
			
				
					|  |  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					|  |  | @ -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); | 
			
		
	
	
		
			
				
					|  |  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					|  |  | @ -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
 | 
			
		
	
	
		
			
				
					|  |  | 
 |