Skip to content

canair reset

usage: canair reset [-h] [--restart-timeout SECONDS] [--session] [--wake]
                    [--yes] [--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]
                    [ECU] [TYPE]

Restart one ECU with ECUReset (0x11), then wait until it answers
TesterPresent again. A restarting ECU stops working, so reset it only with the car
parked and not in use.

The command works only after you set safety.allow_reset to true at a terminal
(canair config set safety.allow_reset true). It then asks you to type the ECU's name
before it sends the reset: --yes skips that question, not the config key.

Reset types: hard (11 01), key-off-on (11 02), soft (11 03).
A KWP2000 ECU, or one whose protocol the profile does not record, takes only hard
(powerOn on KWP2000). A reset does not clear DTCs, and other ECUs may store
lost-communication DTCs while this one restarts.

positional arguments:
  ECU                   ECU name or TX ID (e.g. BMS or 7E4)
  TYPE                  Reset type: hard (hardReset 01), key-off-on
                        (keyOffOnReset 02) or soft (softReset 03)

options:
  -h, --help            show this help message and exit
  --restart-timeout SECONDS
                        How long to wait for the ECU to answer TesterPresent
                        after the reset (default: 10; 0 sends the reset and
                        does not wait)
  --session             Enter extended session (10 03) first
  --wake                Wake ECUs from deep sleep first (the ECU's wake:
                        ritual, else 10 01)
  --yes, -y             Skip the typed confirmation (required when stdin is
                        not a terminal). safety.allow_reset must still be true
  --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

examples:
  canair reset BMS soft                   Restart the BMS application (asks first)
  canair reset IGPM hard --session        Enter the extended session first, then hard reset
  canair reset 7E4 hard --yes --json      Skip the question, machine-readable result
  canair reset BCM hard --restart-timeout 0   Send the reset, don't wait for the ECU