In the world of electric vehicles (EVs), one of the most magical experiences for an EV driver is tapping "Start" on their mobile app and watching the charger come to life.
But how does that magic happen?
Let’s dive into the behind-the-scenes journey of how EV chargers and mobile apps communicate.
The communication between these players follows a standardized protocol called OCPP (Open Charge Point Protocol). Specifically, most systems use OCPP over WebSocket, which ensures real-time, reliable communication.
The process begins when a user taps the “Start” button. The backend server prepares a RemoteStartTransaction command with the following details:
{ "connectorId": 1, "idTag": "remote-11902", "chargingProfile": { "transactionId": 11902, "chargingProfileId": 1, "stackLevel": 1, "chargingProfilePurpose": "TxProfile", "chargingProfileKind": "Relative", "chargingSchedule": { "chargingRateUnit": "A", "chargingSchedulePeriod": [ ... ] } } }
This command is sent to the charger via the backend using an RPC call:
await client.call( 'RemoteStartTransaction', remoteStartTransactionBody );
The charger acknowledges the command with a response:
{"status": "Accepted"}
This indicates the charger is ready to begin the transaction.
When the charger is fully prepared, it sends a StartTransaction message back to the backend:
{ "connectorId": 1, "idTag": "remote-11902", "meterStart": 0, "timestamp": "2025-01-15T02:09:54.000Z" }
Throughout the charging session, the charger periodically sends MeterValues updates, which include metrics like voltage, current, and energy delivered. These updates can be configured to occur every 30 seconds or at a different interval:
{ "connectorId": 1, "transactionId": 11902, "meterValue": [ { "timestamp": "2025-01-15T02:09:54.000Z", "sampledValue": [ { "value": "241.10", "measurand": "Voltage", "unit": "V" }, { "value": "0.00", "measurand": "Current.Import", "unit": "A" }, { "value": "0", "measurand": "Power.Active.Import", "unit": "W" }, { "value": "32", "measurand": "Current.Offered", "unit": "A" } ] } ] }
When the user taps “Stop,” the backend sends a RemoteStopTransaction command to the charger:
await client.call( 'RemoteStopTransaction', { transactionId: 11902 } );
The charger acknowledges with:
{"status": "Accepted"}
After completing the shutdown, the charger sends a StopTransaction message with details like the total energy delivered:
{ "connectorId": 1, "idTag": "remote-11902", "chargingProfile": { "transactionId": 11902, "chargingProfileId": 1, "stackLevel": 1, "chargingProfilePurpose": "TxProfile", "chargingProfileKind": "Relative", "chargingSchedule": { "chargingRateUnit": "A", "chargingSchedulePeriod": [ ... ] } } }
Just like a gas pump might have different nozzles for diesel or gasoline, EV chargers can have multiple connectors. Common types include:
Each connector operates independently, allowing one charger to serve multiple vehicles.
OCPP (Open Charge Point Protocol) is an open communication standard designed for the interaction between electric vehicle (EV) charging stations (charge points) and central management systems (often referred to as backend systems or charge point management systems).
It enables interoperability between charging infrastructure from different manufacturers and software providers.
OCPP defines message structures and communication protocols between the charge point and the central system. For example:
OCPP is managed by the Open Charge Alliance (OCA), which continues to develop and promote the protocol.
Every time you start or stop charging from your app, a series of precise, real-time messages flow between your app, the backend, and the charger.
The OCPP protocol makes it all possible, ensuring that chargers and apps from different manufacturers can work together seamlessly.
So, next time you plug in your EV and tap “Start,” you’ll know a little more about the magic behind the scenes!
I’ve been working on a super-convenient tool called LiveAPI.
It’s designed to make API documentation effortless for developers.
With LiveAPI, you can quickly generate interactive API documentation that allows users to execute APIs directly from the browser.
If you’re tired of manually creating docs for your APIs, this tool might just make your life easier.
The above is the detailed content of How Developers Enable EV Chargers to Communicate with Mobile Apps. For more information, please follow other related articles on the PHP Chinese website!