Introduction
The complete, type-safe OCPP ecosystem for Node.js — RPC, Smart Charging, Protocol Translation, and Simulation.
The complete, type-safe OCPP ecosystem for Node.js.
Historically, building an OCPP-compliant network has been an infrastructure nightmare. ocpp-ws-io ecosystem provides a modular, plug-and-play suite of tools built from the ground up in TypeScript to solve the hardest challenges in EV charging: end-to-end WebSocket RPC, Smart Charging power distribution, legacy-to-modern Protocol Translation, and enterprise-grade Load Testing.
Transparency: This ecosystem is a newer, open-source suite of libraries. It has been tested in controlled environments and small deployments — not yet at the scale of established standalone libraries like ts-ocpp or ocpp-eliftech. We built it to solve specific infrastructure gaps (clustering, smart charging math, proxying) that weren't addressed by existing tools. If you find issues, please report them.
🌍 The Ecosystem
Building a Charge Point Management System (CSMS) or Simulator shouldn't require you to invent everything from scratch. Our modular approach splits the complexities of the protocol into fully tested, interoperable packages.
1. Core RPC (ocpp-ws-io)
The foundational WebSocket RPC library. End-to-end type safety, JSON schema validation, Security Profiles 0-3 (mTLS), and Redis clustering.
2. Protocol Proxy (ocpp-protocol-proxy)
Seamlessly translate legacy OCPP 1.6 chargers to modern 2.1 central systems using transport-agnostic middleware pipelines.
3. Smart Charge Engine (ocpp-smart-charge-engine)
A library-agnostic mathematical solver that distributes constraint-limited grid power safely among active EV charging sessions.
4. Terminal & Testing (ocpp-ws-cli)
The ultimate developer tooling. Boot virtual charge points in your terminal, generate local certs, and hurl load-test spikes at your server.
5. Visual Simulator (ocpp-ws-simulator)
A full-featured browser GUI emulator for visual debugging and demos. Try it live at ocpp.rohittiwari.me
6. Observability (voltlog-io)
High-performance, structured logging layer powering the ecosystem's network diagnostics.
Architecture Overview
The true power of the ecosystem is how effortlessly the components integrate:
Quick Starts
Choose the package you want to explore first:
Instantiate a strictly-typed WebSocket server with ocpp-ws-io.
npm install ocpp-ws-ioimport { OCPPServer } from "ocpp-ws-io";
const server = new OCPPServer({ protocols: ["ocpp1.6", "ocpp2.1"] });
server.on("client", (client) => {
client.handle("ocpp1.6", "BootNotification", ({ params }) => {
return { status: "Accepted", currentTime: new Date().toISOString(), interval: 300 };
});
});
await server.listen(3000);Distribute 100kW of grid power fairly across multiple cars without tripping the breaker.
npm install ocpp-smart-charge-engineimport { SmartChargingEngine, Strategies } from "ocpp-smart-charge-engine";
const engine = new SmartChargingEngine({
siteId: "SITE-001",
maxGridPowerKw: 100,
algorithm: Strategies.EQUAL_SHARE,
// Pass the computed charging limits strictly back down
dispatcher: async ({ clientId, sessionProfile }) => {
await server.safeSendToClient(clientId, "ocpp1.6", "SetChargingProfile", /*...*/);
},
});
await engine.dispatch(); Let legacy OCPP 1.6 hardware communicate with a purely OCPP 2.1 backend.
npm install ocpp-protocol-proxyimport { OCPPProtocolProxy, presets } from "ocpp-protocol-proxy";
const proxy = new OCPPProtocolProxy({
upstreamEndpoint: "wss://modern-csms:9000",
upstreamProtocol: "ocpp2.1",
});
// Automatically map 1.6 BootNotification to 2.1 BootNotification
proxy.translate(presets.ocpp16_to_ocpp21);