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/core

Lightweight embedded-style runtime for Embedded32: cooperative scheduler, in-process message bus, module base class, and configuration loading.

Installation

npm install @embedded32/core

Minimum runnable example

import { Runtime, BaseModule } from '@embedded32/core';

class HelloModule extends BaseModule {
  onInit() {
    this.log('initialized');
  }
  onStart() {
    this.bus.subscribe('ping', () => this.log('pong'));
    this.bus.publish('ping', {});
  }
  onStop() {
    this.log('stopped');
  }
}

const runtime = new Runtime({ logLevel: 'info' });
runtime.registerModule(new HelloModule('hello'));
await runtime.start();
await runtime.stop();

See embedded32-core/examples/basic-runtime.ts in the monorepo.

Public API overview

ExportRole
RuntimeOrchestrates modules, scheduler, bus, logger
BaseModuleAuthor modules with onInit / onStart / onStop
MessageBusTopic pub/sub between modules
Schedulerevery, once, clear timers
Built-in modulesHeartbeat, health, LED, CAN gateway helpers

Runtime requirements

  • Node.js 18+
  • CommonJS or ESM depending on consumer bundler (package builds to ESM dist/)

Hardware requirements

None for core runtime alone. GPIO/LED modules need Raspberry Pi hardware when enabled.

Browser compatibility

Node.js focused. Scheduler and message bus are not packaged for browser use in v1.0.

Common errors

ErrorFix
Module never receives eventsCall runtime.start() after registerModule
subscribe after stopRe-subscribe in onStart
Config file not foundPass valid configPath or omit for defaults
  • @embedded32/supervisor - process-level module lifecycle
  • @embedded32/cli - launch runtime from configuration
  • @embedded32/can - CAN modules inside runtime apps
  • @embedded32/j1939 - protocol modules

Version compatibility

@embedded32/core@1.0.0 matches supervisor and CLI 1.0.0 in this release train.

License

MIT © Mukesh Mani Tripathi