J1939 Annotator

CanKing service extension that decodes and annotates J1939 Transport Protocol (TP) traffic.

This extension listens to incoming J1939 frames (29-bit CAN IDs) and enriches them with base J1939 identifier metadata. For TP Connection Management (TP.CM, PGN 0xEC00) and Data Transfer (TP.DT, PGN 0xEB00) frames it also adds TP-specific decode and reassembly state.

It can also be configured to actively participate in CMDT (connection mode) transfers by transmitting CTS and EndAck control frames.

What It Does

Passive Observer Scope

This extension is Rx-only and passive by design.

When active_listening is enabled, the extension sends TP.CM CTS and EndAck frames for CMDT transfers.

Note:
This extension never sends segmented messages of its own. It can only receive segmented messages, not transmit.

Frame Properties Added

Depending on frame type and decode state, the extension sets these frame properties:

PropertySet onValue
J1939.PGNAll J1939 framesNumeric PGN
J1939.SourceAll J1939 framesSource address (0–253)
J1939.DestinationAll J1939 framesDestination address (0–255)
J1939.PriorityAll J1939 framesPriority (0–7)
J1939.TpControlTypeTP.CM frames (PGN 0xEC00)"BAM", "RTS", "CTS", "EndAck", "Abort", or "Unknown"
J1939.TpPGNAll TP.CM and TP.DT framesTransported-message PGN
J1939.TpTotalBytesTP.CM BAM, RTS, EndAck framesTotal payload bytes declared in the frame
J1939.TpNumPacketsTP.CM BAM, RTS, EndAck framesTotal TP.DT packet count declared in the frame
J1939.TpMaxPacketsPerCtsTP.CM RTS framesMaximum packets per CTS window the sender will accept
J1939.TpCtsNumPacketsTP.CM CTS framesNumber of DT packets the sender may transmit in this window
J1939.TpCtsNextPacketTP.CM CTS framesSequence number of the first DT packet expected in this window
J1939.TpAbortReasonTP.CM Abort framesAbort reason code
J1939.TpSeqNoTP.DT frames (PGN 0xEB00)Sequence number byte (1–255)
J1939.TpSessionProgressTP.DT frames with an active session"received/total" byte count
J1939.TpReassemblyCompleteLast TP.DT of a complete message"true"
J1939.TpPayloadHexLast TP.DT of a complete messageUppercase hex of reassembled payload
J1939.TpActiveActionTP.CM RTS (active mode); TP.DT at window boundary or final packet"CTS sent" or "EndAck sent"

Configuration

Configuration is JSON and can be changed at runtime via the CanKing extension config.

Default configuration:

{
  "session_timeout_ms": 750,
  "filter_pgns": [],
  "filter_source_addresses": [],
  "active_listening": false,
  "active_receiver_addresses": [],
  "active_cts_window_size": 255
}

Fields: