iot,

Marc

OCPP v2 in eMobility

OCPP v2 in eMobility

tags

iot

Share

Written by Marc
Backend API & Integrations

E-mobility is growing so fast that we can say, it is becoming the new mobility standard worldwide. This is possible only with an extensive infrastructure, which is equal to good coverage of Charging Stations. To advance the rollout of charging infrastructure, open communication standards play a key role. They enable two-way power flows, real-time information exchange, demand control, and eMobility services.

The Open Charge Point Protocol (OCPP) is one of the industry-supported standards for communication between a Charging Station / Electric Vehicle Supply Equipment (EVSE) and a Charging Station Management System (CSMS). It is an open standard with no cost or licensing barriers for adoption. With every next version starting from 1.2 OCPP becomes more and more advanced. Today it can be used in different architectures for different Charging Stations.

In April 2018, the Open Charge Alliance released a new version 2.0 of the OCPP. That version solves a lot of annoying problems from version 1.6 and provides a lot of new cool features ready to implement and use.

ocpp
Figure 1. OCPP placement in EV charging landscape
flow
Figure 2. Flow diagram

What’s new in OCPP 2.0?

OCPP 2.0 introduces new functionalities compared to OCPP 1.6. Due to improvements and new features, OCPP 2.0 is not backward compatible with OCPP 1.6 Let’s see what that brings…​

Device Management

Device Management (Device Model) is a feature especially welcomed by CSOs who manages a network of charging stations. It provides the following features:

  • Inventory reporting

  • Improved error and state reporting

  • Improved configuration

  • Monitoring

Transactions improvements

Handling a large amount of transactions - especially in big networks consists of 100+ Charging Stations

  • Messages StartTransaction, StopTransaction, MeterValue, and StatusNotification are replaced with TransactionEvent

  • Data reduction - support for WebSocket Compression

Security Improvements

  • Added Security profiles (3 levels) for Charging Station, CSMS authentication, and Communication Security

  • Key management for Client-Side certificates

  • Secure firmware updates

  • Security event log

Extended Smart Charging

In OCPP 2.0 Smart Charging functionality has been extended

  • Direct Smart Charging inputs from an Energy Management System (EMS) to a Charging Station

  • Improved Smart Charging with a local controller

  • Support for integrated smart charging of the CSMS, Charging Station, and EV ([ISO15118-1]).

Support for ISO 15118

The ISO 15118 standard [ISO15118-1] is a newer protocol for EVSE to EV communication, compared to IEC 61851 [IEC61851-1]. ISO 15118 allows a lot of new features and more secure communication between EVSE and EV. Added features supported by ISO 15118:

  • Plug & Charge

  • Smart Charging including input from the EV

Improvements in customer experience

  • More authorization options: Plug & Charge [ISO15118-1], Payment Terminals, local mechanical key, Smartphones, etc.

  • Displaying messages (transaction-related/global) on a Charging Station to be displayed to EV drivers

  • EV Driver preferred languages

  • Tariff and Costs: showing the applicable tariff/price before/during an EV driver starts charging on a Charging Station

OCPP-J Improvements

  • Simple Message routing

  • No SOAP Support

Minor changes/extensions

  • Renamed messages: message names have been changed, where appropriate, to improve clarity and understanding

  • TransactionId Identification & Message Sequencing: In OCPP 2.0, transaction identifiers are generated by the Charging Station

  • Extended enumerations: support more use cases

  • Offline Transaction Event Indication: support for transaction event occurred while the Charging Station was Offline

  • Personal message: Message that can be shown to the EV Driver

Use Cases

List of use cases supported by OCPP 2.0 and which use cases were already supported by OCPP 1.6

UC ID Use Case OCPP 1.6 new in OCPP 2.0

A - Security

A01

Update Charging Station Password for HTTP Basic Authentication

A02

Update Charging Station Certificate by request of o CSMS

A03

Update Charging Station Certificate initiated by the Charging Station

A04

Security Event Notification

B - Provisioning

B01

Cold Boot Charging Station

B02

Cold Boot Charging Station - Pending

B03

Cold Boot Charging Station - Rejected

B04

Offline Behavior Idle Charging Station

B05

Set Variables

B06

Get Variables

B07

Get Base Report

B08

Get Custom Report

B09

Setting a new NetworkConnectionProfile

B010

Migrate to new CSMS

B011

Reset - Without Ongoing Transaction

B012

Reset - With Ongoing Transaction

C - Authorization

C01

EV Driver Authorization using RFID

C02

Authorization using a start button

C03

Authorization using credit/debit card

C04

Authorization using PIN-code

C05

Authorization for CSMS initiated transactions

C06

Authorization using local id type

C07

Authorization using Contract Certificates

C08

Authorization at EVSE using ISO 15118 External Identification Means (EIM)

C09

Authorization by GroupId

C010

Store Authorization Data in the Authorization Cache

C011

Clear Authorization Data in Authorization Cache

C012

Start Transaction - Cached Id

C013

Offline Authorization through Local Authorization List

C014

Online Authorization through Local Authorization List

C015

Offline Authorization of unknown Id

C016

Stop Transaction with a Master Pass

D - LocalAuthorizationList

D01

Send Local Authorization List

D02

Get Local List Version

E - Transactions

E01

Start Transaction Options

E02

Start Transaction - Cable Plugin First

E03

Start Transaction - IdToken First

E04

Transaction started while Charging Station is offline

E05

Start Transaction - Id not Accepted

E06

Stop Transaction Options

E07

Transaction locally stopped by IdToken

E08

Transaction stopped while Charging Station is offline

E09

When cable disconnected on EV-side: Stop Transaction

E010

When cable disconnected on EV-side: Suspend Transaction

E011

Connection Loss During Transaction

E012

Inform CSMS of an Offline Occurred Transaction

E013

Transaction related message not accepted by CSMS

E014

Check transaction status

E015

End of charging process

F - RemoteControl

F01

Remote Start Transaction - Cable Plugin First

F02

Remote Start Transaction - Remote Start First

F03

Remote Stop Transaction

F04

Remote Stop ISO 15118 charging from CSMS

F05

Remotely Unlock Connector

F06

Trigger Message

G - Availability

G01

Status Notification

G02

Heartbeat

G03

Change Availability EVSE

G04

Change Availability Charging Station

G05

Lock Failure

H - Reservation

H01

Reservation

H02

Cancel Reservation

H03

Use a reserved EVSE

H04

Reservation Ended, not used

I - Tariff and Costs

I01

Show EV Driver-specific tariff information

I02

Show EV Driver running total cost during charging

I03

Show EV Driver final total cost after charging

I04

Show fallback tariff information

I05

Show fallback total cost message

I06

Update Tariff Information During Transaction

J - Metering

J01

Sending Meter Values not related to a transaction

J02

Sending transaction related Meter Values

J03

Charging Loop with metering information exchange

*K - *

K01

SetChargingProfile

K02

Central Smart Charging

K03

Local Smart Charging

K04

Internal Load Balancing

K05

Remote Start Transaction with Charging Profile

K06

Offline Behavior Smart Charging During Transaction

K07

Offline Behavior Smart Charging at Start of Transaction

K08

Get Composite Schedule

K09

Get Charging Profiles

K010

Clear Charging Profile

K011

Set / Update External Charging Limit With Ongoing Transaction

K012

Set / Update External Charging Limit Without Ongoing Transaction

K013

Reset / release external charging limit

K014

External Charging Limit with Local Controller

K015

Charging with load leveling based on High Level Communication

K016

Optimized charging with scheduling to the CSMS

K017

Renegotiating a Charging Schedule

L - Firmware Management

L01

Secure Firmware Update

L02

Non-Secure Firmware Update

L03

Publish Firmware file on Local Controller

L04

Unpublish Firmware file on Local Controller

M - ISO 15118 Certificate Management

M01

Certificate Installation EV

M02

Certificate Update EV

M03

Retrieve list of available certificates from a Charging Station

M04

Delete a specific certificate from a Charging Station

M05

Install CA certificate in a Charging Station

M06

Get Charging Station Certificate status

N - Diagnostics

N01

Retrieve Log Information

N02

Get Monitoring report

N03

Set Monitoring Base

N04

Set Variable Monitoring

N05

Set Monitoring Level

N06

Clear / Remove Monitoring

N07

Alert Event

N08

Periodic Event

N09

Get Customer Information

N010

Clear Customer Information

O - Display Message

O01

Set DisplayMessage

O02

Set DisplayMessage for Transaction

O03

Get All DisplayMessages

O04

Get Specific DisplayMessages

O05

Clear a DisplayMessage

O06

Replace DisplayMessage

P - DataTransfer

P01

Data Transfer to the Charging Station

P02

Data Transfer to the CSMS

OCPP server

Now it’s time to develop an OCPP server which will support communication with Charging Point using OCPP 2.0. What does it actually mean?

Assumptions

Well, the first mandatory thing is communication via the WebSocket interface (communication via SOAP is not supported anymore). Therefore all of the stuff concerning security in the network traffic layer must be set.

The second is implementation messages compliant with standard OCPP 2.0 (transactions handling mostly).

The third: we must know, that there is no need to cover all of the use cases. Most of them aren’t mandatory to support the major process of EV charging, so we can easily select features for the MVP phase.

The fourth: we don’t need Charging Point in the first development phase. Of course, later that’s required, but now we can create a simple Charging Point Simulator to emulate charging.

Technology

For our purpose (backend OCPP server) Java 11 with Spring Boot framework was used, but you can choose other backend technology you like which allows you to create backend module and support WebSocket communication. Of course, everything is embedded in docker images including database, service, etc.

Connect with written simulator via WebSocket

Connecting to OCPP Server using a simulator and connect function

connect
Figure 3. Connect using simulator

And the result…​

response
Figure 4. Connection result

Yes, it seems to work fine!

Sample of implemented Use Cases

  • C01 - EV Driver Authorization using RFID / AuthorizeRequest

[
  2,
  "123456789",
  "Authorize",
  {
    "idToken": {
      "idToken": "T01",
      "type": "Central"
    }
  }
]
  • E02 - Start Transaction - Cable Plugin First / StatusNotificationRequest (set connector to Occupied state)

[
  2,
  "123456789",
  "StatusNotification",
  {
    "timestamp": "2021-03-19T07:10:11",
    "connectorStatus": "Occupied",
    "evseId": 1,
    "connectorId": 1
  }
]
  • E02 - Start Transaction - Cable Plugin First / TransactionEvent (Started) Connect using simulator

[
  2,
  "123456789",
  "TransactionEvent",
  {
    "eventType": "Started",
    "timestamp": "2021-03-19T07:10:11",
    "triggerReason": "CablePluggedIn",
    "seqNo": 1,
    "transactionInfo": {
      "transactionId": "324567986",
      "chargingState": "EVConnected"
    }
  }
]
  • E09 - When cable disconnected on EV-side: Stop Transaction / TransactionEvent (Ended)

[
  2,
  "123456789",
  "TransactionEvent",
  {
    "eventType": "Ended",
    "timestamp": "2021-03-19T07:11:11",
    "triggerReason": "EVCommunicationLost",
    "seqNo": 3,
    "transactionInfo": {
      "transactionId": "324567986"
    },
    "idToken": {
      "idToken": "T01",
      "type": "Central"
    },
    "meterValue": [
      {
        "timestamp": "2021-03-19T07:10:11",
        "sampledValue": [
          {
            "value": "75",
            "unitOfMeasure": {
              "unit": "Wh",
              "multiplier": 3
            }
          }
        ]
      }
    ]
  }
]
  • G01 - Status Notification / StatusNotificationRequest (statuses according to ConnectorStatusEnumType)

[
  2,
  "123456789",
  "StatusNotification",
  {
    "timestamp": "2021-03-19T07:20:11",
    "connectorStatus": "Available",
    "evseId": 1,
    "connectorId": 1
  }
]

And let’s see how G01 looks like in OCPP simulator (request & response)

simulator
Figure 5. UC G01 example

Nicely done! That works!