Skip to content

Commit d7c781a

Browse files
author
Brendan Whitfield
committed
Added readthedocs yaml config file before config files are enforced
Also fixed some of the doc headers for more modern versions of mkdocs
1 parent d7aad00 commit d7c781a

File tree

12 files changed

+55
-30
lines changed

12 files changed

+55
-30
lines changed

.readthedocs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.11"
7+
8+
python:
9+
install:
10+
- requirements: docs/requirements.txt
11+
12+
mkdocs:
13+
configuration: mkdocs.yml
14+
fail_on_warning: false

docs/Async Connections.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Async Connections
2+
13
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.
24

35
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.

docs/Command Lookup.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Command Lookup
2+
13
`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.
24

35
```python

docs/Command Tables.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# OBD-II adapter (ELM327 commands)
1+
# Commands
2+
3+
## OBD-II adapter (ELM327 commands)
24

35
|PID | Name | Description | Response Value |
46
|-----|-------------|-----------------------------------------|-----------------------|
@@ -7,7 +9,7 @@
79

810
<br>
911

10-
# Mode 01
12+
## Mode 01
1113

1214
|PID | Name | Description | Response Value |
1315
|----|---------------------------|-----------------------------------------|-----------------------|
@@ -110,7 +112,7 @@
110112

111113
<br>
112114

113-
# Mode 02
115+
## Mode 02
114116

115117
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.
116118

@@ -124,7 +126,7 @@ obd.commands.DTC_RPM # the Mode 02 command
124126

125127
<br>
126128

127-
# Mode 03
129+
## Mode 03
128130

129131
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.
130132

@@ -135,15 +137,15 @@ Mode 03 contains a single command `GET_DTC` which requests all diagnostic troubl
135137

136138
<br>
137139

138-
# Mode 04
140+
## Mode 04
139141

140142
|PID | Name | Description | Response Value |
141143
|-----|-----------|-----------------------------------------|-----------------------|
142144
| N/A | CLEAR_DTC | Clear DTCs and Freeze data | N/A |
143145

144146
<br>
145147

146-
# Mode 06
148+
## Mode 06
147149

148150
<span style="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>
149151

@@ -252,7 +254,7 @@ Mode 06 commands are used to monitor various test results from the vehicle. All
252254

253255
<br>
254256

255-
# Mode 07
257+
## Mode 07
256258

257259
The return value will be encoded in the same structure as the Mode 03 `GET_DTC` command.
258260

@@ -262,7 +264,7 @@ The return value will be encoded in the same structure as the Mode 03 `GET_DTC`
262264

263265
<br>
264266

265-
# Mode 09
267+
## Mode 09
266268

267269
<span style="color:red">*WARNING: mode 09 is experimental. While it has been tested on a hardware simulator, only a subset of the supported
268270
commands have (00-06) been tested. Any debug output for this mode, especially for the untested PIDs, would be greatly appreciated.*</span>

docs/Connections.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Connections
12

23
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.
34

docs/Custom Commands.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Custom Commands
12

23
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).
34

@@ -13,8 +14,7 @@ If the command you need is not in python-OBDs tables, you can create a new `OBDC
1314
| header (optional) | string | If set, use a custom header instead of the default one (7E0) |
1415

1516

16-
Example
17-
-------
17+
## Example
1818

1919
```python
2020
from obd import OBDCommand, Unit
@@ -58,7 +58,7 @@ Here are some details on the less intuitive fields of an OBDCommand:
5858

5959
---
6060

61-
### OBDCommand.decoder
61+
## OBDCommand.decoder
6262

6363
The `decoder` argument is a function of following form.
6464

@@ -83,7 +83,7 @@ def <name>(messages):
8383

8484
---
8585

86-
### OBDCommand.ecu
86+
## OBDCommand.ecu
8787

8888
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:
8989

@@ -94,13 +94,13 @@ The `ecu` argument is a constant used to filter incoming messages. Some commands
9494

9595
---
9696

97-
### OBDCommand.fast
97+
## OBDCommand.fast
9898

9999
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.
100100

101101
---
102102

103-
### OBDCommand.header
103+
## OBDCommand.header
104104

105105
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.
106106

docs/Debug.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Debug
2+
13
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:
24

35
```python

docs/Responses.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Responses
2+
13
The `query()` function returns `OBDResponse` objects. These objects have the following properties:
24

35
| Property | Description |
@@ -11,7 +13,7 @@ The `query()` function returns `OBDResponse` objects. These objects have the fol
1113

1214
---
1315

14-
### is_null()
16+
## is_null()
1517

1618
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.
1719

@@ -25,7 +27,7 @@ if not r.is_null():
2527
---
2628

2729

28-
# Pint Values
30+
## Pint Values
2931

3032
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`.
3133

@@ -71,7 +73,7 @@ import obd
7173

7274
---
7375

74-
# Status
76+
## Status
7577

7678
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.
7779

@@ -111,7 +113,7 @@ Here are all of the tests names that python-OBD reports:
111113

112114
---
113115

114-
# Diagnostic Trouble Codes (DTCs)
116+
## Diagnostic Trouble Codes (DTCs)
115117

116118
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.
117119

@@ -129,7 +131,7 @@ response.value = ("P0104", "Mass or Volume Air Flow Circuit Intermittent")
129131

130132
---
131133

132-
# Fuel Status
134+
## Fuel Status
133135

134136
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:
135137

@@ -144,7 +146,7 @@ The fuel status is a tuple of two strings, telling the status of the first and s
144146

145147
---
146148

147-
# Air Status
149+
## Air Status
148150

149151
The air status will be one of these strings:
150152

@@ -157,7 +159,7 @@ The air status will be one of these strings:
157159

158160
---
159161

160-
# Oxygen Sensors Present
162+
## Oxygen Sensors Present
161163

162164
Returns a 2D structure of tuples (representing bank and sensor number), that holds boolean values for sensor presence.
163165

@@ -183,7 +185,7 @@ response.value[1][2] == True # Bank 1, Sensor 2 is present
183185
```
184186
---
185187

186-
# Monitors (Mode 06 Responses)
188+
## Monitors (Mode 06 Responses)
187189

188190
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:
189191

docs/Troubleshooting.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Debug Output
32

43
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:
5251

5352
### Unresponsive ELM
5453

55-
```
54+
```none
5655
[obd] ========================== python-OBD (v0.4.0) ==========================
5756
[obd] Explicit port defined
5857
[obd] Opening serial port '/dev/pts/2'
@@ -93,7 +92,7 @@ print ports # ['/dev/ttyUSB0', '/dev/ttyUSB1']
9392

9493
### Unresponsive Vehicle
9594

96-
```
95+
```none
9796
[obd] ========================== python-OBD (v0.4.0) ==========================
9897
[obd] Explicit port defined
9998
[obd] Opening serial port '/dev/pts/2'

docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Python-OBD is a library for handling data from a car's [**O**n-**B**oard **D**ia
66

77
<br>
88

9-
# Installation
9+
## Installation
1010

1111
Install the latest release from pypi:
1212

@@ -22,7 +22,7 @@ $ sudo apt-get install bluetooth bluez-utils blueman
2222

2323
<br>
2424

25-
# Basic Usage
25+
## Basic Usage
2626

2727
```python
2828
import obd
@@ -41,7 +41,7 @@ OBD connections operate in a request-reply fashion. To retrieve data from the ca
4141

4242
<br>
4343

44-
# Module Layout
44+
## Module Layout
4545

4646
```python
4747
import obd
@@ -59,7 +59,7 @@ obd.logger # the OBD module's root logger (for debug)
5959

6060
<br>
6161

62-
# License
62+
## License
6363

6464
GNU General Public License V2
6565

0 commit comments

Comments
 (0)