python-udsoncan
###############
.. image:: https://app.travis-ci.com/pylessard/python-udsoncan.svg?branch=master
This project is an implementation of the Unified Diagnostic Services (UDS) protocol defined by ISO-14229 written in Python 3. The code is published under MIT license on GitHub (pylessard/python-udsoncan).
Documentation
-------------
The documentation is available here : http://udsoncan.readthedocs.io
Requirements
------------
- Python 3.7+
Installation
------------
using pip::
pip install udsoncan
Example
-------
.. code-block:: python
import SomeLib.SomeCar.SomeModel as MyCar
import udsoncan
import isotp
from udsoncan.connections import IsoTPSocketConnection
from udsoncan.client import Client
from udsoncan.exceptions import *
from udsoncan.services import *
udsoncan.setup_logging()
conn = IsoTPSocketConnection('can0', isotp.Address(isotp.AddressingMode.Normal_11bits, rxid=0x123, txid=0x456))
with Client(conn, request_timeout=2, config=MyCar.config) as client:
try:
client.change_session(DiagnosticSessionControl.Session.extendedDiagnosticSession) # integer with value of 3
client.unlock_security_access(MyCar.debug_level) # Fictive security level. Integer coming from fictive lib, let's say its value is 5
client.write_data_by_identifier(udsoncan.DataIdentifier.VIN, 'ABC123456789') # Standard ID for VIN is 0xF190. Codec is set in the client configuration
print('Vehicle Identification Number successfully changed.')
client.ecu_reset(ECUReset.ResetType.hardReset) # HardReset = 0x01
except NegativeResponseException as e:
print('Server refused our request for service %s with code "%s" (0x%02x)' % (e.response.service.get_name(), e.response.code_name, e.response.code))
except (InvalidResponseException, UnexpectedResponseException) as e:
print('Server sent an invalid payload : %s' % e.response.original_payload)
Raw data
{
"_id": null,
"home_page": "https://github.com/pylessard/python-udsoncan",
"name": "udsoncan",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "uds,14229,iso-14229,diagnostic,automotive",
"author": "Pier-Yves Lessard",
"author_email": "py.lessard@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e9/4e/8bb11738ba84ddb588925b523afbc981f9db5449426dd188c1be9c8beb5f/udsoncan-1.23.0.tar.gz",
"platform": null,
"description": "python-udsoncan\n###############\n\n\n.. image:: https://app.travis-ci.com/pylessard/python-udsoncan.svg?branch=master\n\nThis project is an implementation of the Unified Diagnostic Services (UDS) protocol defined by ISO-14229 written in Python 3. The code is published under MIT license on GitHub (pylessard/python-udsoncan).\n\nDocumentation\n-------------\n\nThe documentation is available here : http://udsoncan.readthedocs.io\n\nRequirements\n------------\n\n - Python 3.7+\n\nInstallation\n------------\n\nusing pip::\n\n pip install udsoncan\n\nExample\n-------\n\n.. code-block:: python\n\n import SomeLib.SomeCar.SomeModel as MyCar\n\n import udsoncan\n import isotp\n from udsoncan.connections import IsoTPSocketConnection\n from udsoncan.client import Client\n from udsoncan.exceptions import *\n from udsoncan.services import *\n \n udsoncan.setup_logging()\n \n conn = IsoTPSocketConnection('can0', isotp.Address(isotp.AddressingMode.Normal_11bits, rxid=0x123, txid=0x456))\n with Client(conn, request_timeout=2, config=MyCar.config) as client:\n try:\n client.change_session(DiagnosticSessionControl.Session.extendedDiagnosticSession) # integer with value of 3\n client.unlock_security_access(MyCar.debug_level) # Fictive security level. Integer coming from fictive lib, let's say its value is 5\n client.write_data_by_identifier(udsoncan.DataIdentifier.VIN, 'ABC123456789') # Standard ID for VIN is 0xF190. Codec is set in the client configuration\n print('Vehicle Identification Number successfully changed.')\n client.ecu_reset(ECUReset.ResetType.hardReset) # HardReset = 0x01\n except NegativeResponseException as e:\n print('Server refused our request for service %s with code \"%s\" (0x%02x)' % (e.response.service.get_name(), e.response.code_name, e.response.code))\n except (InvalidResponseException, UnexpectedResponseException) as e:\n print('Server sent an invalid payload : %s' % e.response.original_payload)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Implementation of the Unified Diagnostic Service (UDS) protocol (ISO-14229) used in the automotive industry.",
"version": "1.23.0",
"project_urls": {
"Download": "https://github.com/pylessard/python-udsoncan/archive/v1.23.0.tar.gz",
"Homepage": "https://github.com/pylessard/python-udsoncan"
},
"split_keywords": [
"uds",
"14229",
"iso-14229",
"diagnostic",
"automotive"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7a4b77c8f6a83df28de65f42243cc2d0a81b195381eaeef2c2a158e1e7b69db2",
"md5": "078791ca7e2cbcb4ede03be13be5fd3a",
"sha256": "6fe858665796d774939e46660bc2089b6d81a5b7eebfe209c76479467c66c0a2"
},
"downloads": -1,
"filename": "udsoncan-1.23.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "078791ca7e2cbcb4ede03be13be5fd3a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 116350,
"upload_time": "2024-03-05T02:52:08",
"upload_time_iso_8601": "2024-03-05T02:52:08.599332Z",
"url": "https://files.pythonhosted.org/packages/7a/4b/77c8f6a83df28de65f42243cc2d0a81b195381eaeef2c2a158e1e7b69db2/udsoncan-1.23.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e94e8bb11738ba84ddb588925b523afbc981f9db5449426dd188c1be9c8beb5f",
"md5": "59e123e9716ffdc86ca69aeb22b44acf",
"sha256": "574c9633bd444d086722e622472bb109208978597b37922d5251096f8e541370"
},
"downloads": -1,
"filename": "udsoncan-1.23.0.tar.gz",
"has_sig": false,
"md5_digest": "59e123e9716ffdc86ca69aeb22b44acf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 124265,
"upload_time": "2024-03-05T02:52:10",
"upload_time_iso_8601": "2024-03-05T02:52:10.646566Z",
"url": "https://files.pythonhosted.org/packages/e9/4e/8bb11738ba84ddb588925b523afbc981f9db5449426dd188c1be9c8beb5f/udsoncan-1.23.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-05 02:52:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pylessard",
"github_project": "python-udsoncan",
"travis_ci": true,
"coveralls": true,
"github_actions": false,
"requirements": [
{
"name": "aioisotp",
"specs": []
}
],
"lcname": "udsoncan"
}