Diagnostic over IP (DoIP) Client

raw JSON →
1.1.8 verified Fri May 01 auth: no python

A Python implementation of a client for ISO-13400-2 (Diagnostic over IP). It provides a DoIPClient class for connecting to automotive ECUs over Ethernet, supporting routing activation, diagnostic message sending, and vehicle discovery. Version 1.1.8 is the latest stable release, with active maintenance.

pip install doipclient
error ModuleNotFoundError: No module named 'doipclient'
cause Package not installed or installed in wrong environment.
fix
pip install doipclient
error doipclient.connectors.DoIPConnectionException: Connection refused
cause ECU not reachable at the given IP/port or not accepting connections.
fix
Verify ECU IP and port (default 13400). Check network connectivity and firewall.
error ImportError: cannot import name 'DoIPConnectionException' from 'doipclient'
cause Incorrect import path.
fix
from doipclient.connectors import DoIPConnectionException
breaking In v1.1.3, RoutingActivationResponse.ResponseCode changed: DeniedRequiresTLS enum value corrected from 0x6 to 0x7, and 0x6 now maps to DeniedUnsupportedActivationType.
fix Update code that checks for response codes using numeric values or enum names.
gotcha The use_secure parameter in the DoIPClient constructor also accepts an ssl.SSLContext. When passed True, a default context is used. When passed an SSLContext, it uses that context directly.
fix If you need custom TLS, pass an SSLContext instead of True.
gotcha The get_entity() method for ECU discovery only works over IPv4 broadcast, not multicast. It may not detect all ECUs in complex networks.
fix Use await_vehicle_announcement() for broader discovery.
deprecated The 'timeout' parameter in the constructor may be deprecated in favor of a per-call timeout. Check documentation for current status.
fix Refer to the latest docs; use per-method timeouts if available.

Basic connection to a DoIP ECU and sending a diagnostic request.

from doipclient import DoIPClient

client = DoIPClient('192.168.0.10', 13400)
client.send_diagnostic(b'\x22\xf1\x90')  # Example UDS request