Skip to content

Repository files navigation

CANtrip

CANtrip

An open-source, free alternative to Vector CANalyzer for viewing CAN / CAN-FD bus traffic on Windows, decoding it against DBC files, and graphing signals.

CANtrip main window

Read the full documentation site here

Why CANtrip

A Vector CANalyzer license costs anywhere from a few thousand to tens of thousands of euros, putting it out of reach for students, hobbyists, and small teams. The free/open-source alternatives, meanwhile, tend to be CLI-first tools that expect you to memorize a dozen flags just to open a bus, and reward a typo with a cryptic error three layers removed from what actually went wrong. CANtrip aims to sit in the middle: a GUI tool that's simple to pick up, powerful, free to use, and licensed GPLv3.

Prerequisites (Windows)

  • Wireshark installed
  • A driver package for whichever CAN hardware you're using. If you don't have any and just want to try it out; CANtrip ships with a synthetic CAN source to test its features.

Running CANtrip

Prebuilt binaries are also published under Releases if you'd rather skip building from source. Grab the zip, extract it anywhere, and copy the can2pcap.exe from CANtrip in your $env:APPDATA\Wireshark\extcap\ Wireshark directory.

CANtrip's menu is a ribbon: each tab across the top shows a different group of controls.

CANtrip's ribbon tabs

  1. Launch build\app\Debug\cantrip.exe (or cantrip.exe from a Release zip).

  2. On the Hardware tab, pick a channel from the "Network Hardware" dropdown. No CAN hardware or vendor driver installed yet? Pick "CANtrip synthetic test source (no hardware needed)". It's always listed and fakes traffic so you can try everything below without owning a single wire.

    Network hardware dropdown

  3. Still on Hardware, click CAN Controller... to set the bitrate: classic CAN mode by default, or ISO CAN FD/Expert CAN FD for FD (synth source is CAN HS only). ISO mode computes real BRP/TSEG1/TSEG2/SJW register values live from a target bitrate and sample point; Expert mode lets you type those raw values directly.

    Baudrate configuration Expert mode configuration

    Don't know the actual settings of your bus? Autodetect scans your selected network hardware for its bus config and applies it:

    Autodetect checking Autodetect result

  4. On the Home tab, click Start. Frames stream into the table as they arrive; click the arrow next to a row to unfold it into its decoded signals (name, physical value, unit) via dbcppp. Switch between "Waterfall" (newest first) and "Periodic" (one row per ID) display from the same tab, and change the display rate in case of busy buses; click Stop to end the capture.

    Display mode and rate

  5. On the Analysis & Measurement tab, click Import DBC... and load test/sample.dbc - a small DBC whose four message IDs (0x100, 0x200, 0x300, 0x7E8) deliberately match what the synthetic test source transmits, so you get fully decoded signals with zero hardware.

  6. In this same tab, you can switch from the classic CAN trace view to a graphical view. Not much to explain, play around with it to get a hold of how it works:

    CANtrip's multi-window graph view

  7. Your environment is exactly how you like it and want to save it for later? Under the Home tab, press Save Rune.... Runes are CANtrip's configuration files - save and load them later so CANtrip remembers your bus configuration and graph layout.

    Runes

  8. Press Start once your environment is all set up and you'll see your frames, decoded signals, and any bus errors right in the trace view:

    CANtrip trace view showing bus errors

How it works

CANtrip does not reimplement CAN capture or low-level frame dissection. Instead it reuses Wireshark's own capture pipeline (tshark/can2pcap), talking to hardware through a vendor-neutral interface, the AVlabs CAN backend (common/AVlabsCanBackend.h) - one bus to sniff them all, with PeakBackend/VectorBackend as the two reference implementations today.

Read the full Architecture guide for the complete process diagram, the exact data flow from a bit on the wire to a decoded signal on screen, and how Send Message works differently per vendor under the hood.

Building CANtrip

Build process

cmake -S . -B build -DCMAKE_PREFIX_PATH="G:\Qt\6.7.3\msvc2019_64"
cmake --build build --config Debug

This produces:

  • build\extcap\Debug\can2pcap.exe
  • build\app\Debug\cantrip.exe

Installing the extcap into Wireshark

After installing Wireshark and downloading CANtrip, copy can2pcap.exe into Wireshark's personal extcap folder so both Wireshark and tshark (and therefore CANtrip) can see it:

copy build\extcap\Debug\can2pcap.exe "$env:APPDATA\Wireshark\extcap\"

Verify it's picked up:

tshark -D

You should see a can2pcap interface listed.

Contributing

See CONTRIBUTING.md for code conventions and how to verify changes. See RELEASING.md for the version naming scheme and how a release gets cut.

License

GPL-3.0. See LICENSE. CANtrip statically/dynamically links dbcppp (MPL-2.0) and shells out to Wireshark's tshark (GPL-2.0) as a separate process — see individual project licenses for details.

Vector, CANalyzer, and CANoe are trademarks of Vector Informatik GmbH. CANtrip is an independent, unaffiliated open-source project and is not endorsed by or affiliated with Vector Informatik.

About

Free, open-source CAN / CAN FD bus analyzer for Windows

Topics

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages