{"id":13740737,"url":"https://github.com/GENIVI/CANdevStudio","last_synced_at":"2025-05-08T20:32:29.011Z","repository":{"id":40524025,"uuid":"92063745","full_name":"GENIVI/CANdevStudio","owner":"GENIVI","description":"Development tool for CAN bus simulation","archived":false,"fork":false,"pushed_at":"2024-05-01T08:14:46.000Z","size":171530,"stargazers_count":901,"open_issues_count":33,"forks_count":244,"subscribers_count":76,"default_branch":"master","last_synced_at":"2024-08-04T04:06:59.315Z","etag":null,"topics":["automotive","can","can-bus","genivi"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GENIVI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-22T14:35:32.000Z","updated_at":"2024-08-03T17:36:29.000Z","dependencies_parsed_at":"2022-07-26T20:32:06.501Z","dependency_job_id":"4218ca02-fb91-404a-a2d2-323977fc71fa","html_url":"https://github.com/GENIVI/CANdevStudio","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GENIVI%2FCANdevStudio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GENIVI%2FCANdevStudio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GENIVI%2FCANdevStudio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GENIVI%2FCANdevStudio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GENIVI","download_url":"https://codeload.github.com/GENIVI/CANdevStudio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224765549,"owners_count":17366134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automotive","can","can-bus","genivi"],"created_at":"2024-08-03T04:00:51.758Z","updated_at":"2024-11-15T10:31:02.103Z","avatar_url":"https://github.com/GENIVI.png","language":"C++","funding_links":[],"categories":["Libraries and Tools","Network and Middleware","Utils","C++","System"],"sub_categories":["C++","Controller Area Network","GUI Tools","Network and Middleware"],"readme":"# CANdevStudio \n[![CANdevStudio](https://github.com/GENIVI/CANdevStudio/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/GENIVI/CANdevStudio/actions/workflows/build.yml?query=branch%3Amaster++) [![codecov](https://codecov.io/gh/GENIVI/CANdevStudio/branch/master/graph/badge.svg)](https://codecov.io/gh/GENIVI/CANdevStudio) [![Doxygen](https://img.shields.io/badge/Doxygen-master-blue.svg)](https://genivi.github.io/CANdevStudio/)\n\n\n\n* [Overview](#overview)\n  * [Compatible CAN interfaces](#compatible-can-interfaces)\n  * [Supported operating systems](#supported-operating-systems)\n* [Build instructions](#build-instructions)\n  * [Linux](#linux)\n    * [To choose compiler](#to-choose-compiler)\n    * [Qt in CMake](#qt-in-cmake)\n  * [Windows](#windows)\n    * [Visual Studio 2019 Win64](#visual-studio-2019-win64)\n  * [macOS / OS X](#macos--os-x)\n* [Prebuilt packages](#prebuilt-packages)\n  * [Download](#download)\n  * [Package naming](#package-naming)\n  * [Linux](#linux-1)\n  * [ARCH Linux](#arch-linux)\n  * [Windows](#windows-1)\n  * [macOS / OS X](#macos--os-x-1)\n* [Quick Start](#quick-start)\n  * [CAN Hardware](#can-hardware)\n    * [Microchip CAN BUS Analyzer](#microchip-can-bus-analyzer)\n    * [Lawicel CANUSB](#lawicel-canusb)\n    * [PeakCAN PCAN-USB](#peakcan-pcan-usb)\n    * [PassThruCAN Plugin](#passthrucan-plugin)\n  * [CANdevStudio without CAN hardware](#candevstudio-without-can-hardware)\n    * [VCAN](#vcan)\n    * [Cannelloni](#cannelloni)\n* [Help](#help)\n  * [Scripting](#scripting)\n  * [CAN Signals](#can-signals)\n  * [CanDevice configuration](#candevice-configuration)\n  * [CanRawFilter](#canrawfilter)\n  * [Adding new components](#adding-new-components)\n  \n## Overview\nMost of automotive projects need to have an access to the Controller Area Network (CAN) bus. There are plenty of commercial frameworks that provides CAN stacks and hardware/software tools necessary to develop proper CAN networks. They are very comprehensive and thus expensive. CANdevStudio aims to be cost-effective replacement for CAN simulation software. It can work with variety of CAN hardware interfaces (e.g. Microchip, Vector, PEAK-Systems) or even without it (vcan and [cannelloni](https://github.com/mguentner/cannelloni)) . CANdevStudio enables to simulate CAN signals such as ignition status, doors status or reverse gear by every automotive developer. Thanks to modularity it is easy to implement new, custom features.\n\nCheckout CANdevStudio on [YouTube](https://www.youtube.com/watch?v=1TfAyg6DG04)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://at.projects.genivi.org/wiki/download/attachments/14976114/CDS_V1.png\" width=\"65%\" /\u003e\n\u003c/p\u003e\n\n### Compatible CAN interfaces\nAccess to CAN bus is based on Qt framework. Current list of supported CAN interfaces can be found [here](https://doc.qt.io/qt-5/qtcanbus-backends.html).\n\nCurrent list of devices compatible with SocketCAN (Linux only) can be found [here](http://elinux.org/CAN_Bus).\n### Supported operating systems\n* Linux\n* Windows\n* macOS\n\n## Build instructions\nCANdevStudio project uses GitHub Actions as continuous integration environment. You can check [build.yml](https://github.com/GENIVI/CANdevStudio/blob/master/.github/workflows/build.yml) for details. \n\nTo lower maintenance effort and allow for usage of modern C++ features, since v1.2.0 CANdevStudio dropped \"official\" support for legacy compilers like gcc5.3, vs2015 or MinGW. Current CI configuration uses the latest compilers available for each GitHub Actions environment:\n* ubuntu-latest (clang and gcc)\n* macos-latest (clang)\n* windows-latest (vs2019 x64)\n\n### Linux\n#### Dependencies (Ubuntu / Debian)\n```\nsudo apt install qtbase5-dev libqt5serialbus5-dev libqt5svg5-dev qtdeclarative5-dev\n```\n#### Build steps\n```\ngit clone https://github.com/GENIVI/CANdevStudio.git\ncd CANdevStudio\ngit submodule update --init --recursive\nmkdir build\ncd build\ncmake ..\nmake\n```\n#### To choose compiler\n```\ncd CANdevStudio/build\nrm -rf *\nexport CC=clang\nexport CXX=clang++\ncmake ..\nmake\n```\n#### Qt in CMake\nIf CMake failed to find Qt in your system:\n```\ncd CANdevStudio/build\nrm -rf *\ncmake .. -DCMAKE_PREFIX_PATH=/home/genivi/Qt5.12.0/5.12.0/gcc_64\nmake\n```\n### Windows\n#### Visual Studio 2019 Win64\n```\ngit clone https://github.com/GENIVI/CANdevStudio.git\ncd CANdevStudio\ngit submodule update --init --recursive\nmkdir build\ncd build\ncmake .. -DCMAKE_BUILD_TYPE=Release -G \"Visual Studio 16 2019\" -A x64\ncmake --build .\n```\n### macOS / OS X\n#### Dependencies\n```\nbrew install qt5 cmake ninja\n```\n#### Build steps\n```\ngit clone https://github.com/GENIVI/CANdevStudio.git\ncd CANdevStudio\ngit submodule update --init --recursive\ncmake -S. -Bbuild -GNinja -DCMAKE_PREFIX_PATH=$(brew --prefix qt5)/lib/cmake\ncd build\nninja\n```\n## Prebuilt packages\nEach GitHub Actions job stores prebuilt packages for 90 days. Additionally official releases are stored on GitHub Releases page.\n### Package naming\n***CANdevStudio-X.Y.ZZZZZZZ-SYS[-standalone]***\n\n**X** - major version number of previous stable version\u003cbr/\u003e\n**Y** - minor version of previous stable version\u003cbr/\u003e\n**Z** - SHA commit ID\u003cbr/\u003e\n**SYS** - either **win64**, **Linux** or **Darwin**\u003cbr/\u003e\n**standalone** - bundle version that contains Qt libraries and all relevant plugins.\u003cbr/\u003e\n### Linux\nAll packages are being built on ubuntu-latest environment. Refer to [this](https://github.com/actions/virtual-environments) page to determine the exact Ubuntu version. You may experience problems with missing or incompatible libraries when trying to run the package on other distros. \n\nTo run standalone version use CANdevStudio.sh script.\n### ARCH Linux\nInstall AUR package: [candevstudio-git](https://aur.archlinux.org/packages/candevstudio-git/)\n\n### Windows\nPackages built with Visual Studio 2019.\n\nStandalone version contains Qt. Installation of VS2019 redist packages may be still required. \n### macOS / OS X\nPackage is a DMG installer.\n## Quick Start\nGeneral instructions to start your first simulation:\n1. Build the latest master or release.\n2. Run the application and start a new project\n3. Drag and drop CanDevice and CanRawView components and connect them accordingly.\n4. Double click on CanDevice node to open configuration window.\n   1. set one of supported backends (e.g. socketcan) [link](http://doc.qt.io/qt-5.10/qtcanbus-backends.html).\u003cbr/\u003e**NOTE:** List of supported backends depends on Qt version.\n   2. set name of your can interface (e.g. can0)\n5. Start the simulation\n6. Double click on CanRawView component to see CAN traffic\n\nSteps required to use specific CAN hardware or virtual interfaces require some additional steps listed in following sections.\n### CAN Hardware\nThe list below shows hardware that has been successfully used with CANdevStudio.\n#### Microchip CAN BUS Analyzer\n* Tested on Linux\n* Requires socketcan [driver](https://github.com/rkollataj/mcba_usb).\n* Officially supported in Linux Kernel v4.12+\nConfiguration:\n1. Find your interface name (e.g. can0) \u003cbr/\u003e\n```ip link```\n2. Configure bitrate\u003cbr/\u003e\n```sudo ip link set can0 type can bitrate 1000000```\n3. Bring the device up\u003cbr/\u003e\n```sudo ip link set can0 up```\n4. Optionally configure CAN termination\n   1. In GitHUB based driver \u003cbr/\u003e\n   ```sudo ip link set can0 type can termination 1```\n   2. In Linux 4.12+ driver\u003cbr/\u003e\n   ```sudo ip link set can0 type can termination 120```\n\nCanDevice backend: socketcan\n\n#### Lawicel CANUSB\n* Tested on Linux\n* Based on FTDI Serial driver\n* Requires slcand to \"convert\" serial device to SocketCAN.\n* Officially supported in Linux Kernel v2.6.38\n\nConfiguration:\n1. Create SocketCAN device from serial interface\u003cbr/\u003e\n```sudo slcand -o -c -s8 -S1000000 /dev/ttyUSB0 can0```\n2. Bring the device up\u003cbr/\u003e\n```sudo ip link set can0 up```\n\nCanDevice backend: socketcan\n\n#### PeakCAN PCAN-USB\n* Tested on Windows\n\nCanDevice settings example:\n```\nbackend: peakcan\ninterface: usb0\nconfiguration: BitRateKey = 250000\n```\n#### PassThruCAN Plugin\n* Tested on Windows\n\nCanDevice settings example for PEAK-PCAN:\n```\nbackend: passthrucan\nconfiguration: BitRateKey = 250000\ninterface: PCANPT32\n```\nCanDevice settings example for SIE_CANUSB:\n```\nbackend: passthrucan\nconfiguration: BitRateKey = 250000\ninterface: CANUSB\n```\nCanDevice settings example for Kvaser USBcan:\n```\nbackend: passthrucan\nconfiguration: BitRateKey = 250000\ninterface: J2534 (kline) for Kvaser Hardware\n```\n### CANdevStudio without CAN hardware\nCANdevStudio can be used without actual CAN hardware thanks to Linux's built-in emulation.\n#### VCAN\nConfiguration:\n```\nsudo modprobe vcan\nsudo ip link add dev can0 type vcan\nsudo ip link set can0 up\n```\nCanDevice backend: socketcan\n#### Cannelloni\nA SocketCAN over Ethernet tunnel. Available for Linux only.\n\nLet's consider setup as before:\n\u003cp align=\"left\"\u003e\n\u003cimg src=\"https://at.projects.genivi.org/wiki/download/attachments/14976114/CANdevStudio-cannelloni.png\" width=\"50%\" /\u003e\n\u003c/p\u003e\n\n##### Configuration with qtCannelloniCanBusPlugin\nTarget configuration:\n```\nsudo modprobe vcan\nsudo ip link add dev can0 type vcan\nsudo ip link set can0 up\ncannelloni -I can0 -R 192.168.0.1 -r 30000 -l 20000\n```\nPC configuration:\n\n1. Install libqtCannelloniCanBusPlugin.so that is built along with CANdevStudio. You can either copy it manually to Qt plugins directory (e.g. /usr/lib/qt/plugins/canbus) or use \"make install\" to do it automatically.\n2. Create new project in CANdevStudio and add CanDevice node\n3. Configure CanDevice:\n   1. backend: cannelloni\n   2. interface: 30000,192.168.0.2,20000 (local_port,remote_ip,remote_port)\n4. Start simulation\n\n##### Configuration without qtCannelloniCanBusPlugin\nTarget configuration:\n```\nsudo modprobe vcan\nsudo ip link add dev can0 type vcan\nsudo ip link set can0 up\ncannelloni -I can0 -R 192.168.0.1 -r 30000 -l 20000\n```\nPC configuration:\n1. Execute following lines in a shell\n```\nsudo modprobe vcan\nsudo ip link add dev can0 type vcan\nsudo ip link set can0 up\ncannelloni -I can0 -R 192.168.0.2 -r 20000 -l 30000\n```\n2. Create new project in CANdevStudio and add CanDevice node\n3. Configure CanDevice:\n   1. backend: socketcan\n   2. interface: can0\n4. Start simulation\n\n## Help\n### Scripting\nAs of v1.1 CANdevStudio supports creation of [QML](https://doc.qt.io/qt-5/qmlapplications.html) based scripts. Scripts can be developed and loaded dynamically without a need to restart the main applications. Scripting adds a lot of different possibilities to CANdevStudio that includes:\n* Creation of custom GUIs\n* Raw frames and signals handling\n* Time triggered actions\n* Message triggered actions\n* ... and many more, as all QML functionalities are supported.\n\nTry it yourself by loading one of the [examples](https://github.com/GENIVI/CANdevStudio/tree/master/src/components/qmlexecutor/examples) into QMLExecutor component. You are welcome to share your scripts via Pull Requests!\n\n### CAN Signals\nCANdevStudio provides support for CAN signals handling. [DBC](http://socialledge.com/sjsu/index.php/DBC_Format) database description format is supported. Reverse engineered DBC files can be found in [opendbc](https://github.com/commaai/opendbc) project.\n\nSupport for others CAN database formats can be added via extension of [CANdb](https://www.github.com/GENIVI/CANdb).\n\n#### Sending signals\n1. Start new project and setup CanDevice as described in quick start section\n2. **Add CanSignalData** component that serves as CAN signals database for other components. You may have multiple CanSignalData components per projecthttps://github.com/commaai/opendbc\n3. Open CanSignalData properties and configure path to DBC file\n4. List of messages and signals shall be now loaded and visible in CanSignalData window\n5. You may configure cycle and initial value per each message\n6. **Add CanSignalEncoder** component and connect it with CanDevice. CanSignalEncoder act as a translator between signals and CAN frames. It is also  responsible for sending cyclical messages.\n7. CanSignalSender has been automatically configured to use previously added CAN database. CAN database can be manually selected in component properties (this applies to all components from \"Signals\" group)\n8. **Add CanSignalSender** component and connect it with CanSignalEncoder\n9. Add signals in CanSignalSender window\n10. Start simulation\n11. CanSignalEncoder will start sending cyclical messages\n12. You can send previously configured signals from CanSignalSender:\n    * if signal is a part of periodic message its value will be updated in a next cycle\n    * if signal is not a part of periodic message it will be sent out immediately\n\n#### Receiving signals\n1. Start new project and setup CanDevice as described in quick start section\n2. **Add CanSignalData** component that serves as CAN signals database for other components. You may have multiple CanSignalData components per project\n3. Open CanSignalData properties and configure path to DBC file\n4. List of messages and signals shall be now loaded and visible in CanSignalData window\n5. **Add CanSignalDecoder** component and connect it with CanDevice. CanSignalDecoder act as a translator between signals and CAN frames.\n6. CanSignalDecoder has been automatically configured to use previously added CAN database. CAN database can be manually selected in component properties (this applies to all components from \"Signals\" group)\n7. **Add CanSignalViewer** component and connect it with CanSignalDecoder\n8. Start simulation\n9. Signals shall now appear in CanSignalViewer. Note that CanSignalDecoder is sending over only signals which values has changed.\n\n### CanDevice configuration\nCanDevice component can be configured using \"configuration\" property:\n* Format - \"key1=value1;key2=value2;keyX=valueX\"\n* Keys names are case sensitive, values are case insensitive\n* Configuration keys are taken from [ConfigurationKey enum](https://doc.qt.io/qt-5/qcanbusdevice.html#ConfigurationKey-enum). \n* RawFilterKey and ErrorFilterKey are currently not supported\n* Whitespaces are ignored\n\nE.g.\n```\nBitRateKey=100000;ReceiveOwnKey=false;LoopbackKey=true\n```\n### CanRawFilter\nCanRawFilter component enables to filter (i.e. accept or drop) incoming and outgoing frames:\n* [Qt](https://doc.qt.io/qt-5/qregularexpression.html) regular expressions are used to match filter rules.\n* Rules are matched from top to bottom\n* Default policy is applied to frames unmatched by any filter\n\nExamples:\n* match 0x222 and 0x333 frames only [id field]\n```\n222|333\n```\n* match 0x200 - 0x300 frames only [id field]\n```\n^[23]..$\n```\n* match empty payload (DLC 0) [payload field]\n```\n^$\n```\n* match 2 byte payload (DLC 2) [payload field]\n```\n^.{4}$\n```\n### Adding new components\n1. Configure build to include *templategen* tool\n```\ncd build\ncmake .. -DWITH_TOOLS=ON\nmake\n```\n2. Generate component (use -g option if you don't need component to have GUI)\n```\n./tools/templategen/templategen -n MyNewComponent -o ../src/components -g\n```\n3. CMake script automatically detects new components. It has to be invoked manually.\n```\ncmake ..\n```\n4. Build project \n``` \nmake\n```\n5. Your component is now integrated with CANdevStudio\n6. You may want to modify *src/components/mynewcomponent/mynewcomponentplugin.h* to configure section name, color and spacing\n7. Define component inputs and outputs in *src/components/mynewcomponent/mynewcomponentmodel.cpp*. Look for examples in other components.\n8. Modify automatically generated unit tests *src/components/mynewcomponent/tests*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGENIVI%2FCANdevStudio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGENIVI%2FCANdevStudio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGENIVI%2FCANdevStudio/lists"}