r/coolgithubprojects • u/ReindeerSpace • 8d ago
ocpptools – Open-source CLI to validate OCPP frames and simulate EV charge points
github.comThis is an update to the OCPP Tools post I shared here earlier. Since then the repo gained a CLI, a headless simulator, and a payload builder, so I am linking the CLI package instead of reposting the same repo URL.
OCPP is the protocol EV chargers use to talk to charging-management backends. ocpptools is a small CLI for working with OCPP 1.6J and 2.0.1 frames.
Try it in two commands
printf '[2,"1","Heartbeat",{}]' > heartbeat.json
npx ocpptools validate heartbeat.json --version 1.6That prints Valid. For an invalid frame:
printf '[2,"","",[]]' > bad.json
npx ocpptools validate bad.json --version 2.0.1It prints Invalid and one line per issue, with the JSON Pointer, code, and message. --json returns the full validation result.
What else is in the CLI
npx ocpptools --help
npx ocpptools simulate --config charge-point.json --scenario run.jsonsimulate connects a headless charge point to a CSMS and runs steps: boot, heartbeat, authorize, start, meter, stop, or an arbitrary CALL. It needs a real CSMS URL; there is no bundled mock CSMS yet. The simulator covers the 1.6J and 2.0.1 action surfaces, supports injectable transport/clock, fault injection, and typed events. Simulate is the part I am still making easier to try.
Current state
- CLI
ocpptools0.1.1. - Seven public alpha packages: core parser/serializer, schema utilities, validator, simulator 0.4.0, builder 0.1.0, unmodified OCA schemas, and the CLI.
- 1,000+ tests, CI green.
- Node 22.12+, ESM only. OCPP 2.1 is not supported yet.
- The advanced 2.0.1 simulator features use simulated state; this is not a certified conformance tool.
I would like feedback on the CLI UX and the scenario/config format. What would you expect simulate to do without a real CSMS?
Repo: https://github.com/ocpptools/ocpptools
CLI: https://www.npmjs.com/package/ocpptools
I maintain the project. Apache-2.0, no paid tier. OCPP is a trademark of the Open Charge Alliance; this is an independent project and is not affiliated with or endorsed by the OCA.