---
title: "Physical CAN device"
description: "Attach a simulated ECU to a real CAN interface on the host"
source: https://developer.remotivelabs.com/docs/get-started/examples/hardware-can
last_updated: 2026-11-24
---

# Physical CAN device

- Goal: Integrate
- From: [Topology examples v0.9.0](https://github.com/remotivelabs/remotivelabs-topology-examples/tree/v0.9.0)
- Protocols: CAN
- Vehicle domains: Chassis
- Requires: Linux with RemotiveBus; A CAN device connected to the host

## Run it

```bash
git clone https://github.com/remotivelabs/remotivelabs-topology-examples.git
cd remotivelabs-topology-examples

remotive topology build \
  -f basic_restbus/instances/mock.instance.yaml \
  -f basic_restbus/instances/hardware.instance.yaml \
  build

docker compose -f build/basic_restbus_mock/docker-compose.yml up --build
```

Check with candump can0 that the restbus frames reach the device.

A topology uses a virtual CAN bus by default. Including one more instance file maps a channel to a CAN device on the
host instead, so the same simulated ECUs talk to real hardware.

- [Restbus example](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/basic_restbus/README.md#configure-to-use-a-physical-can-device)
- Instance file that maps `DriverCan0` to `can0`: [hardware.instance.yaml](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/basic_restbus/instances/hardware.instance.yaml)

Build the [restbus](https://developer.remotivelabs.com/docs/get-started/examples/restbus.md) with the hardware mapping, and start it:

```bash
remotive topology build \
  -f basic_restbus/instances/mock.instance.yaml \
  -f basic_restbus/instances/hardware.instance.yaml \
  build
docker compose -f build/basic_restbus_mock/docker-compose.yml up --build
```

Notice:
- Any device with SocketCAN support works out of the box. Once connected it shows up as a `can` link in `ip a s`.
- LIN and devices without SocketCAN support use RemotiveBus plugins, for example the
  [Kvaser plugin](https://github.com/remotivelabs/kvaser-remotivebus-plugin).

## Where it lives in the repo

- [basic_restbus/instances/hardware.instance.yaml](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/basic_restbus/instances/hardware.instance.yaml)
- [basic_restbus/instances/mock.instance.yaml](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/basic_restbus/instances/mock.instance.yaml)

[Read this use case on GitHub](https://github.com/remotivelabs/remotivelabs-topology-examples/blob/v0.9.0/usecases/HARDWARE_CAN.md)

## Works well with

- [Restbus](https://developer.remotivelabs.com/docs/get-started/examples/restbus.md): Send every frame of an ECU from its database, and set signal values from Python
- [Replay candump or CSV](https://developer.remotivelabs.com/docs/get-started/examples/replay-can.md): Play a candump or CSV recording onto a CAN bus
