Command reference¶
This is the complete list of what obd-diag may send to the adapter, with page and verbatim quote from the ELM327 datasheet (ELM327DSJ, firmware v2.1; page numbers according to the footer “N of 94”). Everything else is rejected before sending (Safety concept).
The tables are generated from tests/fixtures/command_spec.yaml when the
documentation is built. The tests check the same file against the allowlist in the
code (tests/verification/test_command_spec.py, exhaustively over all hex commands)
and against every command sent in any test. So the list here can deviate neither from
the code nor from the tests.
Commands are written as they appear on the line: upper case, no spaces, followed by a
CR. Regular expressions (01[0-9A-F]{2}) stand for a group of commands, e.g. 010C.
Allowed commands¶
Command |
Meaning |
to the vehicle |
writes |
Source |
Quote |
|---|---|---|---|---|---|
|
reset the adapter completely (as if power were switched off and on again) |
no |
no |
datasheet p. 28 |
“complete reset as if power were cycled off and then on again” |
|
echo of received characters off |
no |
no |
datasheet p. 17 |
“These commands control whether or not the characters received on the RS232 port are echoed (retransmitted) back to the host computer.” |
|
no linefeed after CR |
no |
no |
datasheet p. 20 |
“for AT L0, they will be off.” |
|
no spaces in the responses |
no |
no |
datasheet p. 24 |
“These commands control whether or not space characters are inserted in the ECU response.” |
|
hide headers in the responses |
no |
no |
datasheet p. 18 |
“These commands control whether or not the additional (header) bytes of information are shown in the responses from the vehicle.” |
|
show headers in the responses (assignment per control unit) |
no |
no |
datasheet p. 18 |
“may be of interest (especially if you receive multiple responses and wish to determine what modules they were from).” |
|
search the protocol automatically (search only starts with the next OBD request) |
no |
no |
datasheet p. 26 |
“the AT SP0 command sets the protocol to 0, but does not perform a write to EEPROM.” |
|
measure the voltage at pin 2 (battery voltage) |
no |
no |
datasheet p. 24 |
“This initiates the reading of the voltage present at pin 2” |
|
report the current protocol as text |
no |
no |
datasheet p. 17 |
“The DP command is a convenient means of asking what protocol the IC is currently set to” |
|
report the current protocol as a number |
no |
no |
datasheet p. 17 |
“it returns a number which represents the current protocol.” |
|
report the adapter’s identification and firmware version |
no |
no |
datasheet p. 18 |
“Issuing this command causes the chip to identify itself, by printing the startup product ID string” |
|
report the adapter’s device description |
no |
no |
datasheet p. 28 |
“This command displays the device description string.” |
|
show the summary of the programmable parameters (read only, since v1.1) |
no |
no |
datasheet p. 23 |
“The complete range of current Programmable Parameters are displayed with this command” |
|
read the level at the ignition input (pin 15) (since v1.4) |
no |
no |
datasheet p. 19 |
“This command reads the signal level at pin 15.” |
|
read the byte in the user memory (since v1.4) |
no |
no |
datasheet p. 24 |
“The byte value stored with the SD command is retrieved with this command.” |
|
show the activity monitor count (since v2.0) |
no |
no |
datasheet p. 12 |
“This count then represents the time since activity was last detected” |
|
Service $01: read the current value of a PID (also 00/20/40 … supported PIDs) |
yes |
no |
datasheet p. 31 |
“01 - show current data” |
|
Service $02: read the freeze frame, PID and frame number 00 |
yes |
no |
datasheet p. 31 |
“02 - show freeze frame data” |
|
Service $02 without frame number: fallback, only if 020200 is rejected |
yes |
no |
datasheet p. 31 |
“02 - show freeze frame data” |
|
Service $03: read stored trouble codes |
yes |
no |
datasheet p. 34 |
“request the actual trouble codes with a mode 03 request (there is no PID needed)” |
|
Service $07: read pending trouble codes |
yes |
no |
datasheet p. 31 |
“07 - show ‘pending’ trouble codes” |
|
Service $0A: read permanent trouble codes |
yes |
no |
datasheet p. 31 |
“0A - request permanent trouble codes” |
|
Service $09, InfoType 02: read the VIN (without response count) |
yes |
no |
datasheet p. 32 |
“It is obtained with mode 09, PID 02, and should be requested with: >09 02” |
|
Service $09, InfoType 00: supported InfoTypes 01 to 20 |
yes |
no |
datasheet p. 31 |
“09 - request vehicle information” |
|
Service $09, InfoType 04: calibration IDs (software version) per control unit |
yes |
no |
datasheet p. 43 |
“ask the vehicle for the Calibration ID (09 04)” |
|
Service $09, InfoType 06: calibration verification numbers (CVN) per control unit |
yes |
no |
datasheet p. 31 |
“09 - request vehicle information” |
|
Service $09, InfoType 08: monitoring counters (in-use performance), spark ignition |
yes |
no |
datasheet p. 31 |
“09 - request vehicle information” |
|
Service $09, InfoType 0A: name of the control unit |
yes |
no |
datasheet p. 31 |
“09 - request vehicle information” |
|
Service $09, InfoType 0B: monitoring counters (in-use performance), compression ignition |
yes |
no |
datasheet p. 31 |
“09 - request vehicle information” |
|
Service $06: self-diagnosis test results per monitor ID (00/20/… supported MIDs) |
yes |
no |
datasheet p. 31 |
“06 - test results, non-continuously monitored” |
|
Service $04: clear trouble codes, freeze frame and test results (only in |
yes |
yes |
datasheet p. 35 |
“the SAE specifies that scan tools must verify that a mode 04 is intended (‘Are you sure?’) before actually sending it to the vehicle” |
Forbidden examples¶
The allowlist rejects these commands; the tests check that none of them is ever sent.
Command |
Why forbidden |
Source |
Quote |
|---|---|---|---|
(CR only) |
a lone CR repeats the last command (after 04 that would mean clearing again) |
datasheet p. 9 |
“the ability to repeat any command (AT or OBD) when only a single carriage return character is received.” |
|
Service $08 controls components in the vehicle |
datasheet p. 31 |
“08 - special control mode” |
|
Service $08 with test ID |
datasheet p. 31 |
“08 - special control mode” |
|
wrong response count in the VIN request |
datasheet p. 32 |
“If you should mistakenly send 09 02 1, you might cause problems.” |
|
writes to the adapter’s EEPROM immediately |
datasheet p. 36 |
“The Set Protocol commands cause an immediate write to the internal EEPROM” |
|
writes 0 to the adapter’s EEPROM |
datasheet p. 26 |
“if you must write 0 to the EEPROM, use command AT SP 00” |
|
permanently changes a programmable parameter (here the baud rate) |
datasheet p. 23 |
“PP hh SV yy [ Prog. Param. hh: Set the Value to yy ]” |
|
sets the header, i.e. addresses a single control unit instead of the OBD functional address |
datasheet p. 25 |
“particularly if experimenting with physical addressing” |
|
monitors the bus, closes the current protocol |
datasheet p. 21 |
“This command places the ELM327 into a bus monitoring mode” |
|
puts the adapter into low power mode |
datasheet p. 20 |
“This command causes the ELM327 to shut off all but ‘essential services’” |
|
resets everything to defaults and can close the running session |
datasheet p. 49 |
“the ELM327 will close the current session and then change the protocol to the default one” |
|
writes a byte to the adapter’s non-volatile user memory |
datasheet p. 24 |
“The ELM327 is able to save one byte of information for you in a special nonvolatile memory location” |
|
writes the device identifier, which can only be done once |
datasheet p. 28 |
“once written to memory, they can not be changed (ie you may only use the @3 command one time)” |