bms debugging

This commit is contained in:
Lubos Petrovic
2020-12-08 15:38:56 +01:00
parent 048f254acc
commit f2b3d6ddf0
4 changed files with 7 additions and 8 deletions

View File

@@ -296,7 +296,8 @@ bool BoardInterface::serializeParamsToJson(File file, bool inclApiKey) {
jsonData["tRrC"] = liveData->params.tireRearRightTempC; jsonData["tRrC"] = liveData->params.tireRearRightTempC;
jsonData["tRrBar"] = round(liveData->params.tireRearRightPressureBar * 10) / 10; jsonData["tRrBar"] = round(liveData->params.tireRearRightPressureBar * 10) / 10;
jsonData["debugData"] = liveData->params.debugData; jsonData["debug"] = liveData->params.debugData;
jsonData["debug2"] = liveData->params.debugData2;
serializeJson(jsonData, Serial); serializeJson(jsonData, Serial);
serializeJson(jsonData, file); serializeJson(jsonData, file);

View File

@@ -114,10 +114,6 @@ void CarKiaEniro::parseRowMerged() {
// ABS / ESP + AHB 7D1 // ABS / ESP + AHB 7D1
if (liveData->currentAtshRequest.equals("ATSH7D1")) { if (liveData->currentAtshRequest.equals("ATSH7D1")) {
// Init debug data
tmpStr = "";
tmpStr.toCharArray(liveData->params.debugData, tmpStr.length() + 1);
//
if (liveData->commandRequest.equals("22C101")) { if (liveData->commandRequest.equals("22C101")) {
uint8_t driveMode = liveData->hexToDecFromResponse(22, 24, 1, false); uint8_t driveMode = liveData->hexToDecFromResponse(22, 24, 1, false);
liveData->params.forwardDriveMode = (driveMode == 4); liveData->params.forwardDriveMode = (driveMode == 4);
@@ -277,7 +273,7 @@ void CarKiaEniro::parseRowMerged() {
liveData->params.cellVoltage[96 - 30 + i] = liveData->hexToDecFromResponse(14 + (i * 2), 14 + (i * 2) + 2, 1, false) / 50; liveData->params.cellVoltage[96 - 30 + i] = liveData->hexToDecFromResponse(14 + (i * 2), 14 + (i * 2) + 2, 1, false) / 50;
} }
// log 220105 to sdcard // log 220105 to sdcard
tmpStr = String(liveData->params.debugData) + liveData->currentAtshRequest + '/' + liveData->commandRequest + '/' + liveData->responseRowMerged + '\n'; tmpStr = liveData->currentAtshRequest + '/' + liveData->commandRequest + '/' + liveData->responseRowMerged;
tmpStr.toCharArray(liveData->params.debugData, tmpStr.length() + 1); tmpStr.toCharArray(liveData->params.debugData, tmpStr.length() + 1);
} }
// BMS 7e4 // BMS 7e4
@@ -286,8 +282,8 @@ void CarKiaEniro::parseRowMerged() {
liveData->params.bmsUnknownTempC = liveData->hexToDecFromResponse(18, 20, 1, true); liveData->params.bmsUnknownTempC = liveData->hexToDecFromResponse(18, 20, 1, true);
liveData->params.bmsUnknownTempD = liveData->hexToDecFromResponse(46, 48, 1, true); liveData->params.bmsUnknownTempD = liveData->hexToDecFromResponse(46, 48, 1, true);
// log 220106 to sdcard // log 220106 to sdcard
tmpStr = String(liveData->params.debugData) + liveData->currentAtshRequest + '/' + liveData->commandRequest + '/' + liveData->responseRowMerged + '\n'; tmpStr = liveData->currentAtshRequest + '/' + liveData->commandRequest + '/' + liveData->responseRowMerged;
tmpStr.toCharArray(liveData->params.debugData, tmpStr.length() + 1); tmpStr.toCharArray(liveData->params.debugData2, tmpStr.length() + 1);
} }
} }

View File

@@ -112,6 +112,7 @@ void LiveData::initParams() {
// //
tmpStr = ""; tmpStr = "";
tmpStr.toCharArray(params.debugData, tmpStr.length() + 1); tmpStr.toCharArray(params.debugData, tmpStr.length() + 1);
tmpStr.toCharArray(params.debugData2, tmpStr.length() + 1);
// Menu // Menu
menuItemsCount = sizeof(menuItemsSource) / sizeof(menuItemsSource[0]); menuItemsCount = sizeof(menuItemsSource) / sizeof(menuItemsSource[0]);

View File

@@ -131,6 +131,7 @@ typedef struct {
time_t soc10time[11]; // time for avg speed time_t soc10time[11]; // time for avg speed
// additional // additional
char debugData[256]; char debugData[256];
char debugData2[256];
/* /*
uint8_t bmsMainRelay; uint8_t bmsMainRelay;
uint8_t highVoltageCharging; uint8_t highVoltageCharging;