EDUCATION BUILD // NOT SAFETY-CERTIFIED // SYNTHETIC DEMO DATAEmbedded32 is for learning and prototyping - not automotive-certified, safety-certified, or a complete SAE J1939 stack.
Embedded32
Menu

@embedded32/sim

Multi-ECU J1939 vehicle simulation for Embedded32 - engine, transmission, brakes, aftertreatment, and profile-based SimulationRunner for classroom labs.

Installation

npm install @embedded32/sim @embedded32/can @embedded32/j1939 @embedded32/core

Minimum runnable example

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();

Public API overview

ExportRole
SimulationRunnerLoad profile, start/stop multi-ECU sim
VehicleSimulatorHigher-level vehicle with scenarios
EngineSimulator, TransmissionSimulator, …Individual ECU actors
EngineECU, TransmissionECU, DiagnosticToolECUProfile-oriented ECU classes
DeterministicSchedulerRepeatable tick timing for tests

Runtime requirements

  • Node.js 18+
  • Built dependencies: @embedded32/can, @embedded32/j1939, @embedded32/core

Hardware requirements

None - simulation uses virtual/mock CAN. Optional SocketCAN only if you bridge sim output to vcan0.

Browser compatibility

Node.js only in v1.0. The site browser demo at /demo plays prerecorded synthetic traces.

Common errors

ErrorFix
Profile not foundUse vehicle/basic-truck exactly
No trafficEnsure runner.start() and wait for tick interval
Import errorsnpm run build at monorepo root
  • @embedded32/tools - embedded32-tools simulate command
  • @embedded32/j1939 - decode simulated PGNs
  • @embedded32/can - virtual bus attachment

Version compatibility

Keep @embedded32/sim@1.0.0 aligned with j1939 and can 1.0.0.

License

MIT © Mukesh Mani Tripathi