This commit is contained in:
James 2024-04-27 11:40:16 +01:00
parent 18dff75731
commit 3068f6805e
2 changed files with 20 additions and 20 deletions

View File

@ -135,7 +135,7 @@ void loop() {
currentName[sizeof(currentName) - 1] = '\0'; // Ensure null-termination
// Convert to lowercase and replace spaces with dots
for (char* p = currentName; *p; ++p) {
*p = *p == ' ' ? '.' : tolower(*p);
*p = *p == ' ' ? '.' : *p;
}
unsigned long start=millis();
@ -317,14 +317,14 @@ bool processBasicInfo(byte *data, unsigned int dataLen){
uint16_t BalanceCodeHigh = (two_ints_into16(data[14], data[15]));
uint8_t MosfetStatus = ((byte)data[20]);
Serial.printf(">>>rc.%s.Voltage %f\r\n",currentName, (float)Volts / 1000);
Serial.printf(">>>rc.%s.Amps %f\r\n",currentName, (float)Amps / 1000);
Serial.printf(">>>rc.%s.watts %f\r\n",currentName, (float)Watts);
Serial.printf(">>>rc.%s.Capacity_Remain_Ah %f\r\n",currentName, (float)CapacityRemainAh / 1000);
Serial.printf(">>>rc.%s.Capacity_Remain_Wh %f\r\n",currentName, ((float)(CapacityRemainAh) / 1000) * ((float)(Volts) / 1000));
Serial.printf(">>>rc.%s.Capacity_Remain_Percent %d\r\n",currentName, CapacityRemainPercent);
Serial.printf(">>>rc.%s.Temp1 %f\r\n",currentName, (float)Temp1 / 10);
Serial.printf(">>>rc.%s.Temp2 %f\r\n",currentName, (float)Temp2 / 10);
Serial.printf(">>>RC.%s.Voltage %f\r\n",currentName, (float)Volts / 1000);
Serial.printf(">>>RC.%s.Amps %f\r\n",currentName, (float)Amps / 1000);
Serial.printf(">>>RC.%s.watts %f\r\n",currentName, (float)Watts);
Serial.printf(">>>RC.%s.Capacity_Remain_Ah %f\r\n",currentName, (float)CapacityRemainAh / 1000);
Serial.printf(">>>RC.%s.Capacity_Remain_Wh %f\r\n",currentName, ((float)(CapacityRemainAh) / 1000) * ((float)(Volts) / 1000));
Serial.printf(">>>RC.%s.Capacity_Remain_Percent %d\r\n",currentName, CapacityRemainPercent);
Serial.printf(">>>RC.%s.Temp1 %f\r\n",currentName, (float)Temp1 / 10);
Serial.printf(">>>RC.%s.Temp2 %f\r\n",currentName, (float)Temp2 / 10);
/*
Serial.printf("%s Balance Code Low: 0x%x\r\n",currentName, BalanceCodeLow);
Serial.printf("%s Balance Code High: 0x%x\r\n",currentName, BalanceCodeHigh);
@ -358,13 +358,13 @@ bool processCellInfo(byte *data, unsigned int dataLen)
_cellMin = CellVolt;
}
Serial.printf(">>>rc.%s.Cell.%d.Voltage %f\r\n",currentName, i+1,(float)CellVolt/1000);
Serial.printf(">>>RC.%s.Cell.%d.Voltage %f\r\n",currentName, i+1,(float)CellVolt/1000);
}
Serial.printf(">>>rc.%s.Max_Cell_Voltage %f\r\n",currentName, (float)_cellMax / 1000);
Serial.printf(">>>rc.%s.Min_Cell_Voltage %f\r\n",currentName, (float)_cellMin / 1000);
Serial.printf(">>>rc.%s.Difference_Cell_Voltage %f\r\n",currentName, (float)(_cellMax - _cellMin) / 1000);
Serial.printf(">>>rc.%s.Average_Cell_Voltage %f\r\n",currentName, (float)(_cellSum / NumOfCells) / 1000);
Serial.printf(">>>RC.%s.Max_Cell_Voltage %f\r\n",currentName, (float)_cellMax / 1000);
Serial.printf(">>>RC.%s.Min_Cell_Voltage %f\r\n",currentName, (float)_cellMin / 1000);
Serial.printf(">>>RC.%s.Difference_Cell_Voltage %f\r\n",currentName, (float)(_cellMax - _cellMin) / 1000);
Serial.printf(">>>RC.%s.Average_Cell_Voltage %f\r\n",currentName, (float)(_cellSum / NumOfCells) / 1000);
gotCellInfo=true;

View File

@ -185,11 +185,11 @@ void decodeVictron(BLEAdvertisedDevice advertisedDevice) {
return;
}
Serial.printf(">>>MPPT.1.Battery_Volts %f\r\n",batteryVoltage);
Serial.printf(">>>MPPT.1.Battery_Amps %f\r\n",batteryCurrent);
Serial.printf(">>>MPPT.1.Solar_Watts %f\r\n",inputPower);
Serial.printf(">>>MPPT.1.Output_Current %f\r\n",outputCurrent);
Serial.printf(">>>MPPT.1.Yield %f\r\n",todayYield);
Serial.printf(">>>MPPT.1.State %d\r\n",deviceState);
Serial.printf(">>>RC.MPPT.1.Battery_Volts %f\r\n",batteryVoltage);
Serial.printf(">>>RC.MPPT.1.Battery_Amps %f\r\n",batteryCurrent);
Serial.printf(">>>RC.MPPT.1.Solar_Watts %f\r\n",inputPower);
Serial.printf(">>>RC.MPPT.1.Output_Current %f\r\n",outputCurrent);
Serial.printf(">>>RC.MPPT.1.Yield %f\r\n",todayYield);
Serial.printf(">>>RC.MPPT.1.State %d\r\n",deviceState);
}
}