Skip to content

v2.0.1 — OCPP 2.0.1 Full Implementation + Code Review

Latest

Choose a tag to compare

@apostoldevel apostoldevel released this 15 Mar 19:25
· 20 commits to master since this release

What's New

OCPP 2.0.1 Phase 2: Expansion (9 new messages)

  • Provisioning: GetBaseReport, GetReport, NotifyReport
  • Availability: UnlockConnector, TriggerMessage, ClearCache
  • Transactions: GetTransactionStatus
  • Local Auth List: SendLocalList, GetLocalListVersion
  • Unified REST API with server-side payload translation (translate_payload())
  • Outbound schema validation for CSMS→CP commands
  • Device Model: 10 variables, NotifyReport with async delivery
  • Web UI: 8 new command schemas, 3 new profiles

OCPP 2.0.1 Spec Audit (5 bug fixes, 4 imprecision fixes)

  • MeterValues value type (number not string)
  • Reset triggerReason (ResetCommand)
  • stoppedReason mapping per triggerReason
  • GetTransactionStatus (messagesInQueue vs ongoingIndicator)
  • SetVariables/GetVariables use device_model (not config_keys)
  • UnlockConnector connectorId validation
  • RequestStartTransaction remoteStartId forwarding
  • ChangeAvailability "Scheduled" with pending_availability
  • NotifyReport variableCharacteristics

OCPP 2.0.1 PostgreSQL Integration

  • Unified routing: both 1.6 and 2.0.1 through ocpp.parse() when PG available
  • 7 new PL/pgSQL functions: BootNotification201, Authorize201, StatusNotification201, TransactionEvent, MeterValues201, NotifyReport, GetTransactionBySid
  • Backward compatible: pVersion DEFAULT '1.6'

Ecosystem Code Review (44 findings, 21 fixed)

  • 3 security fixes, 7 bug fixes, 6 dead code removals
  • Protocol layer: removed dead SOAPMessage, atomic<uint32_t>, sstream→fmt
  • Schema registry: typed catch, C++20 contains()
  • CSService: duplicate broadcast_log() bug fixed
  • CPEmulator: extracted meter interval constant

Other

  • Vendored Swagger UI assets for /docs endpoint
  • Version badges in README
  • PostgreSQL section documents all 2.0.1 functions

Total OCPP 2.0.1 Support

22 messages: 9 CP→CSMS, 12 CSMS→CP, 1 bidirectional (DataTransfer)

Docker

docker compose up -d
# SPA at http://localhost:9220
# Swagger UI at http://localhost:9220/docs/
# 4x OCPP 1.6 + 5x OCPP 2.0.1 emulators connect automatically