User Tools

Site Tools


doc:tools_oobdcmd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
doc:tools_oobdcmd [2014/05/25 10:11]
admin created
doc:tools_oobdcmd [2014/06/13 10:34]
admin [Installation]
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
-  ​* Download and install Python from one of it's [[https://​www.python.org/​download/​|Download Servers]] + 
-  * goto the [[https://​oobd.googlecode.com/​svn/​trunk/​tools/​OOBDcmd/​oobdcmd.py|OOBDcmd source code]] + 
-  * in your browser, choose "Save as..." and save the source code as "​oobdcmd.py"​ in a directory of your choise+    ​* Download and install Python from one of it's [[https://​www.python.org/​download/​|Download Servers]] ​\\ For example https://​www.python.org/​ftp/​python/​3.4.1/​python-3.4.1.msi 
 +    * For windows, install also the PyBluez driver *after* installing python first: http://​www.lfd.uci.edu/​~gohlke/​pythonlibs/#​pybluez PyBluez-0.20.win32-py3.4.exe 
 +    * goto the [[https://​oobd.googlecode.com/​svn/​trunk/​tools/​OOBDcmd/​oobdcmd.py|OOBDcmd source code]] 
 +    * in your browser, choose "Save as" and save the source code as "​oobdcmd.py"​ in a directory of your choise
  
 ===== Usage ===== ===== Usage =====
  
-As OOBDcmd is a command line tool, it needs to be started from a [[http://​www.computerhope.com/​issues/​chdos.htm|Command Prompt]]. If you don't know what this is, you won't need OOBDcmd at all...+ 
 +As OOBDcmd is a command line tool, it needs to be started from a [[http://​www.computerhope.com/​issues/​chdos.htm|Command Prompt]]. If you don't know what this is, you won't need OOBDcmd at all… 
  
 Make sure the python interpreter is in your search path for executable programs. In case of problems please follow the [[https://​docs.python.org/​3/​|Python documentation]]. Make sure the python interpreter is in your search path for executable programs. In case of problems please follow the [[https://​docs.python.org/​3/​|Python documentation]].
  
  
-  ​* Open the Command Prompt +    ​* Open the Command Prompt 
-  * "​cd"​ to the directory in which you've saved the oobdcmd.py script+    * "​cd"​ to the directory in which you've saved the oobdcmd.py script 
  
 Now you can call the script Now you can call the script
 +
  
 <​code>​ <​code>​
Line 34: Line 43:
 for detailed information goto http://​www.oobd.org/​doku.php?​id=doc:​tools_oobdcmd for detailed information goto http://​www.oobd.org/​doku.php?​id=doc:​tools_oobdcmd
 </​code>​ </​code>​
 +
  
 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://​www.oobd.org/​doku.php?​id=doc:​hw_commands|OOBD firmware syntax]]. Please do not forget to end the input command with a trailing "​\r"​+ 
 +The OOBD input line cmd is explained in the [[http://​www.oobd.org/​doku.php?​id=doc:​hw_commands|OOBD firmware syntax]]. Please do not forget to end the input command with a trailing "%%\%%r" 
  
 The regex format is explained in the [[http://​www.pythonforbeginners.com/​systems-programming/​regular-expressions-in-python/​|Python regex tutorial]] The regex format is explained in the [[http://​www.pythonforbeginners.com/​systems-programming/​regular-expressions-in-python/​|Python regex tutorial]]
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
 </​code>​ </​code>​
 +
  
 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
 </​code>​ </​code>​
- 
- 
  
  
 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
 </​code>​ </​code>​
 +
  
 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:​12:​6F:​2B:​F0:​84 'p 8 2 0\r|\.,p 8 3 0\r|\.,p 8 2 3\r|\.,p 6 5 $620\r|\.,p 8 10 1 $7FE\r|\.,p 8 11 1 $0000\r|\.,​32F106\r|^(62)'​ python3.4 oobdcmd.py 00:​12:​6F:​2B:​F0:​84 'p 8 2 0\r|\.,p 8 3 0\r|\.,p 8 2 3\r|\.,p 6 5 $620\r|\.,p 8 10 1 $7FE\r|\.,p 8 11 1 $0000\r|\.,​32F106\r|^(62)'​
- +  
 + 
 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