INNER CODE UNIT · Python
monitor
Chanchaldhiman/CANviz · backend/canviz/cli.py:276
def monitor(
interface: InterfaceOpt = "gs_usb",
channel: ChannelOpt = "",
index: IndexOpt = 0,
bitrate: BitrateOpt = 500_000,
dbc: DbcOpt = None,
j1939: Annotated[bool, typer.Option("--j1939", help="Enable J1939 decode - adds PGN and SA columns. Use 250 kbps for trucks/agriculture.")] = False,
refresh_rate: Annotated[float, typer.Option("--refresh-rate", help="Table refresh rate in Hz")] = 4.0,
) -> None:
"""
Live CAN frame monitor in the terminal.
Shows a Rich table that refreshes at 4 Hz. Each row is one unique CAN message ID.
Columns: ID · Name (if DBC loaded) · DLC · Data (hex) · Count · Rate (fps) · Last Seen
With --j1939: adds PGN and SA (Source Address) columns for J1939 traffic.
Data column is colour-coded on change:
Green - byte sum increased since last frame