{"id":21549146,"url":"https://github.com/pschichtel/virtualecu","last_synced_at":"2025-04-10T06:07:35.107Z","repository":{"id":139338390,"uuid":"161716620","full_name":"pschichtel/VirtualECU","owner":"pschichtel","description":"ECU simulator","archived":false,"fork":false,"pushed_at":"2024-12-11T00:08:23.000Z","size":90,"stargazers_count":41,"open_issues_count":0,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-10T06:07:22.750Z","etag":null,"topics":["can","ecu","obd-ii","obd2","scala","simulator","socketcan"],"latest_commit_sha":null,"homepage":"https://schich.tel","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pschichtel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"pschichtel"}},"created_at":"2018-12-14T01:41:58.000Z","updated_at":"2025-04-05T19:21:06.000Z","dependencies_parsed_at":"2023-12-03T20:20:21.955Z","dependency_job_id":"c7137a5f-d810-41e6-a112-6b5b5ef3d153","html_url":"https://github.com/pschichtel/VirtualECU","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/pschichtel%2FVirtualECU","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschichtel%2FVirtualECU/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschichtel%2FVirtualECU/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschichtel%2FVirtualECU/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pschichtel","download_url":"https://codeload.github.com/pschichtel/VirtualECU/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166925,"owners_count":21058481,"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":["can","ecu","obd-ii","obd2","scala","simulator","socketcan"],"created_at":"2024-11-24T06:21:26.816Z","updated_at":"2025-04-10T06:07:35.032Z","avatar_url":"https://github.com/pschichtel.png","language":"Scala","funding_links":["https://github.com/sponsors/pschichtel"],"categories":[],"sub_categories":[],"readme":"# VirtualECU\n\nThis project implements an ECU simulator completely in software. The simulated communication is initially limited to standardized OBD-II requests, but can easily be extended to support additional standards or even non-standard protocols.\n\nIts CAN and ISOTP layers are powered by the [JavaCAN](https://github.com/pschichtel/JavaCAN) project using the Linux kernel's SocketCAN API. The OBD communication protocol implementation is provided by [obd4s](https://github.com/pschichtel/obd4s), a Scala library built on top of JavaCAN to provide proper standards compliant OBD-II communication.\n\n## What works so far\n\n* Simulating multiple ECUs\n* Functional and physical addressing, for SFF, EFF and mixed frames\n* Configuring time series functions per service and subfunction either by providing a compiled Java class or by using Scala expressions directly in the configuration\n* Invalid requests will result in appropriate error responses\n* Can be used with real CAN devices or a virtual device\n\n## How to Run\n\nThe project takes 2 required parameters:\n\n1. the CAN device name\n2. the configuration file (see config.yaml in this repository for an example)\n\nExecuting the program will also print the usage.\n\n## The Configuration\n\nA simple example would look like this:\n\n```yaml\ncontrollers:\n  \"7E0\":\n    name: Engine\n    services:\n      \"01\":\n        name: Live Data\n        action:\n          generator: \"constant(1.0) andThen unsignedInteger(1)\"\n        parameters:\n          \"05\":\n            name: Coolant Temperature\n            action:\n              generator: \"linear(1, 8.minutes)\"\n```\n\nThe `controllers` field is a map from functional ECU CAN address (in hex) to ECU objects.\n\nEach ECU consists of a `name` and a list of services. The `services` field is a map from service ID byte (in hex) to service objects.\n\nEach service consists of a `name`, an optional action and parameters. The `parameters` field is a map from parameter id byte (in hex) to parameters.\n\nEach parameter consists of a `name` and an action.\n\nActions have either a `generator` or an `explicit`. `generator` is a scala expression of type `Double =\u003e Array[Byte]`, so a function that takes a doubel and produces a byte array. All functions defined in `Functions.scala` are implicitly available to these expressions. `explicit` is a fully qualified class name of a class that implements the `Action` interface.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschichtel%2Fvirtualecu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpschichtel%2Fvirtualecu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschichtel%2Fvirtualecu/lists"}