Simulating a charger
This guide walks through a complete OCPP 1.6 session, from boot to a stopped transaction, and shows where to inject the edge cases worth testing.
1. Boot
On connect the charger sends BootNotification. Until it receives Accepted,
a compliant charger should only send BootNotification and Heartbeat.
2. Connector status
StatusNotification drives the connector through its lifecycle:
Available → Preparing → Charging → Finishing → Available
Test that your CPMS reflects each transition and handles Faulted/Unavailable
out-of-band.
3. Authorize and start
[2, "msg-020", "Authorize", { "idTag": "TAG-123" }]If the CPMS returns Accepted, follow with StartTransaction carrying the
connectorId, idTag, meterStart, and timestamp.
4. Meter values
During the session, emit MeterValues on the configured interval. Vary the
sampled values to exercise your billing and live-session UI.
5. Stop
StopTransaction closes the session with meterStop, a reason, and an
optional transaction data array. Confirm the CPMS computes the correct energy
delivered.
Edge cases to inject
- Disconnect between
StartTransactionandStopTransaction. MeterValueswith a decreasing register (clock/meter rollback).StopTransactionwithreason: "PowerLoss".