11# obd-parser-cli
22
3- A CLI tool that can interface with On Board Diagnostics (OBD) of vehicles.
3+ A CLI tool that can interface with On Board Diagnostics (OBD II ) of vehicles.
44
5- ## Testing
5+ ## Compatibility and Testing
66This software has only been tested with a Volkswagen MK6 GTI. Your success in
77using this software with your vehicle might vary.
88
@@ -57,29 +57,35 @@ the help menu:
5757```
5858$ obd --help
5959
60- 🚔 OBD CLI 🚘
60+ 🚔 OBD CLI 🚘
6161
6262 Usage: index [options] [command]
6363
6464
6565 Commands:
6666
67- list list supported pids that can be passed to "poll" commands
68- poll <pid> [pids...] poll for an OBD value(s) specified by <pid> or a list of pids
67+ list list supported pids that can be passed to "poll" commands
68+ poll <pid> [pids...] poll for an OBD value(s) specified by <pid> or a list of pids
69+ monitor <pid:interval> [pid:interval...] similar to poll, but continously checks PID values every n milliseconds,
70+ e.g 0C:1000 will get RPM every 1000 milliseconds
6971
7072 Options:
7173
7274 -h, --help output usage information
7375 -V, --version output the version number
7476 -c, --connection <string> type of connection, valid options are "fake" or "serial"
7577 -b, --baudrate <number> control connection baudrate, e.g 38400
78+ -o, --outdir <string> loation to create folder containing monitor results
7679 -i, --interface <name> the interface to use for connection, e.g /dev/tty.serialusb
7780```
7881
7982### Listing PIDs (list)
8083
81- Use the list command to view PIDs that can be read from vehicles. Currently only
82- a handful are supported. Here's how you can view them:
84+ Use the list command to view PIDs that can be read from vehicles. Currently
85+ only a handful are supported by this module and certain vehicles will not
86+ support all PIDS either.
87+
88+ Here's how you can view them:
8389
8490```
8591$ obd list
@@ -92,6 +98,15 @@ Available PIDs for "poll" commands are:
92980C - Engine RPM
939905 - Engine Coolant Temperature
941000D - Vehicle Speed
101+ 04 - Calculated Engine Load
102+ 0A - Fuel Pressure
103+ 0B - Intake Manifold Absolute Pressure
104+ 0F - Intake Air Temperature
105+ 10 - MAF Air Flow Rate
106+ 11 - Throttle Position
107+ 1C - OBD Standard
108+ 03 - Fuel System Status
109+ 20 - Supported PIDs
95110
96111Example command usage: "obd poll 2F"
97112
@@ -128,7 +143,7 @@ Results:
128143
129144The above example uses the "fake" connection type and therefore returns
130145randomised values for the PIDs you requested. If you'd like to connect via
131- a serial conncetion you can try the following (macOS) example:
146+ a serial conncetion you can try the following (macOS tested ) example:
132147
133148```
134149$ obd poll -c serial -b 38400 -i /dev/tty.serialusb "Engine RPM"
@@ -143,4 +158,49 @@ Results:
143158┌────────────┬────────┐
144159│ Engine RPM │ 835.50 │
145160└────────────┴────────┘
161+ ```
162+
163+ ### Monitor
164+
165+ The monitor command is similar to poll, but instead it prints lines of JSON
166+ continuously until the process is killed. You can use the ` --output ` option
167+ to specify a directory to write JSON files to that will contain this data.
168+ This creates a folder in the specified ` output ` directory with the current
169+ date, and then writes the JSON to folders that represent each trip taken.
170+ Inside each folder a JSON file is created. The name of the file will be
171+ 0.json by default. Once this file reaches ~ 128KB in size a new file, 1.json
172+ will be created, and so on until the process is killed.
173+
174+ Here's a sample command and output data:
175+
176+ ```
177+ $ obd monitor 0d:100 0c:1000 05:5000 -c serial -i /dev/tty.usbserial -b 38400
178+
179+ 🚔 OBD CLI 🚘
180+
181+ Connecting via "fake" type...
182+ OBD module intialised...
183+
184+ {"ts":"2017-03-15T16:57:18.296Z","bytes":"410D26","value":38,"counter":715,"pretty":"38km/h","name":"Vehicle Speed","pid":"0D"}
185+ {"ts":"2017-03-15T16:57:18.318Z","bytes":"410C16CA","value":1458.5,"counter":716,"pretty":"1458.5rpm","name":"Engine RPM","pid":"0C"}
186+ {"ts":"2017-03-15T16:57:18.946Z","bytes":"410F43","value":27,"counter":717,"pretty":"27°C","name":"Intake Air Temperature","pid":"0F"}
187+ {"ts":"2017-03-15T16:57:19.295Z","bytes":"410D26","value":38,"counter":718,"pretty":"38km/h","name":"Vehicle Speed","pid":"0D"}
188+ {"ts":"2017-03-15T16:57:19.316Z","bytes":"410C1684","value":1441,"counter":719,"pretty":"1441rpm","name":"Engine RPM","pid":"0C"}
189+ {"ts":"2017-03-15T16:57:20.296Z","bytes":"410D22","value":34,"counter":720,"pretty":"34km/h","name":"Vehicle Speed","pid":"0D"}
190+ {"ts":"2017-03-15T16:57:21.235Z","bytes":"410572","value":74,"counter":722,"pretty":"74°C","name":"Engine Coolant Temperature","pid":"05"}
191+ ```
192+
193+ If using the ` --output ` option, then the created folder structure might look
194+ as follows if you had two trips in a given day:
195+
196+ ```
197+ | |____
198+ | | |____2017-03-12
199+ | | | |____2ee5ff94-a02d-4791-9cd8-8b0d9770c34f
200+ | | | | |____0.json
201+ | | | |____599d7463-c568-441d-b6f7-86ea92ea3e59
202+ | | | | |____0.json
203+ | | | | |____1.json
204+ | | | | |____2.json
205+ | | | | |____3.json
146206```
0 commit comments