Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Initialization of obd adapter

I am developing a android application which reads Obd data from vehicle's Obd adapter via bluetooth... I am facing issue while initializing the adapter. I have sent following Obd commands in sequence to initialize the obd :

  1. atz (received OK)
  2. atsp0 (Received OK)
  3. ate0 (Received OK)
  4. 0100 (This is the part where issue occurs)...

Some times for this command i receive BUSINIT:ERROR.. And after that for every vehicle command (except AT commands) same error is repeated..

I want to know the Exact initialization sequence ?

like image 761
user1885618 Avatar asked Dec 21 '22 12:12

user1885618


1 Answers

It seems your obd initialization and obd protocol selection failed. You should follow these steps:

AT D
AT Z
AT E0
AT L0
AT S0
AT H0
AT SP 0

When protocol selection command response without any error like listed below, your connection is OK and you can request new commands like '0100' command.


Errors:

  • UNABLE TO CONNECT
  • BUS INIT... ERROR
  • ?
  • NO DATA
  • STOPPED
  • ERROR

Command Explanation:

AT D -> Set all to defaults

AT Z -> Reset Obd

AT E0 -> Echo off

AT L0 -> Line feed off

AT S0 -> Spaces off

AT H0 -> Headers off

AT SP 0 -> Set Protocol to 0 "Auto", search all protocols and connect it with proper protocol for that obd

For AT SP command, if you know your vehicle's obd interface protocol, you can choose that specific protocol other than make Auto and search all possible protocols. You can use different inputs:


Protocol Parameters: Hex[0,1,2, ... ,B,C]

Auto select protocol and save. AUTO -> 0

41.6 kbaud SAE_J1850_PWM -> 1

10.4 kbaud SAE_J1850_VPW -> 2

5 baud init ISO_9141_2 -> 3

5 baud init ISO_14230_4_KWP -> 4

Fast init ISO_14230_4_KWP_FAST -> 5

11 bit ID, 500 kbaud ISO_15765_4_CAN -> 6

29 bit ID, 500 kbaud ISO_15765_4_CAN_B -> 7

11 bit ID, 250 kbaud ISO_15765_4_CAN_C -> 8

29 bit ID, 250 kbaud ISO_15765_4_CAN_D -> 9

29 bit ID, 250 kbaud (user adjustable) SAE_J1939_CAN -> A

11 bit ID (user adjustable), 125 kbaud (user adjustable) USER1_CAN -> B

11 bit ID (user adjustable), 50 kbaud (user adjustable) USER2_CAN -> C

like image 140
Fatih Aksu Avatar answered Jan 02 '23 05:01

Fatih Aksu