Multi-ECU J1939 vehicle simulation for Embedded32 - engine, transmission, brakes, aftertreatment, and profile-based SimulationRunner for classroom labs.
npm install @embedded32/sim @embedded32/can @embedded32/j1939 @embedded32/core
CLI (no code): from monorepo root after npm run build:
npx embedded32-tools simulate vehicle/basic-truck
Programmatic:
import { SimulationRunner } from '@embedded32/sim';
const runner = new SimulationRunner();
await runner.loadProfile('vehicle/basic-truck');
await runner.start();
// decoded traffic via tools or your CAN hooks
await runner.stop();
| Export | Role |
|---|---|
SimulationRunner |
Load profile, start/stop multi-ECU sim |
VehicleSimulator |
Higher-level vehicle with scenarios |
EngineSimulator, TransmissionSimulator, … |
Individual ECU actors |
EngineECU, TransmissionECU, DiagnosticToolECU |
Profile-oriented ECU classes |
DeterministicScheduler |
Repeatable tick timing for tests |
@embedded32/can, @embedded32/j1939, @embedded32/coreNone - simulation uses virtual/mock CAN. Optional SocketCAN only if you bridge sim output to vcan0.
Node.js only in v1.0. The site browser demo at /demo plays prerecorded synthetic traces.
| Error | Fix |
|---|---|
| Profile not found | Use vehicle/basic-truck exactly |
| No traffic | Ensure runner.start() and wait for tick interval |
| Import errors | npm run build at monorepo root |
@embedded32/tools - embedded32-tools simulate command@embedded32/j1939 - decode simulated PGNs@embedded32/can - virtual bus attachmentKeep @embedded32/sim@1.0.0 aligned with j1939 and can 1.0.0.
MIT © Mukesh Mani Tripathi