canair discover¶
Alias: disc
usage: canair discover [-h] [--range START-END] [--delay DELAY] [--functional]
[--request HEX] [--window SECONDS] [--repeat N]
[--interval SECONDS] [--register] [--dry-run]
[--identify] [--save] [--label TEXT] [--state TEXT]
[--notes TEXT] [--wican WICAN]
[--transport {slcan-tcp,wican-ws,elm327-tcp}]
[--no-fallback] [--wait] [--elm-timeout MS]
[--timeout SECONDS] [--no-learn-frames] [--json]
[--verbose] [--timings] [--reboot] [--unsafe] [--force]
[UDS] Sweep a range of TX addresses (sends 10 01 to each) to find ECUs. With --functional, send one read on the functional (broadcast) id instead and list every ECU that answers, grouped by bus: which buses a gateway car routes diagnostics to.
options:
-h, --help show this help message and exit
--range START-END Address range (default: 700-7EF for 11-bit, 00-FF for
29-bit target bytes). The functional id 0x7DF is
skipped; --functional sends on it
--delay DELAY Delay between probes in seconds (default 0.2)
--register Register newly-discovered ECUs as files in the
profile's ecus/ directory
--dry-run With --register: show what would be added without
writing
--identify Run `canair identity` on each alive ECU after the
sweep (otherwise offer interactively)
--save Save results to captures/
--label TEXT Session label for --save (asked for when omitted; with
no terminal the session is saved under a generated
label)
--state TEXT Session state for --save
--notes TEXT Session notes for --save
--wican WICAN WiCAN address: ap or IP (default: config
transport.host / default_wican=ap)
--transport {slcan-tcp,wican-ws,elm327-tcp}
CAN transport: slcan-tcp (raw CAN), wican-ws (WiCAN
ELM327 WebSocket), or elm327-tcp (direct ELM327
adapter over TCP). Overrides the config
`transport.type` (default: slcan-tcp).
--no-fallback Don't auto-fall-back to other configured devices when
the selected one is unreachable (see config
transport.fallback).
--wait Keep retrying to reach the device indefinitely, then
start as soon as it comes online (Ctrl-C to stop). For
'monitor', also reconnects forever if the connection
drops mid-session (auto-failover to another same-
transport device is bounded by default; --wait makes
it unbounded).
--elm-timeout MS ELM327 ECU response timeout in ms (sent as ATSTxx
after init)
--timeout SECONDS Overall UDS response timeout in seconds (default 3.0
ELM / 2.0 raw). Overrides any per-ECU
response_timeout_ms for the whole run.
--no-learn-frames Don't write response_frames back into the profile's
ecus/ when this session confirms how many CAN frames a
PID's response occupies (the count that lets the
adapter answer without waiting out its full ECU
timeout). Use when reading a car the active profile
doesn't describe.
--json Output results as JSON
--verbose, -v Show raw transport traffic and expressions
--timings Print per-ECU/PID round-trip timing stats on exit (to
stderr)
--reboot Reboot WiCAN after session to restore AutoPID mode
(skipped on firmware v6, which resumes AutoPID by
itself)
--unsafe Bypass the dangerous-command blocklist: each refused
command asks for typed consent before it is sent.
Works only after the user sets safety.allow_unsafe to
true at a terminal (canair config set
safety.allow_unsafe true)
--force Ask a session already holding the connection to
release it, then wait for it
functional sweep:
--functional Send one request on the functional id (0x7DF, or
0x18DB33F1 in a 29-bit mode) and list every responder,
instead of sweeping physical ids
--request HEX With --functional: the read to broadcast (default
3E00; see below)
--window SECONDS With --functional: how long to collect replies
(default 1.0)
--repeat N With --functional: send the request N times (default
1)
--interval SECONDS With --functional --repeat: seconds between requests
(default and minimum 1)
examples:
canair discover Discover ECUs in 0x700-0x7EF (default)
canair discover --range 600-6FF Custom range
canair discover --delay 0.5 Slower pacing
canair discover --register Auto-add newly-found ECUs to ecus/
canair discover --register --dry-run Preview what would be registered
canair discover --identify Read identity DIDs from each ECU found
canair discover --functional One functional 3E 00: every routed responder
canair discover --functional --request 190208 --save
Functional DTC read, saved to captures/
canair discover --functional --repeat 3 --interval 1
Three rounds 1 s apart (does a bus drop out?)
functional requests:
A functional frame reaches every ECU the gateway routes it to at once, so only
these reads may be sent, with or without --unsafe: 3E00, 22xxxx (one DID), 1Axx,
1902xx, 1800FF00, 01xx (one OBD-II mode 01 PID). On Hyundai/Kia any functional
frame also tells in-car testers to stop sending diagnostic requests of their own
(ES95486): it changes what the car does, not only what canair sees.
slcan-tcp is the complete view; an ELM327 transport (wican-ws, elm327-tcp) is
best-effort, most of all for multi-frame replies.