doc:tools_oobdcmd
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
doc:tools_oobdcmd [2014/05/25 10:11] – created admin | doc:tools_oobdcmd [2014/06/13 10:34] (current) – [Installation] admin | ||
---|---|---|---|
Line 5: | Line 5: | ||
- | To allow this, OOBDcmd acts like a command line tool: | + | To allow this, OOBDcmd acts like a command line tool: |
At start it connects itself to a dongle by the given Bluetooth MAC address. When the connection is made, OOBDcmd checks if the bluetooth device is really a OOBD dongle. If yes, it transmits the optional given command sequence. At the end it returns an optional error code and the last received answer from the dongle. | At start it connects itself to a dongle by the given Bluetooth MAC address. When the connection is made, OOBDcmd checks if the bluetooth device is really a OOBD dongle. If yes, it transmits the optional given command sequence. At the end it returns an optional error code and the last received answer from the dongle. | ||
Line 11: | Line 12: | ||
===== Installation ===== | ===== Installation ===== | ||
+ | |||
OOBDcmd is not a program as such, it's just a python script. So it needs to have Python Version >=3.4 installed on the computer. To install | OOBDcmd is not a program as such, it's just a python script. So it needs to have Python Version >=3.4 installed on the computer. To install | ||
- | | + | |
- | * goto the [[https:// | + | |
- | * in your browser, choose "Save as..." and save the source code as " | + | |
+ | * For windows, install also the PyBluez driver *after* installing python first: http:// | ||
+ | * goto the [[https:// | ||
+ | * in your browser, choose "Save as…" and save the source code as " | ||
===== Usage ===== | ===== Usage ===== | ||
- | As OOBDcmd is a command line tool, it needs to be started from a [[http:// | + | |
+ | As OOBDcmd is a command line tool, it needs to be started from a [[http:// | ||
Make sure the python interpreter is in your search path for executable programs. In case of problems please follow the [[https:// | Make sure the python interpreter is in your search path for executable programs. In case of problems please follow the [[https:// | ||
- | | + | |
- | * " | + | * " |
Now you can call the script | Now you can call the script | ||
+ | |||
< | < | ||
Line 34: | Line 43: | ||
for detailed information goto http:// | for detailed information goto http:// | ||
</ | </ | ||
+ | |||
OOBDcmd can be called with the MAC Adress of the bluetooth dongle and optional with one or more cmdsets. | OOBDcmd can be called with the MAC Adress of the bluetooth dongle and optional with one or more cmdsets. | ||
+ | |||
When called without cmdsets, it just tests the connection and the correct answer from the dongle. | When called without cmdsets, it just tests the connection and the correct answer from the dongle. | ||
+ | |||
if successful, the returned errorcode is 0, otherways 1 (bluetooth error) or 2 (dongle identification error) | if successful, the returned errorcode is 0, otherways 1 (bluetooth error) or 2 (dongle identification error) | ||
Line 43: | Line 55: | ||
The power of OOBDcmd comes from its capability to go through a complete command sequence, the so called cmdsets. | The power of OOBDcmd comes from its capability to go through a complete command sequence, the so called cmdsets. | ||
+ | |||
===== Cmdsets: Command Sets ===== | ===== Cmdsets: Command Sets ===== | ||
- | A command sequence consists of one or more cmdsets, separated by , . The whole command sequence needs to be enclosed in ' ' | + | |
+ | A command sequence consists of one or more cmdsets, separated by , . The whole command sequence needs to be enclosed in ' ' | ||
A Command Set consist of a OOBD input line (cmd) and a regular expression (regex), seperated by a | | A Command Set consist of a OOBD input line (cmd) and a regular expression (regex), seperated by a | | ||
- | The OOBD input line cmd is explained in the [[http:// | + | |
+ | The OOBD input line cmd is explained in the [[http:// | ||
The regex format is explained in the [[http:// | The regex format is explained in the [[http:// | ||
Line 56: | Line 73: | ||
When OOBDcmd goes through the command sequence, it takes each cmdset and sends the cmd to the dongle. After receiving an answer, it compares the answer against the regex. If the regex is valid, it continues with the next cmdset. If the regex is invalid, OOBDcmd writes the received answer to stdout and finish with program exit code 3 (failure through command sequence) | When OOBDcmd goes through the command sequence, it takes each cmdset and sends the cmd to the dongle. After receiving an answer, it compares the answer against the regex. If the regex is valid, it continues with the next cmdset. If the regex is invalid, OOBDcmd writes the received answer to stdout and finish with program exit code 3 (failure through command sequence) | ||
+ | |||
If the last cmdset is successfully done, OOBDcms writes the last received answer to stdout and finishes with program exit code 0 (=no errors) | If the last cmdset is successfully done, OOBDcms writes the last received answer to stdout and finishes with program exit code 0 (=no errors) | ||
- | |||
- | |||
===== Examples ===== | ===== Examples ===== | ||
+ | |||
Here are some examples. Please note, that for confidential reason the IDs and DIDs are faked and to not show real values, so using this examples 1:1 won't work | Here are some examples. Please note, that for confidential reason the IDs and DIDs are faked and to not show real values, so using this examples 1:1 won't work | ||
+ | |||
Reading the Dongle firmware version string | Reading the Dongle firmware version string | ||
+ | |||
<code bash> | <code bash> | ||
Line 73: | Line 92: | ||
0 | 0 | ||
</ | </ | ||
+ | |||
again the firmware version string, but now with a non matching regex, which creates a error code | again the firmware version string, but now with a non matching regex, which creates a error code | ||
Line 85: | Line 105: | ||
Write a result in a file | Write a result in a file | ||
+ | |||
<code bash> | <code bash> | ||
Line 93: | Line 114: | ||
OOBD D2a 715 Lux-Wolf CAN-Invader Fri, 15 Nov 2013 17:37:58 +0100 | OOBD D2a 715 Lux-Wolf CAN-Invader Fri, 15 Nov 2013 17:37:58 +0100 | ||
</ | </ | ||
- | |||
- | |||
Now something more exiting: Selecting the High- speed bus, configure it, set the filters and and module ids and test via tester present, if the module is there | Now something more exiting: Selecting the High- speed bus, configure it, set the filters and and module ids and test via tester present, if the module is there | ||
+ | |||
<code bash> | <code bash> | ||
Line 104: | Line 124: | ||
0 | 0 | ||
</ | </ | ||
+ | |||
And now full size: Initialize and request the vehicle configuration | And now full size: Initialize and request the vehicle configuration | ||
+ | |||
<code bash> | <code bash> | ||
python3.4 oobdcmd.py 00: | python3.4 oobdcmd.py 00: | ||
- | + | ||
+ | |||
62f106fccc04020100600204011101080100000001000200000201020200040200000100010100000000000200000307010000010000000000000000000302000101020100030102001366310002010400000100000100010001000202000000000100000100000000000000000704000200010000020001000100000000000000000000000000000000000002000000000300040001000000020000000000000001000000000000000000000000020003000000000000000000000000000002000001000100000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e | 62f106fccc04020100600204011101080100000001000200000201020200040200000100010100000000000200000307010000010000000000000000000302000101020100030102001366310002010400000100000100010001000202000000000100000100000000000000000704000200010000020001000100000000000000000000000000000000000002000000000300040001000000020000000000000001000000000000000000000000020003000000000000000000000000000002000001000100000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e | ||
>echo $? # get program exit code | >echo $? # get program exit code | ||
Line 118: | Line 140: | ||
===== Input / Output ===== | ===== Input / Output ===== | ||
- | All status informations are written to stderr, the last received answer is written to stdout (multiple lines are concated into one single line, the trailing .\r> sequence is truncated), also OBBDcmd returns a proper program exit code | + | |
+ | |||
+ | All status informations are written to stderr, the last received answer is written to stdout (multiple lines are concated into one single line, the trailing .%%\%%r> sequence is truncated), also OBBDcmd returns a proper program exit code |
doc/tools_oobdcmd.txt · Last modified: 2014/06/13 10:34 by admin