Giter Club home page Giter Club logo

pyobda's Introduction

Onboard Diagnostics II Advanced: pyOBDA

The pyOBDA advances the previous pyOBD and python-obd projects by restructuring, combining, and rewriting their code into a single, uniform application. It also has minimal external library requirements.

Additional P and U Code Classes and Codes are added (see Codes.py). Of course, they may not be available for your vehicle. Use "Codes -> Code Lookup" to browse the codes.

The project includes an ELM327.pdf and an ISO_15765-4.pdf for reference material. See the /docs directory.

For information on the older python-obd specs, see the Python OBD Docs

Installation Instructions

1. Install Requirements:

Install the following required dependencies.

  • Python3 - A recent Python3 release is needed. Developement took place starting with the 3.8.x release series and is currently using the 3.11.x release series. Any 3.11+ release should work, but hasn't been tested. Under MacOSX 10.3 (panther), Python is installed by default. Installation instructions are available at the python website: www.python.org

  • wxPython - The "wxPython" library is needed if you want to use the pretty graphical interface to sensor data and DTC management. It's available as a pip package. Install it. Version 4.2.1 was used for development. It can also be installed globally. For example, a debian linux box might install python3-wxgtk4.0. See: wxPython (PyPI: see https://pypi.org/project/wxPython/).

    sudo apt install python3-wxgtk4.0
    # OR
    pip install wxPython
    sudo apt install python3-serial
    # OR
    pip install pyserial
Additionally, to use the pyserial lib as a normal user, the user id must at least join the dialout group for USB connected ELM devices. Additionally, joining the tty group may be needed. The user must logout and login for the group change to take effect.
    sudo usermod -a -G dialout $USER
There are other ways to gain direct user access to these devices, such as udev rules.
    sudo apt install python3-pint
    # OR
    pip install Pint
  • Bluetooth [OPTIONAL] - Bluetooth packages may need to be installed to use Bluetooth-connected ELM devices if not already installed.
    sudo apt-get install bluetooth bluez-utils blueman

If using pip, a shorter way to install the requirements:

    cd to/dir/pyobda
    pip install -r requirements.txt
    sudo usermod -a -G dialout $USER

2. Install pyOBDA:

After installing the above requirements, "install" pyOBDA on your system.

Download the release and uncompress it. Copy the uncompressed directory to wherever you want (i.e. /opt, /usr/local).

To use software, in the directory, run python3 pyobda.py. If you're using MacOSX, run pythonw pyobda.py.

    cd to/dir/pyobda
    ./pyobda.py

Modern Python uses Virtual Environments to protect your system. See Python3 venv. As an alternative, do the following:

  # To install...
    python -m venv ${HOME}/venv/pyobda # or a general purpose venv
    ${HOME}/venv/pyobda/bin/activate # or the general purpose venv's activate
    cd to/dir/pyobda
    pip install -r requirements.txt
    ./pyobda.py

  # When done...
    deactivate

  # To reuse...
    cd to/dir/pyobda
    ${HOME}/venv/pyobda/bin/activate
    ./pyobda.py

3. Configuration

Configuration Items

pyOBDA uses a configuration file to manage its connection and operation.

The OBD II configuration items are:

  • PORT - a computer port connecting the ELM device
  • BAUD - the Baud Rate used to communicate using the port
  • PROTOCOL - an ELM protocol used to communicate with the vehicle
  • FAST - support the ELM fast command response
  • CHECKVOLTS - validate the ELM connection voltage
  • TIMEOUT - the (fractional) seconds to wait for the connection response
  • RECONNECTS - the number of times to try a connection before giving up
  • DELAY - the (fractional) seconds to wait between page updates for sensors (1.0 sec min)

Debug configuration items are:

  • LEVEL - a debugging verbosity level from 0 (None) to 5 (most verbose)

OS Configuration File

For your OS, edit the file in the following locations:

  • Linux: create a config file in the pyOBDA configuration directory
    ~/.config/pyobda/config
  • Mac: same as Linux

  • Windows: create a pyobda.ini file in the pyOBDA program directory

    <path_to_pyOBDA>\pyobda\pyobda.ini

In the config file, place similar following text with your settings:

    [OBD]
    PORT = /dev/ttyUSB0
    BAUD = 115200
    PROTOCOL = 6
    FAST = True
    CHECKVOLTS = True
    TIMEOUT = 2.0
    RECONNECTS = 5
    DELAY = 1.0

    [DEBUG]
    LEVEL = 1

All done! Have fun!

pyobda's People

Contributors

atescomp avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.