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/sdk-js

Stable JavaScript/TypeScript J1939 client SDK for applications that subscribe to PGNs, request data, and send commands over configurable transports.

Installation

npm install @embedded32/sdk-js @embedded32/j1939

Minimum runnable example

import { J1939Client, PGN, SA } from '@embedded32/sdk-js';

const client = new J1939Client({
  interface: 'virtual',
  sourceAddress: SA.DIAG_TOOL_2,
  transport: 'virtual',
});

await client.connect();

client.onPGN(PGN.EEC1, (msg) => {
  console.log('EEC1', msg.pgnName, msg.spns);
});

await client.disconnect();

See embedded32-sdk-js/examples/basic-j1939.ts in the monorepo.

Public API overview

ExportRole
J1939Clientconnect, disconnect, onPGN, requestPGN, sendPGN
PGN, SACommon parameter group and source-address constants
J1939ClientConfig, J1939MessagePublic types

Not public: @embedded32/sdk-js/internal - may change without notice.

Runtime requirements

  • Node.js 18+
  • ESM
  • Transport backend (virtual, socketcan, etc.) per config

Hardware requirements

virtual transport needs no hardware. socketcan requires Linux CAN interface.

Browser compatibility

Virtual transport and decode-only paths are bundled in the site demo (apps/demo, route /demo). SocketCAN is not browser-available.

Common errors

ErrorFix
connect() fails on socketcanCheck interface name and permissions
Empty spns objectPGN decoder may not cover all fields
Deep import from /internalUse documented public exports only
  • @embedded32/j1939 - protocol decoding layer
  • @embedded32/can - CAN drivers for socketcan transport
  • @embedded32/bridge - network-fed virtual transports (advanced)

Version compatibility

Public SDK API marked stable at v1.0.0. Pin @embedded32/sdk-js@1.0.0 with @embedded32/j1939@1.0.0.

License

MIT © Mukesh Mani Tripathi