> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CAN Monitor

> Read CAN and CAN-FD traffic through a USB serial adapter, decode it with your CAN database, and send deliberate test frames.

Set a Serial Monitor tab's **Mode** to **CAN** when a USB serial adapter carries CAN traffic. Read raw frames first, decode them with your bus or ECU database, and send test frames only when a test requires it.

## Choose the adapter

| Capability | [SLCAN-compatible adapters](/docs/debug-mode/slcan.md) | [mjbots fdcanusb](/docs/debug-mode/fdcanusb.md) |
| - | - | - |
| Frames | Classic CAN, up to 8 payload bytes | Classic CAN and CAN-FD, up to 64 payload bytes |
| Bus bitrate | Set in the Monitor's **Bitrate** list | Set on the adapter; **Bitrate** shows **Device-managed (fdcanusb)** |
| Remote requests | Yes | No |

Inlay uses the fdcanusb protocol when the serial device identifies itself as fdcanusb. It treats any other adapter as SLCAN, so the adapter's firmware must implement that protocol. Follow the adapter guide before you read or send.

## Read frames

In the terminal UI, run `/monitor` to follow these steps in a browser, or use the serial sidebar. See [Use the terminal UI](/docs/debug-mode/serial-transports.md#use-the-terminal-ui).

1. Open a **Serial Monitor** tab. See [Open a Serial Monitor tab](/docs/debug-mode/serial-transports.md#open-a-serial-monitor-tab).
2. Select the port chip at the start of the toolbar, then choose the adapter under **Port**.
3. Set **Mode** to **CAN**. Changing the mode disconnects an active connection.
4. For SLCAN, choose the bus **Bitrate**. For fdcanusb, the bus rates must already be set on the adapter. See [Prepare the adapter](/docs/debug-mode/fdcanusb.md#prepare-the-adapter).
5. Select **Connect**.

Each frame shows its ID, payload length in brackets, and bytes, such as `123  [4]  DE AD BE EF`. Extended IDs show eight hex digits. CAN-FD frames add `FD` and, with bitrate switching, `BRS`. Remote requests show `remote request` instead of bytes.

## Decode signals

Inlay decodes payloads from your CAN database: DBC, KCD, SYM, or AUTOSAR XML (ARXML).

```text theme={"theme":"css-variables"}
Use @db/vehicle.dbc to prepare a Monitor decoder for the Status message.
Keep the database unchanged and compare decoded values with the raw frames.
```

When you ask Inlay to read CAN traffic, it first looks for a database in the project and tells you which one it chose. It treats your database as the source of truth and never changes it. If it finds none, it asks you for a file. It infers definitions from source code only after you confirm, and then reports which source files each definition came from.

Inlay writes a Monitor profile to `.inlay/can/codebase-derived.json`. To compare decoder versions, keep each version as a separately named `.json` file in `.inlay/can/`. The Monitor picks up changes to these files automatically.

Use the tab's CAN controls:

| Control | What it does |
| - | - |
| **Raw** / **Decoded** in the toolbar | Switches between raw frames and decoded signals. **Decoded** is unavailable until a profile exists. |
| **Decoder** in the port chip's settings | **Auto** uses `codebase-derived.json`, or the first profile by name if that file doesn't exist, and shows the file it picked. Choose a file to pin a specific profile. |
| Filter box in the toolbar | Matches raw lines or decoded signal text. |

Check the message ID, standard or extended format, length, byte order, scaling, and units against a known frame before you trust decoded values.

## Send a test frame

> [!WARNING]
>
> CAN transmissions can change ECU state or command actuators. Identify the bus, receiver, ID, payload, and expected effect before you send.

Read and decode first. Send only when the test explicitly requires it. Type the frame in the send box, which shows `CAN frame: <id>#<data> or can send <id> <data> [flags]`, and press `Enter`.

| Input | SLCAN | fdcanusb |
| - | - | - |
| `123#DEADBEEF`: ID `0x123` with four payload bytes | Yes | Yes |
| `123#R8`: remote request for eight bytes | Yes | Rejected |
| `can send 123 DEADBEEF BF`: native fdcanusb form with frame flags | Rejected | Yes |

Replace the example with the reviewed frame for your bus. See the [SLCAN send rules](/docs/debug-mode/slcan.md#send-a-deliberate-test-frame) for extended IDs and remote requests, and the [fdcanusb send rules](/docs/debug-mode/fdcanusb.md#send-a-deliberate-test-frame) for classic, FD, and BRS flags.

The tab echoes each sent frame on a line starting with `>`. Input it can't encode shows `[CAN send failed: ...]` with the reason. A submitted frame doesn't prove the receiving application acted on it.

## Interpret results

Keep raw bytes alongside decoded values. A frame without a matching definition stays raw; don't assume its application meaning.

Higher-level protocols such as J1939, CANopen, ISO-TP, or UDS need their own project definitions. Raw CAN framing alone doesn't identify them.

## Troubleshoot

* **No frames:** check the adapter firmware, bus bitrate, wiring, termination, and bus activity.
* **Decoded is unavailable:** no profile exists in `.inlay/can/`, or the selected profile isn't valid JSON. Ask Inlay to prepare or regenerate the profile from your database, or choose another profile.
* **All frames stay raw:** confirm the selected profile and that its message IDs and lengths match the traffic.
* **Wrong decoded values:** check byte order, bit positions, signedness, scale, and offset.
* **Adapter errors:** read the reported bus status before you transmit or change configuration.

Use a [logic analyzer](/docs/debug-mode/logic-analyzer.md) or an [oscilloscope](/docs/debug-mode/oscilloscope.md) when you need to inspect the electrical signal.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.