Skip to content

canair sniff

usage: canair sniff [-h] [--wican WICAN] [--no-fallback] [--listen-only]
                    [--filter IDS] [--duration DURATION] [--save FILE]
                    [--force]

[CAN] ``canair sniff`` — passive CAN bus sniffer (raw SLCAN-over-TCP backend).

Opens the WiCAN's SLCAN socket via python-can and shows a live per-ID table
(count / rate / last data / which bytes have changed). Great for discovering
broadcast IDs and periodic signals the request/response ELM327 path can't see.
Optionally logs every frame to a python-can file (``.asc``/``.blf``/``.csv``).

The device must already be in ``slcan`` mode — sniff never switches it. If it's
in another mode, sniff errors with the exact command to fix it
(``canair wican mode set slcan``). See ``canair status``.

options:
  -h, --help           show this help message and exit
  --wican WICAN        WiCAN address: ap or IP (default: config transport.host
                       / default_wican=ap)
  --no-fallback        Don't auto-fall-back to another configured device when
                       the selected one is unreachable (see config
                       transport.fallback)
  --listen-only        Open the bus silently (no ACK/TX) — pure passive sniff.
                       Refused on WiCAN firmware v6, which ignores the SLCAN
                       listen-only command
  --filter IDS         Comma-separated hex CAN IDs to capture (default: all)
  --duration DURATION  Stop after N seconds
  --save FILE          Log all frames to FILE (.asc/.blf/.csv)
  --force              Ask a session already holding the connection to release
                       it, then wait for it

examples:
  canair sniff                       # live per-ID table (asks to switch to slcan)
  canair sniff --duration 10 --save bus.asc
  canair sniff --filter 770,7E4 --listen-only