{"id":19384203,"url":"https://github.com/windelbouwman/virtualcan","last_synced_at":"2025-04-23T21:32:08.783Z","repository":{"id":35266722,"uuid":"179013380","full_name":"windelbouwman/virtualcan","owner":"windelbouwman","description":"Virtual CAN bus","archived":false,"fork":false,"pushed_at":"2023-06-14T16:32:45.000Z","size":101,"stargazers_count":32,"open_issues_count":5,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-02T20:22:28.815Z","etag":null,"topics":["controller-area-network","python","rust"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/windelbouwman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-02T06:30:01.000Z","updated_at":"2025-02-13T15:34:50.000Z","dependencies_parsed_at":"2022-09-16T00:11:24.570Z","dependency_job_id":null,"html_url":"https://github.com/windelbouwman/virtualcan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windelbouwman%2Fvirtualcan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windelbouwman%2Fvirtualcan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windelbouwman%2Fvirtualcan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windelbouwman%2Fvirtualcan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/windelbouwman","download_url":"https://codeload.github.com/windelbouwman/virtualcan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250518033,"owners_count":21443884,"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":["controller-area-network","python","rust"],"created_at":"2024-11-10T09:29:33.580Z","updated_at":"2025-04-23T21:32:08.116Z","avatar_url":"https://github.com/windelbouwman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n[![Build Status](https://travis-ci.org/windelbouwman/virtualcan.svg?branch=master)](https://travis-ci.org/windelbouwman/virtualcan)\r\n\r\n# Virtual CAN bus\r\n\r\nVirtual [CAN bus](https://en.wikipedia.org/wiki/CAN_bus). Send CAN messages over a virtual can bus.\r\n\r\n# Use case\r\n\r\nA virtual can bus can be useful during development of a CAN based system.\r\n\r\n# Usage\r\n\r\n## Server\r\n\r\nTo start the virtual CAN server, use the rust implementation:\r\n\r\n    $ cd rust/server\r\n    $ cargo run --release -- --port 18881\r\n\r\n## Python\r\n\r\nTo use this from python, install the python-can package, and next the virtualcan module:\r\n\r\n    $ pip install python-can\r\n    $ cd python\r\n    $ pip install .\r\n\r\nNow, from python, use the virtualcan interface as follows:\r\n\r\n```python\r\nimport can\r\n\r\nbus = can.Bus(interface='virtualcan', channel='localhost:18881')\r\nbus.send(can.Message(arbitration_id=13, data=[1, 2, 3, 4, 5]))\r\n```\r\n\r\n## C++\r\n\r\nRefer to [the C++ demo](cpp/demo).\r\n\r\nTo build the C++ demo, use cmake:\r\n\r\n    $ cd cpp\r\n    $ mkdir build\r\n    $ cd build\r\n    $ cmake ..\r\n    $ make\r\n    $ cd demo\r\n    $ virtualcan_demo.exe\r\n\r\n# Roadmap\r\n\r\n- C++ implementation of TCP client\r\n- Rust implementation of TCP client/server\r\n- C# implementation of TCP client\r\n\r\n# Design\r\n\r\nThe zero-m-can server listens to port 5555 (req-rep) and port 5556 (pub-sub). Messages are encoded\r\nas msgpack data.\r\n\r\nAPI:\r\n- get_version() -\u003e int\r\n    - get the version of this protocol. Current version: 1\r\n- new_client() -\u003e str\r\n    - Create a new client name. Returns the client name.\r\n- send_message(client: str, id: int, extended: bool, data: list[int]) -\u003e int\r\n    - Send a message on the bus for the given client. Given are an id, extended marker and data.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindelbouwman%2Fvirtualcan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindelbouwman%2Fvirtualcan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindelbouwman%2Fvirtualcan/lists"}