Skip to content

Compare two captures for DM1 fault diffs

Goal

Given two J1939 captures from the same vehicle taken at different times, surface which active fault codes (DM1) changed between them.

Prerequisites

  • CANarchy installed.
  • Two J1939 captures. The example uses the in-tree fixtures:
  • tests/fixtures/j1939_heavy_vehicle.candump
  • tests/fixtures/j1939_compare_shifted.candump

Show active faults in each capture

canarchy j1939 dm1 \
  --file tests/fixtures/j1939_heavy_vehicle.candump \
  --text
canarchy j1939 dm1 \
  --file tests/fixtures/j1939_compare_shifted.candump \
  --text

Each line lists the source address, transport mode, count of active DTCs, lamp state, and the decoded spn/fmi pairs.

Diff the two captures

canarchy j1939 compare \
  tests/fixtures/j1939_heavy_vehicle.candump \
  tests/fixtures/j1939_compare_shifted.candump \
  --text

The compare output surfaces PGN deltas, source address changes, DM1 fault changes, and printable TP identification differences.

JSON for further analysis

canarchy j1939 compare \
  tests/fixtures/j1939_heavy_vehicle.candump \
  tests/fixtures/j1939_compare_shifted.candump \
  --json \
  | jq '.data.dm1_changes'

Where to go next