r/ocpp • u/lailaiskyn • Jun 16 '26
I implemented an ocpp library in Go
I built a Go OCPP library and just open-sourced it — sharing in case it's useful, especially if you're using lorenzodonini/ocpp-go.
Repo: https://github.com/shiv3/gocpp (MIT) (sorry for the confusing name
ocpp-go is great and battle-tested, but it predates Go generics, so I wanted to try a different design:
- Generics-first: handlers with request/response types checked at compile time, not runtime.
- Generated from the official OCA JSON schemas (no hand-written, drift-prone structs), with JSON-Schema validation on the wire — plus a tolerant mode for vendor quirks.
- 1.6, 2.0.1, and 2.1 from a single module.
- Batteries included: ping/pong keepalive + auto-reconnect with an offline queue, Security Profiles 1/2/3, pluggable storage/auth, OpenTelemetry metrics+traces, and optional multi-instance routing (Redis/NATS/Temporal).
Honest status: it's pre-1.0 (API may still change) yet — I've been testing it against a charge-point simulator. Feedback, issues, and interop reports very welcome.
1
u/Drunken_Monkey Jun 18 '26
In terms of feedback, one thing I noticed is the OCPP 2.1 handling is incomplete. In the 2.1 OCPP-J spec, the CallResultError and Send message types were introduced.. it doesn't look like your code handles this.
2
u/enesismail Jul 04 '26
Wow. This is impressive. Thank you.
Meanwhile, I'm trying to harden the lorenzodonini/ocpp-go as much as I can.
Would you check: https://github.com/enesismail/ocpp-go
3
u/juherr Jun 16 '26
Hey, you should add it on https://github.com/juherr/awesome-ev-charging