OCPP WS IOocpp-ws-io

Comparison & Approaches

Technical breakdown of how ocpp-ws-io approaches EV charging architecture, clustering, typing, and protocol validation alongside other Node.js solutions and platforms.

Architectural Comparison & Technical Approaches

Building a scalable OCPP Central System (CSMS) or Station Client involves navigating multiple architectural decisions: type safety, schema validation, horizontal clustering, smart charging algorithms, framework integration (NestJS, Express), and protocol translation.

The ocpp-ws-io ecosystem was engineered from the ground up to solve these challenges natively in TypeScript. Below is a technical breakdown examining different architectural approaches across Node.js tools, legacy packages, and turnkey CSMS platforms like CitrineOS.


1. Feature Matrix Overview

Feature / Capabilityocpp-ws-io@voltbras/ts-ocppocpp-rpcocpp-eliftechCitrineOS (LF Energy)
Last npm release3.1.0-beta.3, October 20262.7.3, March 20222.2.1, July 20251.0.2, April 2019—
OCPP 1.6-J Support✅ Full + Ajv Schema✅ Supported (and OCPP 1.5 over SOAP)✅ Supported + schemas in strict mode✅ Supported✅ Supported
OCPP 2.0.1 Support✅ Full + OCA Schemas❌ No✅ Supported + schemas in strict mode❌ No✅ Full
OCPP 2.1 Support✅ Full + OCA Schemas❌ No✅ Supported + schemas in strict mode❌ No⚠️ In Progress
NestJS First-Class Module✅ Native @OcppGateway❌ Manual boilerplate❌ No❌ No❌ No (Fastify stack)
TypeScript Type Safety✅ Zero any, OCA schemas✅ Good OOP types⚠️ .d.ts shipped, payloads typed any / unknown❌ No type declarations✅ TypeScript
Redis Multi-Pod Clustering✅ Built-in RedisAdapter❌ Memory-only❌ No❌ No⚠️ RabbitMQ based
Smart Charging Engine✅ ocpp-ws-io/smart-charge❌ No❌ No❌ No⚠️ Module based
Live Protocol Translation✅ ocpp-ws-io/proxy❌ No❌ No❌ No❌ No
Architecture Footprint⚡ Embeddable & Lightweight⚡ Lightweight⚡ Lightweight⚡ Lightweight🏢 Platform Stack (RabbitMQ, Hasura, Postgres)

2. Comparing Architectural Models: CitrineOS (LF Energy / S44)

CitrineOS is an open-source Charging Station Management System hosted under LF Energy (Linux Foundation Energy).

CitrineOS Design

  • Platform Stack: Built as a comprehensive, standalone CSMS platform.
  • Infrastructure: Operates with PostgreSQL (with PostGIS), RabbitMQ message broker, and Hasura GraphQL services.
  • Focus: Turnkey network operations, NEVI compliance goals, and pre-configured device schemas.

ocpp-ws-io Design

  • Embeddable Toolkit: Built as an unopinionated, modular library suite. You install npm install ocpp-ws-io into your existing application or microservice architecture.
  • Framework Integration: Native @OcppGateway decorators for NestJS, Express, Fastify, and Hono, allowing WebSocket upgrade routes to live directly alongside your existing REST APIs on the same port.
  • Database Freedom: Zero mandated database schema or external message brokers; works with Prisma, Drizzle, TypeORM, MongoDB, or pure in-memory stores.
  • Protocol Translation Layer: ocpp-ws-io/proxy bridges legacy OCPP 1.6 stations to OCPP 2.1 systems dynamically on the wire.

3. Comparing with ocpp-rpc

ocpp-rpc is the most downloaded OCPP-J library on npm. It is an RPC layer: a server and a client, an auth callback, handlers, and strict-mode validation.

Key Strengths

  • A small, well-documented API.
  • Strict mode validates against the schemas of OCPP 1.6, 2.0.1 and 2.1.
  • Security profiles 1 to 3. Basic Auth passwords are kept as raw bytes, and TLS comes from your own https server.

ocpp-ws-io Approach

  • The same model, typed per action: ocpp-ws-io keeps ocpp-rpc's server, handlers, auth callback and strict mode. It also types each action's request and answer from protocols. ocpp-rpc types payloads as any / unknown.
  • More than the RPC layer: Redis clustering, routing by URL, framework adapters, the protocol proxy and the smart charge engine.
  • Moving over: Migrating from ocpp-rpc maps the API, and lists the defaults and error replies that differ.

4. Comparing with @voltbras/ts-ocpp

@voltbras/ts-ocpp is a respected TypeScript-first library that popularized typed OCPP in Node.js.

Key Strengths

  • Clean class-based object-oriented API.
  • Strong typing for OCPP 1.6-J messages.
  • OCPP 1.5 over SOAP, which ocpp-ws-io does not support.
  • Established community adoption.

ocpp-ws-io Approach

  • Moving over: Migrating from @voltbras/ts-ocpp maps the API, and lists what changes for validation, errors and connections.
  • Horizontal Scaling & Clustering: ts-ocpp manages connections in-memory on a single process. Scaling across Kubernetes pods requires developers to build custom pub/sub routing. ocpp-ws-io includes an out-of-the-box RedisAdapter with O(1) station routing and presence heartbeats.
  • Multi-Protocol Negotiation: ocpp-ws-io provides complete support for OCPP 2.0.1 and OCPP 2.1 alongside 1.6, allowing single servers to negotiate multiple protocols simultaneously.
  • Built-in Rate Limiting: Built-in token-bucket rate limiters drop rogue station floods (such as high-frequency MeterValues) before JSON deserialization.

5. Comparing with ocpp-eliftech

ocpp-eliftech is one of the earliest production Node.js OCPP implementations.

Key Strengths

  • Proven track record in early OCPP 1.6-J commercial deployments.
  • Simple, unopinionated core.

ocpp-ws-io Approach

  • Modern Protocol Architecture: eliftech is constrained to OCPP 1.6. ocpp-ws-io handles 1.6, 2.0.1, and 2.1 with shared connection interfaces.
  • Framework Adapters: Dedicated adapters for NestJS, Express, Fastify, and Hono.
  • Observability: Seamless integration with voltlog-io for structured protocol telemetry.

Summary: Architecture Selection Guide

Architectural GoalRecommended Approach
Build an embeddable, type-safe OCPP 1.6/2.0.1/2.1 backend in NestJS or Expressocpp-ws-io
Dynamic grid load balancing & smart charging math across chargersocpp-ws-io/smart-charge
Translate legacy 1.6 chargers to a 2.1 central backend on the wireocpp-ws-io/proxy
Deploy a standalone platform CSMS with RabbitMQ and PostgreSQLCitrineOS
Interactive terminal simulator for QA and stress-testingocpp CLI (ocpp-ws-io)
Move an existing ocpp-rpc, @voltbras/ts-ocpp or ocpp-ts projectMigration guides

On this page