You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Async Connections.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
# Async Connections
2
+
1
3
Since the standard `query()` function is blocking, it can be a hazard for UI event loops. To deal with this, python-OBD has an `Async` connection object that can be used in place of the standard `OBD` object. `Async` is a subclass of `OBD`, and therefore inherits all of the standard methods. However, `Async` adds a few in order to control a threaded update loop. This loop will keep the values of your commands up to date with the vehicle. This way, when the user `query`s the car, the latest response is returned immediately.
2
4
3
5
The update loop is controlled by calling `start()` and `stop()`. To subscribe a command for updating, call `watch()` with your requested OBDCommand. Because the update loop is threaded, commands can only be `watch`ed while the loop is `stop`ed.
Copy file name to clipboardExpand all lines: docs/Command Lookup.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
# Command Lookup
2
+
1
3
`OBDCommand`s are objects used to query information from the vehicle. They contain all of the information neccessary to perform the query, and decode the cars response. Python-OBD has [built in tables](Command Tables.md) for the most common commands. They can be looked up by name, or by mode & PID.
Mode 02 commands are the same as mode 01, but are metrics from when the last DTC occurred (the freeze frame). To access them by name, simple prepend `DTC_` to the Mode 01 command name.
116
118
@@ -124,7 +126,7 @@ obd.commands.DTC_RPM # the Mode 02 command
124
126
125
127
<br>
126
128
127
-
# Mode 03
129
+
##Mode 03
128
130
129
131
Mode 03 contains a single command `GET_DTC` which requests all diagnostic trouble codes from the vehicle. The response will contain the codes themselves, as well as a description (if python-OBD has one). See the [DTC Responses](Responses.md#diagnostic-trouble-codes-dtcs) section for more details.
130
132
@@ -135,15 +137,15 @@ Mode 03 contains a single command `GET_DTC` which requests all diagnostic troubl
| N/A | CLEAR_DTC | Clear DTCs and Freeze data | N/A |
143
145
144
146
<br>
145
147
146
-
# Mode 06
148
+
##Mode 06
147
149
148
150
<spanstyle="color:red">*WARNING: mode 06 is experimental. While it passes software tests, it has not been tested on a real vehicle. Any debug output for this mode would be greatly appreciated.*</span>
149
151
@@ -252,7 +254,7 @@ Mode 06 commands are used to monitor various test results from the vehicle. All
252
254
253
255
<br>
254
256
255
-
# Mode 07
257
+
##Mode 07
256
258
257
259
The return value will be encoded in the same structure as the Mode 03 `GET_DTC` command.
258
260
@@ -262,7 +264,7 @@ The return value will be encoded in the same structure as the Mode 03 `GET_DTC`
262
264
263
265
<br>
264
266
265
-
# Mode 09
267
+
##Mode 09
266
268
267
269
<spanstyle="color:red">*WARNING: mode 09 is experimental. While it has been tested on a hardware simulator, only a subset of the supported
268
270
commands have (00-06) been tested. Any debug output for this mode, especially for the untested PIDs, would be greatly appreciated.*</span>
Copy file name to clipboardExpand all lines: docs/Connections.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
# Connections
1
2
2
3
After installing the library, simply `import obd`, and create a new OBD connection object. By default, python-OBD will scan for Bluetooth and USB serial ports (in that order), and will pick the first connection it finds. The port can also be specified manually by passing a connection string to the OBD constructor. You can also use the `scan_serial` helper retrieve a list of connected ports.
Copy file name to clipboardExpand all lines: docs/Custom Commands.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
# Custom Commands
1
2
2
3
If the command you need is not in python-OBDs tables, you can create a new `OBDCommand` object. The constructor accepts the following arguments (each will become a property).
3
4
@@ -13,8 +14,7 @@ If the command you need is not in python-OBDs tables, you can create a new `OBDC
13
14
| header (optional) | string | If set, use a custom header instead of the default one (7E0) |
14
15
15
16
16
-
Example
17
-
-------
17
+
## Example
18
18
19
19
```python
20
20
from obd import OBDCommand, Unit
@@ -58,7 +58,7 @@ Here are some details on the less intuitive fields of an OBDCommand:
58
58
59
59
---
60
60
61
-
###OBDCommand.decoder
61
+
## OBDCommand.decoder
62
62
63
63
The `decoder` argument is a function of following form.
64
64
@@ -83,7 +83,7 @@ def <name>(messages):
83
83
84
84
---
85
85
86
-
###OBDCommand.ecu
86
+
## OBDCommand.ecu
87
87
88
88
The `ecu` argument is a constant used to filter incoming messages. Some commands may listen to multiple ECUs (such as DTC decoders), where others may only be concerned with the engine (such as RPM). Currently, python-OBD can only distinguish the engine, but this list may be expanded over time:
89
89
@@ -94,13 +94,13 @@ The `ecu` argument is a constant used to filter incoming messages. Some commands
94
94
95
95
---
96
96
97
-
###OBDCommand.fast
97
+
## OBDCommand.fast
98
98
99
99
The optional `fast` argument tells python-OBD whether it is safe to append a `"01"` to the end of the command. This will instruct the adapter to return the first response it recieves, rather than waiting for more (and eventually reaching a timeout). This can speed up requests significantly, and is enabled for most of python-OBDs internal commands. However, for unusual commands, it is safest to leave this disabled.
100
100
101
101
---
102
102
103
-
###OBDCommand.header
103
+
## OBDCommand.header
104
104
105
105
The optional `header` argument tells python-OBD to use a custom header when querying the command. If not set, python-OBD assumes that the default 7E0 header is needed for querying the command. The switch between default and custom header (and vice versa) is automatically done by python-OBD.
Copy file name to clipboardExpand all lines: docs/Debug.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
# Debug
2
+
1
3
python-OBD uses python's builtin logging system. By default, it is setup to send output to `stderr` with a level of WARNING. The module's logger can be accessed via the `logger` variable at the root of the module. For instance, to enable console printing of all debug messages, use the following snippet:
Copy file name to clipboardExpand all lines: docs/Responses.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
# Responses
2
+
1
3
The `query()` function returns `OBDResponse` objects. These objects have the following properties:
2
4
3
5
| Property | Description |
@@ -11,7 +13,7 @@ The `query()` function returns `OBDResponse` objects. These objects have the fol
11
13
12
14
---
13
15
14
-
###is_null()
16
+
## is_null()
15
17
16
18
Use this function to check if a response is empty. Python-OBD will emit empty responses when it is unable to retrieve data from the car.
17
19
@@ -25,7 +27,7 @@ if not r.is_null():
25
27
---
26
28
27
29
28
-
# Pint Values
30
+
##Pint Values
29
31
30
32
The `value` property typically contains a [Pint](http://pint.readthedocs.io/en/latest/)`Quantity` object, but can also hold complex structures (depending on the request). Pint quantities combine a value and unit into a single class, and are used to represent physical values such as "4 seconds", and "88 mph". This allows for consistency when doing math and unit conversions. Pint maintains a registry of units, which is exposed in python-OBD as `obd.Unit`.
31
33
@@ -71,7 +73,7 @@ import obd
71
73
72
74
---
73
75
74
-
# Status
76
+
##Status
75
77
76
78
The status command returns information about the Malfunction Indicator Light (check-engine light), the number of trouble codes being thrown, and the type of engine.
77
79
@@ -111,7 +113,7 @@ Here are all of the tests names that python-OBD reports:
111
113
112
114
---
113
115
114
-
# Diagnostic Trouble Codes (DTCs)
116
+
##Diagnostic Trouble Codes (DTCs)
115
117
116
118
Each DTC is represented by a tuple containing the DTC code, and a description (if python-OBD has one). For commands that return multiple DTCs, a list is used.
117
119
@@ -129,7 +131,7 @@ response.value = ("P0104", "Mass or Volume Air Flow Circuit Intermittent")
129
131
130
132
---
131
133
132
-
# Fuel Status
134
+
##Fuel Status
133
135
134
136
The fuel status is a tuple of two strings, telling the status of the first and second fuel systems. Most cars only have one system, so the second element will likely be an empty string. The possible fuel statuses are:
135
137
@@ -144,7 +146,7 @@ The fuel status is a tuple of two strings, telling the status of the first and s
144
146
145
147
---
146
148
147
-
# Air Status
149
+
##Air Status
148
150
149
151
The air status will be one of these strings:
150
152
@@ -157,7 +159,7 @@ The air status will be one of these strings:
157
159
158
160
---
159
161
160
-
# Oxygen Sensors Present
162
+
##Oxygen Sensors Present
161
163
162
164
Returns a 2D structure of tuples (representing bank and sensor number), that holds boolean values for sensor presence.
163
165
@@ -183,7 +185,7 @@ response.value[1][2] == True # Bank 1, Sensor 2 is present
183
185
```
184
186
---
185
187
186
-
# Monitors (Mode 06 Responses)
188
+
##Monitors (Mode 06 Responses)
187
189
188
190
All mode 06 commands return `Monitor` objects holding various test results for the requested sensor. A single monitor response can hold multiple tests, in the form of `MonitorTest` objects. The OBD standard defines some tests, but vehicles can always implement custom tests beyond the standard. Here are the standard Test IDs (TIDs) that python-OBD will recognize:
Copy file name to clipboardExpand all lines: docs/Troubleshooting.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,3 @@
1
-
2
1
# Debug Output
3
2
4
3
If python-OBD is not working properly, the first thing you should do is enable debug output. Add the following line before your connection code to print all of the debug information to your console:
@@ -52,7 +51,7 @@ Here are some common logs from python-OBD, and their meanings:
0 commit comments