This is driving me crazy. I'have tried all can procotols to retrieve custom PID 220101 and 220105 from Hyundai kona (header 7E4) and I don't receive nothing. In auto it said unable to connect.
Code: Select all
char *SendObdCommand(char *msg, unsigned int timeout)
{
static char command[32], buffer[1024];
sprintf(command, "%s\r", msg);
Serial.println(command);
obd.link->sendCommand(command, buffer, sizeof(buffer), timeout);
for (int f = 0; f < strlen(buffer); f++)
if (buffer[f] == '\r')
buffer[f] = '\n';
Serial.println(buffer);
delay(1000);
return (buffer);
}
void setup()
{
char buffer[128];
if (sys.begin())
{
pinMode(PIN_LED, OUTPUT);
digitalWrite(PIN_LED, HIGH);
delay(1000);
digitalWrite(PIN_LED, LOW);
Serial.begin(115200);
Serial.print("TYPE:");
Serial.println(sys.devType);
Serial.println("Calling obd.begin");
obd.begin(sys.link);
for (int f = 3; f < 10; f++)
{
SendObdCommand((char *)"ATZ", OBD_TIMEOUT_SHORT);
SendObdCommand((char *)"ATE0", OBD_TIMEOUT_SHORT);
SendObdCommand((char *)"ATL0", OBD_TIMEOUT_SHORT);
SendObdCommand((char *)"ATS0", OBD_TIMEOUT_SHORT);
SendObdCommand((char *)"ATH1", OBD_TIMEOUT_SHORT);
sprintf(buffer,"ATSP%X",f);
SendObdCommand((char *)buffer, OBD_TIMEOUT_SHORT);
SendObdCommand((char *)"ATSH7E4", OBD_TIMEOUT_SHORT);
SendObdCommand((char *)"220101", OBD_TIMEOUT_LONG);
SendObdCommand((char *)"ATSH7E4", OBD_TIMEOUT_SHORT);
SendObdCommand((char *)"220105", OBD_TIMEOUT_LONG);
}
}
}
Code: Select all
ATZ
ELM327 v1.5
>
ATE0
OK
>
ATL0
OK
>
ATS0
OK
>
ATH1
OK
>
ATSP3
OK
>
ATSH7E4
ERROR
>
220101
BUS
INIT:
...ERROR
>
ATSH7E4
ERROR
>
220105
BUS
INIT:
...ERROR
>
ATZ
ELM327 v1.5
>
ATE0
OK
>
ATL0
OK
>
ATS0
OK
>
ATH1
OK
>
ATSP4
OK
>
ATSH7E4
OK
>
220101
BUS
INIT:
...ERROR
>
ATSH7E4
OK
>
220105
BUS
INIT:
...ERROR
>
ATZ
ELM327 v1.5
>
ATE0
OK
>
ATL0
OK
>
ATS0
OK
>
ATH1
OK
>
ATSP5
OK
>
ATSH7E4
OK
>
220101
BUS
INIT:
...ERROR
>
ATSH7E4
OK
>
220105
BUS
INIT:
...ERROR
>
ATZ
ELM327 v1.5
>
ATE0
OK
>
ATL0
OK
>
ATS0
OK
>
ATH1
OK
>
ATSP6
OK
>
ATSH7E4
OK
>
220101
NO DATA
>
ATSH7E4
OK
>
220105
NO DATA
>
ATZ
ELM327 v1.5
>
ATE0
OK
>
ATL0
OK
>
ATS0
OK
>
ATH1
OK
>
ATSP7
OK
>
ATSH7E4
OK
>
220101
NO DATA
>
ATSH7E4
OK
>
220105
NO DATA
>
ATZ
ELM327 v1.5
>
ATE0
OK
>
ATL0
OK
>
ATS0
OK
>
ATH1
OK
>
ATSP8
OK
>
ATSH7E4
OK
>
220101
NO DATA
>
ATSH7E4
OK
>
220105
NO DATA
>
ATZ
ELM327 v1.5
>
ATE0
OK
>
ATL0
OK
>
ATS0
OK
>
ATH1
OK
>
ATSP9
OK
>
ATSH7E4
OK
>
220101
NO DATA
>
ATSH7E4
OK
>
220105
NO DATA
>
Thanks in advance.
Octavio.