Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ test.dbc
build/

bin/

# Release artifacts
cangaroo-v*.tar.gz
cangaroo-v*.tar.gz.sha256
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Contributing to Cangaroo

Thank you for your interest in contributing to Cangaroo! We welcome contributions from engineers, developers, and enthusiasts.

## How Can I Contribute?

### Reporting Bugs
- Check the [Issues Tab](https://github.com/OpenAutoDiagLabs/cangaroo/issues) to see if the bug has already been reported.
- If not, create a new issue. Include as much detail as possible, such as:
- Your OS and version.
- The CAN hardware you are using.
- Steps to reproduce the issue.
- Any error logs or screenshots.

### Suggesting Features
- We love hearing new ideas! Please start a [Discussion](https://github.com/OpenAutoDiagLabs/cangaroo/discussions) to talk about your feature request.

### Submitting Pull Requests
1. **Fork the repository** and create your branch from `master`.
2. **Ensure your code builds** and follows the existing coding style (Qt/C++).
3. **Document your changes**: Update the README or headers if necessary.
4. **Open a Pull Request**: Provide a clear description of the problem you are solving or the feature you are adding.

## Coding Standards
- We use **Qt 6** (targeted at v6.10+).
- Prefer range-based `for` loops over `foreach`.
- Keep memory safety in mind (use smart pointers where appropriate).

## Community
Join the conversation in the [GitHub Discussions](https://github.com/OpenAutoDiagLabs/cangaroo/discussions).

---

By contributing, you agree that your contributions will be licensed under the project's **GPL-3.0+** license.
155 changes: 73 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,135 +1,126 @@
# <img src="src/cangaroo.ico" width="48" height="48"> CANgaroo - Professional CAN Bus Analysis
# <img src="src/assets/cangaroo.png" width="48" height="48"> Cangaroo
**Open-source CAN bus analyzer for Linux, Automotive, Robotics, and Industrial Applications**

CANgaroo is a powerful, open-source CAN bus analyzer designed for engineers working in **Automotive**, **Robotics**, and **Industrial Automation**. Whether you are debugging a vehicle network, developing robot sensors, or monitoring industrial machinery, CANgaroo provides the tools you need to capture, decode, and analyze CAN traffic in real-time.
[![Try Cangaroo Now](https://img.shields.io/badge/Try-Cangaroo-blue?style=for-the-badge)](https://github.com/OpenAutoDiagLabs/cangaroo/releases/latest)

![Cangaroo Demo](test/output.gif)
![GitHub stars](https://img.shields.io/github/stars/OpenAutoDiagLabs/cangaroo?style=social)
![GitHub forks](https://img.shields.io/github/forks/OpenAutoDiagLabs/cangaroo?style=social)
![GitHub issues](https://img.shields.io/github/issues/OpenAutoDiagLabs/cangaroo)
![License](https://img.shields.io/github/license/OpenAutoDiagLabs/cangaroo)
![Release](https://img.shields.io/github/v/release/OpenAutoDiagLabs/cangaroo)

---

## 🚀 Key Features
Cangaroo is a professional-grade CAN bus analyzer designed for engineers in **Automotive**, **Robotics**, and **Industrial Automation**. It facilitates real-time capture, decoding, and analysis of CAN and CAN‑FD traffic.

- **Wide Hardware Support**: Works with SocketCAN (Linux), CANable (SLCAN), Candlelight, and CANblaster (UDP).
- **CAN & CAN-FD**: Full support for both standard CAN and high-speed CAN-FD frames.
- **Real-time DBC Decoding**: Load multiple DBC files to see signals and messages decoded instantly in the trace view.
- **Integrated Graphics**: Graph signals over time to visualize sensor data and bus behavior.
- **Advanced Filtering**: Quickly isolate relevant traffic with powerful live filters.
- **Flexible Logging**: Export traces and logs to standard formats for offline analysis.
- **Modern UI**: Streamlined interface with dockable windows for a customizable workspace.
> **Works with SocketCAN (Linux), CANable, Candlelight, and CANblaster for immediate testing and real hardware connections.**

---

## 🛠️ Installation (Linux)
## 🎥 Demo Gallery
![Cangaroo Trace View](test/trace_view.gif)
*Real-time capture and decoding of CAN traffic using DBC databases.*
<!-- slide -->
![Cangaroo Generator View](test/generator_view.gif)
*Simulate CAN traffic with customizable periodic and manual transmissions.*
<!-- slide -->
![Cangaroo Overview](test/output.gif)
*Flexible dockable workspace optimized for multi-monitor analysis.*

The easiest way to get started on Linux is to use our automated installation script:
---

```bash
git clone https://github.com/OpenAutoDiagLabs/cangaroo
cd cangaroo
./install_linux.sh
```
## 🚀 Key Features

### Manual Installation by Distro
* **Real-time CAN/CAN-FD Decoding**: Support for standard and high-speed flexible data-rate frames.
* **Wide Hardware Compatibility**: Seamlessly works with **SocketCAN** (Linux), **CANable** (SLCAN), **Candlelight**, and **CANblaster** (UDP).
* **DBC Database Support**: Load multiple `.dbc` files to instantly decode frames into human-readable signals.
* **Data Visualization**: Integrated graphing tools to visualize signal changes over time.
* **Advanced Filtering & Logging**: Isolate critical data with live filters and export captures for offline analysis.
* **Modern Workspace**: A clean, dockable user interface optimized for multi-monitor setups.

**Ubuntu / Debian / Mint**
```bash
sudo apt update
sudo apt install qt6-base-dev libqt6charts6-dev libqt6serialport6-dev build-essential libnl-3-dev libnl-route-3-dev
```
---

**Fedora**
```bash
sudo dnf install qt6-qtbase-devel qt6-qtcharts-devel qt6-qtserialport-devel libnl3-devel
```
## 🛠️ Installation & Setup (Linux)

Getting started is as simple as running our automated setup script:

**Arch Linux**
```bash
sudo pacman -S qt6-base qt6-charts qt6-serialport libnl
git clone https://github.com/OpenAutoDiagLabs/CANgaroo.git
cd CANgaroo
./install_linux.sh
```

---
### Manual Installation

## 🏗️ Building from Source
| Distribution | Command |
| :--- | :--- |
| **Ubuntu / Debian** | `sudo apt install qt6-base-dev libqt6charts6-dev libqt6serialport6-dev build-essential libnl-3-dev libnl-route-3-dev` |
| **Fedora** | `sudo dnf install qt6-qtbase-devel qt6-qtcharts-devel qt6-qtserialport-devel libnl3-devel` |
| **Arch Linux** | `sudo pacman -S qt6-base qt6-charts qt6-serialport libnl` |

Once dependencies are installed, follow these steps:
### Building from Source

```bash
cd src
PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig qmake6
make -j$(nproc)
```

The binary will be generated in `bin/cangaroo`.

---

## 🚦 Getting Started

### 1. Set up a Virtual CAN Interface (Linux)
If you don't have hardware yet, you can test CANgaroo using a virtual interface:
## 🚦 Quick Start Guide

### 1. Zero-Hardware Testing (Virtual CAN)
```bash
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
```

### 2. Connect to an Interface
Launch CANgaroo, go to **Setup -> Interfaces**, and select your device (e.g., `vcan0` or a physical `can0`).

### 3. Load a DBC File
To decode messages, go to **Measurement -> Add CAN Database** and select your `.dbc` file. Signals will now appear in the Trace window.
### 2. Quick Test with Example Data
```bash
# Launch Cangaroo with a virtual interface and fallback DBC
./bin/cangaroo -i vcan0 -d examples/demo.dbc
```

---

## 📖 Examples
## 📥 Downloads & Releases

### Recording Traffic
- Connect to your interface.
- Hit the **Start** button.
- Use **File -> Export Logs** to save the captured data.
Download the latest release tarball from the [Releases Page](https://github.com/OpenAutoDiagLabs/cangaroo/releases).

### Transmitting Data
- Open the **Generator View**.
- Define your message ID and data payload.
- Click **Send** to inject the frame into the bus.
### Verifying Your Download
All official releases include a SHA256 checksum. Verify your download using:

```bash
sha256sum cangaroo-v0.4.1-linux-x86_64.tar.gz
# Expected output:
# abc123def456... cangaroo-v0.4.1-linux-x86_64.tar.gz
```

---

## 📜 Credits & Contributors
## 🤝 Contribution & Community

Original Author: Hubert Denkmair ([hubert@denkmair.de](mailto:hubert@denkmair.de))
Lead Maintainer: [Jayachandran Dharuman](https://github.com/OpenAutoDiagLabs/cangaroo)
We welcome contributions!
* **Report Bugs**: Open an issue on our [GitHub Tracker](https://github.com/OpenAutoDiagLabs/cangaroo/issues).
* **Suggest Features**: Start a discussion in the [Discussions Tab](https://github.com/OpenAutoDiagLabs/cangaroo/discussions).
* **Contribute Code**: See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

---

## 📝 Changelog Summary (v0.4.1)
- **Qt6 Migration**: Fully updated for Qt 6.10 compatibility.
- **Enhanced Persistence**: Explicit workspace management (Save/Load).
- **Improved Stability**: Fixed several critical segmentation faults in SocketCAN drivers.
- **Trace Simplification**: Streamlined Trace View by removing redundant AutoScroll and Aggregation toggles (now active by default).
## 📜 Credits

*For a full history, see the [Changelog Section below](#full-changelog).*
* **Original Author**: Hubert Denkmair ([hubert@denkmair.de](mailto:hubert@denkmair.de))
* **Lead Maintainer**: [Jayachandran Dharuman](https://github.com/OpenAutoDiagLabs/cangaroo)

---

<details>
<summary><b>Click to expand Full Changelog</b></summary>

### v0.4.1
* Qt 6.10 Migration
* Explicit Workspace Persistence
* Fixed SocketCAN stability issues
* UI Simplification (removed AutoScroll/Aggregate checkboxes)
## 📝 Changelog Summary (v0.4.1)
* **Qt 6.10 Migration**: Full support for the latest Qt framework.
* **SocketCAN Stability**: Resolved driver crashes during interface discovery.
* **UI Streamlining**: Removed redundant toggles for a cleaner analysis experience.

### v0.3.0
* Migrate to Qt6
* Added GrIP driver
---

### v0.2.4.1
* Add WeAct Studio Support
* Initial Translation support
**Keywords**: CAN bus analyzer Linux, SocketCAN GUI, CAN FD decoder, automotive diagnostic tool, open-source CAN tool.

### v0.2.4
* Add initial support for CANFD
* Add live filtering of CAN messages in trace view
</details>
**License**: [GPL-3.0+](LICENSE)
51 changes: 51 additions & 0 deletions create_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# 1. CHECK INPUT
if [ -z "$1" ]; then
echo "Usage: $0 <version>"
echo "Example: $0 0.4.1"
exit 1
fi

VERSION=$1
APP_NAME="cangaroo"
BINARY_PATH="./bin/${APP_NAME}"
ARCH=$(uname -m)
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
RELEASE_NAME="${APP_NAME}-v${VERSION}-${OS}-${ARCH}"
TAR_FILE="${RELEASE_NAME}.tar.gz"

# 2. CHECK IF BINARY EXISTS
if [ ! -f "$BINARY_PATH" ]; then
echo "Error: Binary not found at $BINARY_PATH"
echo "Please build the project first."
exit 1
fi

echo "Packaging ${APP_NAME} version ${VERSION}..."

# 3. CREATE STAGING DIRECTORY
mkdir -p release_stage
cp "$BINARY_PATH" release_stage/
cp README.md release_stage/
cp LICENSE release_stage/
cp CONTRIBUTING.md release_stage/

# 4. CREATE TARBALL
# -C changes directory so the tar doesn't include the 'release_stage' parent folder path
tar -czf "$TAR_FILE" -C release_stage .

# 5. GENERATE CHECKSUM
sha256sum "$TAR_FILE" > "${TAR_FILE}.sha256"

# 6. CLEANUP & OUTPUT
rm -rf release_stage

echo "-------------------------------------------------------"
echo "Release Created Successfully:"
echo "Package: $TAR_FILE"
echo "Checksum: ${TAR_FILE}.sha256"
echo "-------------------------------------------------------"
echo "SHA256 Output:"
cat "${TAR_FILE}.sha256"
echo "-------------------------------------------------------"
48 changes: 48 additions & 0 deletions examples/demo.dbc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
VERSION ""

NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
CAT_DEF_
CAT_
FILTER
BA_DEF_DEF_
EV_DATA_
ENVVAR_DATA_
SGTYPE_
SGTYPE_VAL_
BA_DEF_SGTYPE_
BA_SGTYPE_
SIG_TYPE_REF_
VAL_TABLE_
SIG_GROUP_
SIG_VALTYPE_
SIG_UNIT_
SG_MUL_VAL_

BS_:

BU_: EngineECU TransmissionECU DisplayECU

BO_ 256 EngineData: 8 EngineECU
SG_ EngineSpeed : 0|16@0+ (1,0) [0|8000] "rpm" DisplayECU
SG_ EngineTemp : 16|8@0+ (1,-40) [-40|215] "degC" DisplayECU
SG_ OilPressure : 24|8@0+ (0.1,0) [0|25] "bar" DisplayECU

BO_ 512 TransmissionData: 4 TransmissionECU
SG_ GearPos : 0|4@0+ (1,0) [0|15] "" DisplayECU
SG_ VehicleSpeed : 4|12@0+ (0.1,0) [0|400] "km/h" DisplayECU

BO_ 768 AmbientData: 2 SensorECU
SG_ OutsideTemp : 0|8@0+ (1,-40) [-40|100] "degC" DisplayECU
SG_ Humidity : 8|8@0+ (0.5,0) [0|100] "%" DisplayECU

CM_ BO_ 256 "Engine status information";
CM_ SG_ 256 EngineSpeed "Current engine rotations per minute";
CM_ BO_ 512 "Transmission status and vehicle speed";
CM_ BO_ 768 "Environment sensor data";

VAL_ 512 GearPos 0 "Neutral" 1 "First" 2 "Second" 3 "Third" 4 "Fourth" 5 "Fifth" 6 "Sixth" 7 "Reverse" 15 "Error" ;
18 changes: 16 additions & 2 deletions src/core/Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "LogModel.h"

#include <QDateTime>
#include <QFileInfo>

#include <core/CanTrace.h>
#include <core/MeasurementSetup.h>
Expand Down Expand Up @@ -247,13 +248,26 @@ CanInterface *Backend::getInterfaceByDriverAndName(QString driverName, QString d

}

pCanDb Backend::loadDbc(QString filename)
pCanDb Backend::loadDbc(QString filename, QString *errorMsg)
{
DbcParser parser;

QFileInfo info(filename);
if (!info.exists() || !info.isReadable()) {
if (errorMsg) {
*errorMsg = tr("File not found or not readable.");
}
return pCanDb();
}

QFile *dbc = new QFile(filename);

pCanDb candb(new CanDb());
parser.parseFile(dbc, *candb);
if (!parser.parseFile(dbc, *candb)) {
if (errorMsg) {
*errorMsg = tr("Failed to parse DBC file. Please check the log for details.");
}
}
delete dbc;

return candb;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Backend : public QObject
CanDriver *getDriverByName(QString driverName);
CanInterface *getInterfaceByDriverAndName(QString driverName, QString deviceName);

pCanDb loadDbc(QString filename);
pCanDb loadDbc(QString filename, QString *errorMsg = 0);

void clearLog();
LogModel &getLogModel() const;
Expand Down
Loading