Basics · Video 5 of 19
OCPP 1.6 messages explained: BootNotification to StopTransaction
Follow one ordinary day of an EV charger, message by message, so you can tell which OCPP message is missing when something goes wrong.
In this video
BootNotification, StatusNotification, Heartbeat, Authorize, StartTransaction, MeterValues and StopTransaction in order.
Chapters
Transcript
OCPP message flow. Follow a normal day in the life of a charger, message by message. In your console, a charger shows online, and its connector shows charging or available. Online is the open connection. The connector's states come from messages the charger sent. In this lesson you follow the messages of one ordinary day, in order. When something looks wrong, you can tell which message is missing.
The messages you will see were recorded from a simulated charger. Only the names are changed. Our charger stands in a residents' garage, and it has one connector. Every exchange is a request and an answer. Either side may ask, and the other always replies. The day starts when the charger powers up and connects to its central system. Its first message is BootNotification. It says who the charger is.
Vendor, model, serial number and firmware version. The central system answers with a status: Accepted, Pending or Rejected. Accepted means: you are in. Our charger was accepted. The answer also carries the server's clock, so the charger can set its own time. And an interval, which tells the charger how often to send a heartbeat. Right after the boot, this central system asked a question of its own: GetConfiguration.
The charger replied with a list of its settings, such as how often it samples its meter. So requests travel both ways, on the same open connection. The charger reports the state of each connector with StatusNotification. Our charger sent one for connector zero, which stands for the charger as a whole. And one for connector one: Available, with no error. From now on, a new StatusNotification follows each time a connector changes state.
On a quiet stretch, the charger sends Heartbeat at the interval it was given. Heartbeat says: I am still here. The answer gives the current time. If the connection closes, the central system loses sight of the charger. A resident arrives and plugs in the car. The connector changes to Preparing, and a StatusNotification says so. The resident taps a card. The charger reads its identifier, called the idTag.
It sends Authorize with that idTag, asking: may this tag charge here? The answer carries idTagInfo with a status. Here it is Accepted. Three other answers are possible. Another lesson covers them. Now the charger sends StartTransaction. It names the connector, the idTag, the time and meterStart. The start reading, meterStart, is in watt hours. Often it is the meter's running total. It can also be zero: some meters count each transaction from zero.
Only the difference matters. The central system opens a transaction and answers with a transactionId. The stop message carries that number, and so do the meter readings. With StatusNotification the connector reports Charging. While the car charges, the charger sends MeterValues. Each holds readings with a name and a unit: the energy register, power, current per phase, voltage. The first is marked as the start of the transaction.
The rest are periodic samples. How often they come is a charger setting, the meter value sample interval. The energy so far is the latest register reading minus meterStart. In our recording, the connection dropped for a moment in the middle of the transaction. The charger connected again, sent a new BootNotification, and reported its connector as Charging. The transaction went on, and the meter kept counting.
Later, the resident ends the transaction at the charger. The charger sends StopTransaction: the transactionId, meterStop, the time and a reason. Here the reason is Local: stopped at the charger. Remote and EVDisconnected are two others. The last readings come with it, marked as the end of the transaction. The energy of the transaction is meterStop minus meterStart. The connector reports Finishing while the cable is still in.
Once the car is unplugged, it reports Available. The day is back where it started. Now you can read a problem by what is missing. Boot not accepted: the charger is kept out, and no transaction can start. Connection closed: the charger is offline. An open connection keeps it online, even with no heartbeat. No StatusNotification: the console keeps showing a connector state that is no longer true.
No MeterValues: you only learn the energy when the transaction stops. No StopTransaction: the transaction stays active after the car has left. In Powerfill, these messages are in Logs, under Developers. Each charger's page also has a Logs tab with only its own messages. You can now follow the messages of a normal day, in order.