Skip to content
Naval Prashar edited this page Sep 14, 2025 · 1 revision

CANopen Tools Suite

A collection of CANopen utilities for development and debugging:

  • Sniffer (GUI/CLI): capture and decode PDO/SDO traffic using EDS files
  • Frame Simulator: generate CANopen traffic aligned with EDS mappings
  • Node Monitor: live OD variable monitor with Rich TUI and command panel

Tools Overview

CANopen Sniffer (GUI / CLI)

  • Decode PDOs and SDOs with EDS/OD metadata
  • GUI: searchable table, filtering, CSV export, histogram, frame-rate graphs
  • CLI: Rich tables, bus stats, logging, export
  • Modes: Fixed (replace row) or Sequential (append row)

Run GUI:

python canopen_bus_sniffer_gui.py --interface vcan0 --eds sample_device.eds

Run CLI:

python canopen_bus_sniffer_cli.py --interface vcan0 --eds sample_device.eds --log --export

CANopen Frame Simulator

  • Parses TPDO mappings dynamically from EDS
  • Sends PDOs (auto-generated values) + unmapped OD entries as SDOs
  • Supports heartbeat, timestamp, emergency frames
  • Logging option

Run:

python canopen_frame_simulator.py --interface vcan0 --count 20 --eds sample_device.eds --with-timestamp --with-emcy

CANopen Node Monitor (CLI with Rich TUI)

  • Uses LocalNode + RemoteNode from EDS
  • Displays raw CAN frames, decoded PDOs, SDO requests/responses
  • Split OD variable tables + live status panel
  • Interactive command input panel
  • CSV export of OD changes + logging

Run:

python canopen_node_monitor_cli.py --interface vcan0 --local-eds local.eds --remote-eds remote.eds --export --log

Dependencies

pip install python-can canopen rich PyQt5 tqdm pytest

SocketCAN Setup

Virtual CAN

sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set vcan0 up

Physical CAN

sudo ip link set can0 type can bitrate 1000000
sudo ip link set can0 up

Typical Workflow

  1. Start a virtual CAN (vcan0) or physical CAN (can0)
  2. Run Frame Simulator to generate traffic (optional)
  3. Use Sniffer (GUI/CLI) or Node Monitor to observe traffic
  4. Export logs / CSVs for analysis

Logging & Export

  • Sniffer: CSV export (data, histogram)
  • Simulator: logs to simulate_can_frames.log (optional)
  • Node Monitor: logs to canopen_node_monitor_cli.log, OD variable changes to CSV (if enabled)

⚡ This suite is designed for testing, debugging, and visualizing CANopen networks with minimal setup.

Clone this wiki locally