Ioniq 2018
This commit is contained in:
@@ -17,7 +17,7 @@ String commandQueueHyundaiIoniq[commandQueueCountHyundaiIoniq] = {
|
|||||||
|
|
||||||
// Loop from (HYUNDAI IONIQ)
|
// Loop from (HYUNDAI IONIQ)
|
||||||
// BMS
|
// BMS
|
||||||
"atsh7e4",
|
"ATSH7E4",
|
||||||
"2101", // power kw, ...
|
"2101", // power kw, ...
|
||||||
"2102", // cell voltages, screen 3 only
|
"2102", // cell voltages, screen 3 only
|
||||||
"2103", // cell voltages, screen 3 only
|
"2103", // cell voltages, screen 3 only
|
||||||
@@ -26,28 +26,28 @@ String commandQueueHyundaiIoniq[commandQueueCountHyundaiIoniq] = {
|
|||||||
"2106", // cooling water temp
|
"2106", // cooling water temp
|
||||||
|
|
||||||
// VMCU
|
// VMCU
|
||||||
"atsh7e2",
|
"ATSH7E2",
|
||||||
"2101", // speed, ...
|
"2101", // speed, ...
|
||||||
"2102", // aux, ...
|
"2102", // aux, ...
|
||||||
|
|
||||||
//"atsh7df",
|
//"ATSH7Df",
|
||||||
//"2106",
|
//"2106",
|
||||||
//"220106",
|
//"220106",
|
||||||
|
|
||||||
// ECU - Aircondition
|
// ECU - Aircondition
|
||||||
// IONIQ OK
|
// IONIQ OK
|
||||||
"atsh7b3",
|
"ATSH7B3",
|
||||||
"220100", // in/out temp
|
"220100", // in/out temp
|
||||||
"220102", // coolant temp1, 2
|
"220102", // coolant temp1, 2
|
||||||
|
|
||||||
// BCM / TPMS
|
// BCM / TPMS
|
||||||
// IONIQ OK
|
// IONIQ OK
|
||||||
"atsh7a0",
|
"ATSH7A0",
|
||||||
"22c00b", // tire pressure/temp
|
"22c00b", // tire pressure/temp
|
||||||
|
|
||||||
// CLUSTER MODULE
|
// CLUSTER MODULE
|
||||||
// IONIQ OK
|
// IONIQ OK
|
||||||
"atsh7c6",
|
"ATSH7C6",
|
||||||
"22B002", // odo
|
"22B002", // odo
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -78,33 +78,38 @@ bool activateCommandQueueForHyundaiIoniq() {
|
|||||||
*/
|
*/
|
||||||
bool parseRowMergedHyundaiIoniq() {
|
bool parseRowMergedHyundaiIoniq() {
|
||||||
|
|
||||||
// VMCU 7e2
|
// VMCU 7E2
|
||||||
|
if (currentAtshRequest.equals("ATSH7E2")) {
|
||||||
if (commandRequest.equals("2101")) {
|
if (commandRequest.equals("2101")) {
|
||||||
params.speedKmh = hexToDec(responseRowMerged.substring(32, 36).c_str(), 2, false) * 0.0155; // / 100.0 *1.609 = real to gps is 1.750
|
params.speedKmh = hexToDec(responseRowMerged.substring(32, 36).c_str(), 2, false) * 0.0155; // / 100.0 *1.609 = real to gps is 1.750
|
||||||
}
|
}
|
||||||
// VMCU 7e2
|
|
||||||
if (commandRequest.equals("2102")) {
|
if (commandRequest.equals("2102")) {
|
||||||
params.auxPerc = hexToDec(responseRowMerged.substring(50, 52).c_str(), 1, false);
|
params.auxPerc = hexToDec(responseRowMerged.substring(50, 52).c_str(), 1, false);
|
||||||
params.auxCurrentAmp = - hexToDec(responseRowMerged.substring(46, 50).c_str(), 2, true) / 1000.0;
|
params.auxCurrentAmp = - hexToDec(responseRowMerged.substring(46, 50).c_str(), 2, true) / 1000.0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Cluster module 7c6
|
// Cluster module 7c6
|
||||||
|
if (currentAtshRequest.equals("ATSH7C6")) {
|
||||||
if (commandRequest.equals("22B002")) {
|
if (commandRequest.equals("22B002")) {
|
||||||
params.odoKm = float(strtol(responseRowMerged.substring(18, 24).c_str(), 0, 16));
|
params.odoKm = float(strtol(responseRowMerged.substring(18, 24).c_str(), 0, 16));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Aircon 7b3
|
// Aircon 7b3
|
||||||
// IONIQ OK
|
if (currentAtshRequest.equals("ATSH7B3")) {
|
||||||
if (commandRequest.equals("220100")) {
|
if (commandRequest.equals("220100")) {
|
||||||
params.indoorTemperature = (hexToDec(responseRowMerged.substring(16, 18).c_str(), 1, false) / 2) - 40;
|
params.indoorTemperature = (hexToDec(responseRowMerged.substring(16, 18).c_str(), 1, false) / 2) - 40;
|
||||||
params.outdoorTemperature = (hexToDec(responseRowMerged.substring(18, 20).c_str(), 1, false) / 2) - 40;
|
params.outdoorTemperature = (hexToDec(responseRowMerged.substring(18, 20).c_str(), 1, false) / 2) - 40;
|
||||||
}
|
}
|
||||||
// Aircon 7b3
|
|
||||||
// IONIQ OK
|
|
||||||
if (commandRequest.equals("220102") && responseRowMerged.substring(12, 14) == "00") {
|
if (commandRequest.equals("220102") && responseRowMerged.substring(12, 14) == "00") {
|
||||||
params.coolantTemp1C = (hexToDec(responseRowMerged.substring(14, 16).c_str(), 1, false) / 2) - 40;
|
params.coolantTemp1C = (hexToDec(responseRowMerged.substring(14, 16).c_str(), 1, false) / 2) - 40;
|
||||||
params.coolantTemp2C = (hexToDec(responseRowMerged.substring(16, 18).c_str(), 1, false) / 2) - 40;
|
params.coolantTemp2C = (hexToDec(responseRowMerged.substring(16, 18).c_str(), 1, false) / 2) - 40;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// BMS 7e4
|
// BMS 7e4
|
||||||
|
if (currentAtshRequest.equals("ATSH7E4")) {
|
||||||
if (commandRequest.equals("2101")) {
|
if (commandRequest.equals("2101")) {
|
||||||
params.cumulativeEnergyChargedKWh = float(strtol(responseRowMerged.substring(80, 88).c_str(), 0, 16)) / 10.0;
|
params.cumulativeEnergyChargedKWh = float(strtol(responseRowMerged.substring(80, 88).c_str(), 0, 16)) / 10.0;
|
||||||
if (params.cumulativeEnergyChargedKWhStart == -1)
|
if (params.cumulativeEnergyChargedKWhStart == -1)
|
||||||
@@ -191,8 +196,10 @@ bool parseRowMergedHyundaiIoniq() {
|
|||||||
if (commandRequest.equals("2106")) {
|
if (commandRequest.equals("2106")) {
|
||||||
params.coolingWaterTempC = hexToDec(responseRowMerged.substring(14, 16).c_str(), 1, false);
|
params.coolingWaterTempC = hexToDec(responseRowMerged.substring(14, 16).c_str(), 1, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TPMS 7a0
|
// TPMS 7a0
|
||||||
// IONIQ OK
|
if (currentAtshRequest.equals("ATSH7A0")) {
|
||||||
if (commandRequest.equals("22c00b")) {
|
if (commandRequest.equals("22c00b")) {
|
||||||
params.tireFrontLeftPressureBar = hexToDec(responseRowMerged.substring(14, 16).c_str(), 2, false) / 72.51886900361; // === OK Valid *0.2 / 14.503773800722
|
params.tireFrontLeftPressureBar = hexToDec(responseRowMerged.substring(14, 16).c_str(), 2, false) / 72.51886900361; // === OK Valid *0.2 / 14.503773800722
|
||||||
params.tireFrontRightPressureBar = hexToDec(responseRowMerged.substring(22, 24).c_str(), 2, false) / 72.51886900361; // === OK Valid *0.2 / 14.503773800722
|
params.tireFrontRightPressureBar = hexToDec(responseRowMerged.substring(22, 24).c_str(), 2, false) / 72.51886900361; // === OK Valid *0.2 / 14.503773800722
|
||||||
@@ -203,6 +210,7 @@ bool parseRowMergedHyundaiIoniq() {
|
|||||||
params.tireRearRightTempC = hexToDec(responseRowMerged.substring(32, 34).c_str(), 2, false) - 50; // === OK Valid
|
params.tireRearRightTempC = hexToDec(responseRowMerged.substring(32, 34).c_str(), 2, false) - 50; // === OK Valid
|
||||||
params.tireRearLeftTempC = hexToDec(responseRowMerged.substring(40, 42).c_str(), 2, false) - 50; // === OK Valid
|
params.tireRearLeftTempC = hexToDec(responseRowMerged.substring(40, 42).c_str(), 2, false) - 50; // === OK Valid
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -212,99 +220,69 @@ bool parseRowMergedHyundaiIoniq() {
|
|||||||
*/
|
*/
|
||||||
bool testDataHyundaiIoniq() {
|
bool testDataHyundaiIoniq() {
|
||||||
|
|
||||||
// VMCU atsh7e2
|
// VMCU ATSH7E2
|
||||||
|
currentAtshRequest = "ATSH7E2";
|
||||||
// 2101
|
// 2101
|
||||||
commandRequest = "2101";
|
commandRequest = "2101";
|
||||||
//eniro = "6101FFF8000009285A3B0648030000B4179D763404080805000000";
|
|
||||||
responseRowMerged = "6101FFE0000009211222062F03000000001D7734";
|
responseRowMerged = "6101FFE0000009211222062F03000000001D7734";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
// VMCU atsh7e2
|
|
||||||
// 2102
|
// 2102
|
||||||
commandRequest = "2102";
|
commandRequest = "2102";
|
||||||
//eniro = "6102F8FFFC000101000000840FBF83BD33270680953033757F59291C76000001010100000007000000";
|
|
||||||
responseRowMerged = "6102FF80000001010000009311AE8C9839640611887C3900000000";
|
responseRowMerged = "6102FF80000001010000009311AE8C9839640611887C3900000000";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
// "atsh7df",
|
// "ATSH7DF",
|
||||||
// 2106
|
currentAtshRequest = "ATSH7DF";
|
||||||
//commandRequest = "2106";
|
|
||||||
//eniro = "6106FFFF800000000000000200001B001C001C000600060006000E000000010000000000000000013D013D013E013E00";
|
|
||||||
//parseRowMergedHyundaiIoniq();
|
|
||||||
|
|
||||||
// AIRCON / ACU atsh7b3
|
// AIRCON / ACU ATSH7B3
|
||||||
|
currentAtshRequest = "ATSH7B3";
|
||||||
// 220100
|
// 220100
|
||||||
commandRequest = "220100";
|
commandRequest = "220100";
|
||||||
//eniro = "6201007E5027C8FF7F765D05B95AFFFF5AFF11FFFFFFFFFFFF6AFFFF2DF0757630FFFF00FFFF000000";
|
|
||||||
responseRowMerged = "6201007E5007C8FF8A876A011010FFFF10FF10FFFFFFFFFFFFFFFFFF2EEF767D00FFFF00FFFF000000";
|
responseRowMerged = "6201007E5007C8FF8A876A011010FFFF10FF10FFFFFFFFFFFFFFFFFF2EEF767D00FFFF00FFFF000000";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
// AIRCON / ACU atsh7b3
|
|
||||||
// 220102
|
// 220102
|
||||||
commandRequest = "220102";
|
commandRequest = "220102";
|
||||||
responseRowMerged = "620102FF800000A3950000000000002600000000";
|
responseRowMerged = "620102FF800000A3950000000000002600000000";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
|
// BMS ATSH7E4
|
||||||
// BMS atsh7e4
|
currentAtshRequest = "ATSH7E4";
|
||||||
// 220101
|
// 220101
|
||||||
commandRequest = "2101";
|
commandRequest = "2101";
|
||||||
//eniro = "620101FFF7E7FFB3000000000300120F9B111011101011000014CC38CB3B00009100003A510000367C000015FB000013D3000690250D018E0000000003E8";
|
|
||||||
responseRowMerged = "6101FFFFFFFF5026482648A3FFC30D9E181717171718170019B50FB501000090000142230001425F0000771B00007486007815D809015C0000000003E800";
|
responseRowMerged = "6101FFFFFFFF5026482648A3FFC30D9E181717171718170019B50FB501000090000142230001425F0000771B00007486007815D809015C0000000003E800";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
// BMS atsh7e4
|
|
||||||
// 220102
|
// 220102
|
||||||
commandRequest = "2102";
|
commandRequest = "2102";
|
||||||
// eniro = "620102FFFFFFFFCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBAAAA";
|
|
||||||
responseRowMerged = "6102FFFFFFFFB5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5000000";
|
responseRowMerged = "6102FFFFFFFFB5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5000000";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
// BMS atsh7e4
|
|
||||||
// 220103
|
// 220103
|
||||||
commandRequest = "2103";
|
commandRequest = "2103";
|
||||||
//eniro = "620103FFFFFFFFCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCACBCACACFCCCBCBCBCBCBCBCBCBAAAA";
|
|
||||||
responseRowMerged = "6103FFFFFFFFB5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5000000";
|
responseRowMerged = "6103FFFFFFFFB5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5000000";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
// BMS atsh7e4
|
|
||||||
// 220104
|
// 220104
|
||||||
commandRequest = "2104";
|
commandRequest = "2104";
|
||||||
//eniro = "620104FFFFFFFFCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBAAAA";
|
|
||||||
responseRowMerged = "6104FFFFFFFFB5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5000000";
|
responseRowMerged = "6104FFFFFFFFB5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5000000";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
// BMS atsh7e4
|
|
||||||
// 220105
|
// 220105
|
||||||
commandRequest = "2105";
|
commandRequest = "2105";
|
||||||
//eniro = "620105003fff9000000000000000000F8A86012B4946500101500DAC03E800000000AC0000C7C701000F00000000AAAA";
|
|
||||||
responseRowMerged = "6105FFFFFFFF00000000001717171817171726482648000150181703E81A03E801520029000000000000000000000000";
|
responseRowMerged = "6105FFFFFFFF00000000001717171817171726482648000150181703E81A03E801520029000000000000000000000000";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
// BMS atsh7e4
|
|
||||||
// 220106
|
// 220106
|
||||||
commandRequest = "2106";
|
commandRequest = "2106";
|
||||||
//eniro = "620106FFFFFFFF14001A00240000003A7C86B4B30000000928EA00";
|
|
||||||
responseRowMerged = "7F2112"; // n/a on ioniq
|
responseRowMerged = "7F2112"; // n/a on ioniq
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
// 22c002
|
// BCM / TPMS ATSH7A0
|
||||||
//commandRequest = "22c002";
|
currentAtshRequest = "ATSH7A0";
|
||||||
// eniro = "62C002FFFF0000D2E84E93D2E84EBBD2DBDACBD2E149F3AAAAAAAA";
|
|
||||||
//responseRowMerged = "";
|
|
||||||
//parseRowMergedHyundaiIoniq();
|
|
||||||
|
|
||||||
// BCM / TPMS atsh7a0
|
|
||||||
// 22c00b
|
// 22c00b
|
||||||
commandRequest = "22c00b";
|
commandRequest = "22c00b";
|
||||||
// eniro = "62C00BFFFF0000B93D0100B43E0100B43D0100BB3C0100AAAAAAAA";
|
|
||||||
responseRowMerged = "62C00BFFFF0000B9510100B9510100B84F0100B54F0100AAAAAAAA";
|
responseRowMerged = "62C00BFFFF0000B9510100B9510100B84F0100B54F0100AAAAAAAA";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
// atsh7c6
|
// ATSH7C6
|
||||||
|
currentAtshRequest = "ATSH7C6";
|
||||||
// 22b002
|
// 22b002
|
||||||
commandRequest = "22b002";
|
commandRequest = "22b002";
|
||||||
// eniro = "62B002E0000000FFB400330B0000000000000000";
|
|
||||||
responseRowMerged = "62B002E000000000AD003D2D0000000000000000";
|
responseRowMerged = "62B002E000000000AD003D2D0000000000000000";
|
||||||
parseRowMergedHyundaiIoniq();
|
parseRowMergedHyundaiIoniq();
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ String commandQueueKiaENiro[commandQueueCountKiaENiro] = {
|
|||||||
|
|
||||||
// Loop from (KIA ENIRO)
|
// Loop from (KIA ENIRO)
|
||||||
// BMS
|
// BMS
|
||||||
"atsh7e4",
|
"ATSH7E4",
|
||||||
"220101", // power kw, ...
|
"220101", // power kw, ...
|
||||||
"220102", // cell voltages, screen 3 only
|
"220102", // cell voltages, screen 3 only
|
||||||
"220103", // cell voltages, screen 3 only
|
"220103", // cell voltages, screen 3 only
|
||||||
@@ -28,31 +28,31 @@ String commandQueueKiaENiro[commandQueueCountKiaENiro] = {
|
|||||||
"220106", // cooling water temp
|
"220106", // cooling water temp
|
||||||
|
|
||||||
// VMCU
|
// VMCU
|
||||||
"atsh7e2",
|
"ATSH7E2",
|
||||||
"2101", // speed, ...
|
"2101", // speed, ...
|
||||||
"2102", // aux, ...
|
"2102", // aux, ...
|
||||||
|
|
||||||
//"atsh7df",
|
//"ATSH7Df",
|
||||||
//"2106",
|
//"2106",
|
||||||
//"220106",
|
//"220106",
|
||||||
|
|
||||||
// ECU - Aircondition
|
// ECU - Aircondition
|
||||||
"atsh7b3",
|
"ATSH7B3",
|
||||||
"220100", // in/out temp
|
"220100", // in/out temp
|
||||||
"220102", // coolant temp1, 2
|
"220102", // coolant temp1, 2
|
||||||
|
|
||||||
// BCM / TPMS
|
// BCM / TPMS
|
||||||
"atsh7a0",
|
"ATSH7A0",
|
||||||
"22c00b", // tire pressure/temp
|
"22c00b", // tire pressure/temp
|
||||||
|
|
||||||
// CLUSTER MODULE
|
// CLUSTER MODULE
|
||||||
"atsh7c6",
|
"ATSH7C6",
|
||||||
"22B002", // odo
|
"22B002", // odo
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init command queue
|
Init command queue
|
||||||
*/
|
*/
|
||||||
bool activateCommandQueueForKiaENiro() {
|
bool activateCommandQueueForKiaENiro() {
|
||||||
|
|
||||||
// 39 or 64 kWh model?
|
// 39 or 64 kWh model?
|
||||||
@@ -80,6 +80,8 @@ bool activateCommandQueueForKiaENiro() {
|
|||||||
*/
|
*/
|
||||||
bool parseRowMergedKiaENiro() {
|
bool parseRowMergedKiaENiro() {
|
||||||
|
|
||||||
|
// VMCU 7E2
|
||||||
|
if (currentAtshRequest.equals("ATSH7E2")) {
|
||||||
if (commandRequest.equals("2101")) {
|
if (commandRequest.equals("2101")) {
|
||||||
params.speedKmh = hexToDec(responseRowMerged.substring(32, 36).c_str(), 2, false) * 0.0155; // / 100.0 *1.609 = real to gps is 1.750
|
params.speedKmh = hexToDec(responseRowMerged.substring(32, 36).c_str(), 2, false) * 0.0155; // / 100.0 *1.609 = real to gps is 1.750
|
||||||
}
|
}
|
||||||
@@ -87,22 +89,29 @@ bool parseRowMergedKiaENiro() {
|
|||||||
params.auxPerc = hexToDec(responseRowMerged.substring(50, 52).c_str(), 1, false);
|
params.auxPerc = hexToDec(responseRowMerged.substring(50, 52).c_str(), 1, false);
|
||||||
params.auxCurrentAmp = - hexToDec(responseRowMerged.substring(46, 50).c_str(), 2, true) / 1000.0;
|
params.auxCurrentAmp = - hexToDec(responseRowMerged.substring(46, 50).c_str(), 2, true) / 1000.0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Cluster module 7c6
|
// Cluster module 7c6
|
||||||
|
if (currentAtshRequest.equals("ATSH7C6")) {
|
||||||
if (commandRequest.equals("22B002")) {
|
if (commandRequest.equals("22B002")) {
|
||||||
params.odoKm = float(strtol(responseRowMerged.substring(18, 24).c_str(), 0, 16));
|
params.odoKm = float(strtol(responseRowMerged.substring(18, 24).c_str(), 0, 16));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Aircon 7b3
|
// Aircon 7b3
|
||||||
|
if (currentAtshRequest.equals("ATSH7B3")) {
|
||||||
if (commandRequest.equals("220100")) {
|
if (commandRequest.equals("220100")) {
|
||||||
params.indoorTemperature = (hexToDec(responseRowMerged.substring(16, 18).c_str(), 1, false) / 2) - 40;
|
params.indoorTemperature = (hexToDec(responseRowMerged.substring(16, 18).c_str(), 1, false) / 2) - 40;
|
||||||
params.outdoorTemperature = (hexToDec(responseRowMerged.substring(18, 20).c_str(), 1, false) / 2) - 40;
|
params.outdoorTemperature = (hexToDec(responseRowMerged.substring(18, 20).c_str(), 1, false) / 2) - 40;
|
||||||
}
|
}
|
||||||
// Aircon 7b3
|
|
||||||
if (commandRequest.equals("220102") && responseRowMerged.substring(12, 14) == "00") {
|
if (commandRequest.equals("220102") && responseRowMerged.substring(12, 14) == "00") {
|
||||||
params.coolantTemp1C = (hexToDec(responseRowMerged.substring(14, 16).c_str(), 1, false) / 2) - 40;
|
params.coolantTemp1C = (hexToDec(responseRowMerged.substring(14, 16).c_str(), 1, false) / 2) - 40;
|
||||||
params.coolantTemp2C = (hexToDec(responseRowMerged.substring(16, 18).c_str(), 1, false) / 2) - 40;
|
params.coolantTemp2C = (hexToDec(responseRowMerged.substring(16, 18).c_str(), 1, false) / 2) - 40;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// BMS 7e4
|
// BMS 7e4
|
||||||
|
if (currentAtshRequest.equals("ATSH7E4")) {
|
||||||
if (commandRequest.equals("220101")) {
|
if (commandRequest.equals("220101")) {
|
||||||
params.cumulativeEnergyChargedKWh = float(strtol(responseRowMerged.substring(82, 90).c_str(), 0, 16)) / 10.0;
|
params.cumulativeEnergyChargedKWh = float(strtol(responseRowMerged.substring(82, 90).c_str(), 0, 16)) / 10.0;
|
||||||
if (params.cumulativeEnergyChargedKWhStart == -1)
|
if (params.cumulativeEnergyChargedKWhStart == -1)
|
||||||
@@ -188,7 +197,10 @@ bool parseRowMergedKiaENiro() {
|
|||||||
if (commandRequest.equals("220106")) {
|
if (commandRequest.equals("220106")) {
|
||||||
params.coolingWaterTempC = hexToDec(responseRowMerged.substring(14, 16).c_str(), 1, false);
|
params.coolingWaterTempC = hexToDec(responseRowMerged.substring(14, 16).c_str(), 1, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TPMS 7a0
|
// TPMS 7a0
|
||||||
|
if (currentAtshRequest.equals("ATSH7A0")) {
|
||||||
if (commandRequest.equals("22c00b")) {
|
if (commandRequest.equals("22c00b")) {
|
||||||
params.tireFrontLeftPressureBar = hexToDec(responseRowMerged.substring(14, 16).c_str(), 2, false) / 72.51886900361; // === OK Valid *0.2 / 14.503773800722
|
params.tireFrontLeftPressureBar = hexToDec(responseRowMerged.substring(14, 16).c_str(), 2, false) / 72.51886900361; // === OK Valid *0.2 / 14.503773800722
|
||||||
params.tireFrontRightPressureBar = hexToDec(responseRowMerged.substring(22, 24).c_str(), 2, false) / 72.51886900361; // === OK Valid *0.2 / 14.503773800722
|
params.tireFrontRightPressureBar = hexToDec(responseRowMerged.substring(22, 24).c_str(), 2, false) / 72.51886900361; // === OK Valid *0.2 / 14.503773800722
|
||||||
@@ -199,79 +211,81 @@ bool parseRowMergedKiaENiro() {
|
|||||||
params.tireRearRightTempC = hexToDec(responseRowMerged.substring(32, 34).c_str(), 2, false) - 50; // === OK Valid
|
params.tireRearRightTempC = hexToDec(responseRowMerged.substring(32, 34).c_str(), 2, false) - 50; // === OK Valid
|
||||||
params.tireRearLeftTempC = hexToDec(responseRowMerged.substring(40, 42).c_str(), 2, false) - 50; // === OK Valid
|
params.tireRearLeftTempC = hexToDec(responseRowMerged.substring(40, 42).c_str(), 2, false) - 50; // === OK Valid
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test data
|
Test data
|
||||||
*/
|
*/
|
||||||
bool testDataKiaENiro() {
|
bool testDataKiaENiro() {
|
||||||
|
|
||||||
|
// VMCU ATSH7E2
|
||||||
|
currentAtshRequest = "ATSH7E2";
|
||||||
// 2101
|
// 2101
|
||||||
commandRequest = "2101";
|
commandRequest = "2101";
|
||||||
responseRowMerged = "6101FFF8000009285A3B0648030000B4179D763404080805000000";
|
responseRowMerged = "6101FFF8000009285A3B0648030000B4179D763404080805000000";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
// 2102
|
// 2102
|
||||||
commandRequest = "2102";
|
commandRequest = "2102";
|
||||||
responseRowMerged = "6102F8FFFC000101000000840FBF83BD33270680953033757F59291C76000001010100000007000000";
|
responseRowMerged = "6102F8FFFC000101000000840FBF83BD33270680953033757F59291C76000001010100000007000000";
|
||||||
responseRowMerged = "6102F8FFFC000101000000931CC77F4C39040BE09BA7385D8158832175000001010100000007000000";
|
responseRowMerged = "6102F8FFFC000101000000931CC77F4C39040BE09BA7385D8158832175000001010100000007000000";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
|
// "ATSH7DF",
|
||||||
|
currentAtshRequest = "ATSH7DF";
|
||||||
// 2106
|
// 2106
|
||||||
commandRequest = "2106";
|
commandRequest = "2106";
|
||||||
responseRowMerged = "6106FFFF800000000000000200001B001C001C000600060006000E000000010000000000000000013D013D013E013E00";
|
responseRowMerged = "6106FFFF800000000000000200001B001C001C000600060006000E000000010000000000000000013D013D013E013E00";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
|
// AIRCON / ACU ATSH7B3
|
||||||
|
currentAtshRequest = "ATSH7B3";
|
||||||
// 220100
|
// 220100
|
||||||
commandRequest = "220100";
|
commandRequest = "220100";
|
||||||
responseRowMerged = "6201007E5027C8FF7F765D05B95AFFFF5AFF11FFFFFFFFFFFF6AFFFF2DF0757630FFFF00FFFF000000";
|
responseRowMerged = "6201007E5027C8FF7F765D05B95AFFFF5AFF11FFFFFFFFFFFF6AFFFF2DF0757630FFFF00FFFF000000";
|
||||||
responseRowMerged = "6201007E5027C8FF867C58121010FFFF10FF8EFFFFFFFFFFFF10FFFF0DF0617900FFFF01FFFF000000";
|
responseRowMerged = "6201007E5027C8FF867C58121010FFFF10FF8EFFFFFFFFFFFF10FFFF0DF0617900FFFF01FFFF000000";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
|
// BMS ATSH7E4
|
||||||
|
currentAtshRequest = "ATSH7E4";
|
||||||
// 220101
|
// 220101
|
||||||
commandRequest = "220101";
|
commandRequest = "220101";
|
||||||
responseRowMerged = "620101FFF7E7FF99000000000300B10EFE120F11100F12000018C438C30B00008400003864000035850000153A00001374000647010D017F0BDA0BDA03E8";
|
responseRowMerged = "620101FFF7E7FF99000000000300B10EFE120F11100F12000018C438C30B00008400003864000035850000153A00001374000647010D017F0BDA0BDA03E8";
|
||||||
responseRowMerged = "620101FFF7E7FFB3000000000300120F9B111011101011000014CC38CB3B00009100003A510000367C000015FB000013D3000690250D018E0000000003E8";
|
responseRowMerged = "620101FFF7E7FFB3000000000300120F9B111011101011000014CC38CB3B00009100003A510000367C000015FB000013D3000690250D018E0000000003E8";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
// 220102
|
// 220102
|
||||||
commandRequest = "220102";
|
commandRequest = "220102";
|
||||||
responseRowMerged = "620102FFFFFFFFCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBAAAA";
|
responseRowMerged = "620102FFFFFFFFCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBAAAA";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
// 220103
|
// 220103
|
||||||
commandRequest = "220103";
|
commandRequest = "220103";
|
||||||
responseRowMerged = "620103FFFFFFFFCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCACBCACACFCCCBCBCBCBCBCBCBCBAAAA";
|
responseRowMerged = "620103FFFFFFFFCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCACBCACACFCCCBCBCBCBCBCBCBCBAAAA";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
// 220104
|
// 220104
|
||||||
commandRequest = "220104";
|
commandRequest = "220104";
|
||||||
responseRowMerged = "620104FFFFFFFFCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBAAAA";
|
responseRowMerged = "620104FFFFFFFFCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBAAAA";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
// 220105
|
// 220105
|
||||||
commandRequest = "220105";
|
commandRequest = "220105";
|
||||||
responseRowMerged = "620105003fff9000000000000000000F8A86012B4946500101500DAC03E800000000AC0000C7C701000F00000000AAAA";
|
responseRowMerged = "620105003fff9000000000000000000F8A86012B4946500101500DAC03E800000000AC0000C7C701000F00000000AAAA";
|
||||||
responseRowMerged = "620105003FFF90000000000000000014918E012927465000015013BB03E800000000BB0000CBCB01001300000000AAAA";
|
responseRowMerged = "620105003FFF90000000000000000014918E012927465000015013BB03E800000000BB0000CBCB01001300000000AAAA";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
// 220106
|
// 220106
|
||||||
commandRequest = "220106";
|
commandRequest = "220106";
|
||||||
responseRowMerged = "620106FFFFFFFF14001A00240000003A7C86B4B30000000928EA00";
|
responseRowMerged = "620106FFFFFFFF14001A00240000003A7C86B4B30000000928EA00";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
// 22c002
|
// BCM / TPMS ATSH7A0
|
||||||
commandRequest = "22c002";
|
currentAtshRequest = "ATSH7A0";
|
||||||
responseRowMerged = "62C002FFFF0000D2E84E93D2E84EBBD2DBDACBD2E149F3AAAAAAAA";
|
|
||||||
parseRowMergedKiaENiro();
|
|
||||||
|
|
||||||
// 22c00b
|
// 22c00b
|
||||||
commandRequest = "22c00b";
|
commandRequest = "22c00b";
|
||||||
responseRowMerged = "62C00BFFFF0000B93D0100B43E0100B43D0100BB3C0100AAAAAAAA";
|
responseRowMerged = "62C00BFFFF0000B93D0100B43E0100B43D0100BB3C0100AAAAAAAA";
|
||||||
parseRowMergedKiaENiro();
|
parseRowMergedKiaENiro();
|
||||||
|
|
||||||
|
// ATSH7C6
|
||||||
|
currentAtshRequest = "ATSH7C6";
|
||||||
// 22b002
|
// 22b002
|
||||||
commandRequest = "22b002";
|
commandRequest = "22b002";
|
||||||
responseRowMerged = "62B002E0000000FFB400330B0000000000000000";
|
responseRowMerged = "62B002E0000000FFB400330B0000000000000000";
|
||||||
@@ -281,10 +295,6 @@ bool testDataKiaENiro() {
|
|||||||
params.batModule02TempC = 29;
|
params.batModule02TempC = 29;
|
||||||
params.batModule03TempC = 28;
|
params.batModule03TempC = 28;
|
||||||
params.batModule04TempC = 30;
|
params.batModule04TempC = 30;
|
||||||
//params.batTempC = hexToDec(responseRowMerged.substring(36, 38).c_str(), 1, true);
|
|
||||||
//params.batMaxC = hexToDec(responseRowMerged.substring(34, 36).c_str(), 1, true);
|
|
||||||
//params.batMinC = hexToDec(responseRowMerged.substring(36, 38).c_str(), 1, true);
|
|
||||||
|
|
||||||
// This is more accurate than min/max from BMS. It's required to detect kona/eniro cold gates (min 15C is needed > 43kW charging, min 25C is needed > 58kW charging)
|
// This is more accurate than min/max from BMS. It's required to detect kona/eniro cold gates (min 15C is needed > 43kW charging, min 25C is needed > 58kW charging)
|
||||||
params.batMinC = params.batMaxC = params.batModule01TempC;
|
params.batMinC = params.batMaxC = params.batModule01TempC;
|
||||||
params.batMinC = (params.batModule02TempC < params.batMinC) ? params.batModule02TempC : params.batMinC ;
|
params.batMinC = (params.batModule02TempC < params.batMinC) ? params.batModule02TempC : params.batMinC ;
|
||||||
|
|||||||
@@ -1118,6 +1118,10 @@ bool doNextAtCommand() {
|
|||||||
|
|
||||||
// Send AT command to obd
|
// Send AT command to obd
|
||||||
commandRequest = commandQueue[commandQueueIndex];
|
commandRequest = commandQueue[commandQueueIndex];
|
||||||
|
if (commandRequest.startsWith("ATSH")) {
|
||||||
|
currentAtshRequest = commandRequest;
|
||||||
|
}
|
||||||
|
|
||||||
Serial.print(">>> ");
|
Serial.print(">>> ");
|
||||||
Serial.println(commandRequest);
|
Serial.println(commandRequest);
|
||||||
String tmpStr = commandRequest + "\r";
|
String tmpStr = commandRequest + "\r";
|
||||||
|
|||||||
1
struct.h
1
struct.h
@@ -14,6 +14,7 @@ String responseRowMerged;
|
|||||||
byte commandQueueIndex;
|
byte commandQueueIndex;
|
||||||
bool canSendNextAtCommand = false;
|
bool canSendNextAtCommand = false;
|
||||||
String commandRequest = "";
|
String commandRequest = "";
|
||||||
|
String currentAtshRequest = "";
|
||||||
|
|
||||||
// Structure with realtime values
|
// Structure with realtime values
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user