The Rey Handbook
Rey is a virtual EV charger you use from your browser. Connect it to a CSMS, plug in a virtual car, and watch every OCPP message the two exchange. This handbook walks you through all of it, with pictures.
Three parties, one screen
Every charge involves three parties. Rey shows all three side by side:
real messages, inside Rey
real
The car is simulated; Rey marks it in amber with a dashed line. What it says to the charger is real: ISO 15118 or DIN SPEC 70121 messages, coded as EXI and sent over a TLS or TCP connection that runs inside Rey (see The messages between the car and the charger). The OCPP messages between the charger and the CSMS are real too: if you connect your own CSMS, it receives exactly what a hardware charger would send.
Rey speaks OCPP 1.6, 2.0.1 and 2.1. It suits people who build or test a CSMS, people learning OCPP, and anyone who wants to show how EV charging works.
1Your first charge in two minutes
No setup needed. Rey has a built-in demo CSMS that answers every message.
- Open Rey. You see the car on the left, the charger in the middle and the Connect to a CSMS card on the right. Demo CSMS is already selected.
The start screen. The dark bubble at the top always tells you what to do next. - Pick an OCPP version (1.6, 2.0.1 or 2.1) and press Connect. The charger boots by itself, like a real one: it sends
BootNotification, the demo accepts it, and the screen turns to READY.Connected. The first messages appear in the conversation at the bottom. - Plug in the car. Flip the Cable switch on the car card, or press P. The charger says HELLO · Tap a card or use the app.
- Tap the card. Click the card reader on the charger (Tap card), or press T. The charger asks the CSMS (
Authorize), the CSMS says yes, and charging starts.Charging. Power, energy and battery level update live. Each step is a line in the conversation. - Stop. Press the red STOP button (or S), or just wait: the car stops by itself at its target level (80% by default). Then unplug.
That's the whole loop. Everything else in this handbook adds to it: other ways to start a charge, your own CSMS, a closer look at the messages, and charger features like smart charging and Plug & Charge.
2A tour of the screen
- 1Charger menu: its ID, OCPP version and CSMS. Open it for charger settings and Disconnect.
- 2Cockpit / Workbench: the picture view, or a big log with the inspector (V).
- 3Present, Help (?) and Settings (theme, hints).
- 4Drive mode: Realistic, or Step-by-step where you release each message.
- 5Next-step hint: what to do now, or why something stopped.
- 6Session timer: time, power and energy of the running session.
- 7The car: model, battery, target level, contract and the cable switch.
- 8The charger: its screen, the card reader, STOP and ⋯ Controls.
- 9The CSMS: connect here; when connected, message counts and Act as CSMS.
- 10Pages: smart charging, certificates, configuration, local list, EV & contracts.
- 11The conversation: every message, in plain words or raw JSON.
- 12Export the conversation as a file, or Clear it.
Colours mean something. CHARGER → CSMS messages are blue, CSMS → CHARGER are purple, and anything about the car (its ISO 15118 messages and notes) is amber. Green is good, red is a refusal or an error.
3Connecting to a CSMS
The card on the right of the cockpit picks who the charger talks to.
Connect your own CSMS
- Choose My CSMS.
- CSMS address: your server's WebSocket address, for example
wss://csms.example.com/ocpp. Rey adds/<charge point ID>at the end, as OCPP-J requires. If you paste your CSMS's full per-charger address, ending in the charge point ID, Rey notices and doesn't add it twice (the log says so); a trailing slash is ignored too. - Charge point ID: the identity your CSMS knows this charger by. Many CSMSs only accept IDs you've registered.
- Password (optional): if your CSMS uses HTTP Basic authentication (security profiles 1 and 2). Rey never saves it, not even in your browser.
- Pick the OCPP version your CSMS supports and press Connect.
One connection per charge point ID. A CSMS usually accepts only one live connection per ID. If that ID is already connected somewhere (another Rey tab, a colleague, a real charger), use a different one.
The hosted Rey only connects to secure wss:// addresses on the public internet. It can't reach localhost, a VPN or an office network.
When the connection fails
Rey says what went wrong in plain words, with a short code and a button that helps you fix it:
| Code | What it means | What to try |
|---|---|---|
invalid_url | The address isn't a valid URL. | It should look like wss://host/path. |
not_wss | The hosted Rey only uses secure wss://. | Switch to your CSMS's wss:// address. |
private_address | The address is on a private network. | Use your CSMS's public address. |
dns | The host name doesn't exist. | Check for typos. |
auth | The CSMS refused the password (HTTP 401/403). | Check the password and the charge point ID. |
http_error | The CSMS answered with an HTTP error instead of a WebSocket. Rey shows the status (for example 404 Not Found), the CSMS's own reason text and the exact address it dialled. | 404: check the path and that the charge point ID is registered. 409: the ID is already connected. 5xx: a problem on the CSMS side; its logs say why. |
timeout | No answer in time. | Is the server up? Try again. |
connection_refused | Nothing is listening at that address and port. | Check the port. |
tls | The secure connection failed. | The CSMS's certificate isn't trusted or doesn't match the host name. |
closed_by_csms | The CSMS closed the connection. | Often the ID is already connected, or the OCPP version isn't supported. Use a unique ID & retry. |
busy · rate_limited | Too many tabs or attempts. | Close other Rey tabs, wait a few seconds. |
"Waking up Rey's server…" The hosted Rey sleeps when nobody uses it. The first visit after a quiet spell can take up to 30 seconds; you can fill in the form meanwhile.
4Charging a car
The car
- Model: Compact EV (60 kWh), Family SUV (100 kWh), Delivery van (75 kWh) or Older EV with CHAdeMO (40 kWh). Each has its own charging power and inlets; the charger's connector must fit (change it in Configuration).
- Battery now and Stop at: the car stops drawing power at its target, like a real one.
- Contract: what the car presents for Plug & Charge. None means the driver uses a card or the app.
- Talks: what the car speaks (ISO 15118-20, -2, DIN 70121) and, once plugged in, what the car and the charger agreed, such as ISO 15118-2 · TLS 1.2. Change it on EV & contracts.
- Power: Charge, Hold or Give back, while a bidirectional session runs.
- Cable: plug in and unplug (P).
Three ways to start a charge
| Way | How | What the CSMS sees |
|---|---|---|
| 🪪 RFID card | Plug in, then tap the card reader (T). Click the card number next to the reader to use another card. The demo refuses cards starting with BLOCK, so BLOCKED-CARD shows a refusal. | Authorize, then the session starts (StartTransaction on 1.6, TransactionEvent Started on 2.x). |
| 📱 App / remote start | The CSMS starts it: Act as CSMS → Start from app in the demo, or your CSMS sends RemoteStartTransaction (1.6) / RequestStartTransaction (2.x). If the car isn't plugged in yet, the charger waits for it. | The charger accepts, checks the token first if AuthorizeRemoteTxRequests (1.6) or AuthCtrlr.AuthorizeRemoteStart (2.x) is true, then starts. |
| 🔐 Plug & Charge | Pick a contract on the car, then plug in. Nothing else. | Authorize with the contract's eMAID (and certificate data). See Plug & Charge. |
Ending a charge
Press STOP on the charger (or S), let the car reach its target, unplug, or have the CSMS stop it remotely (Act as CSMS → Remote stop). Each sends the right stop reason to the CSMS.
What the charger screen says
| Screen | Meaning |
|---|---|
| OFFLINE · STARTING | Not connected yet, or talking to the CSMS. |
| WAITING · REJECTED | The CSMS answered the boot with Pending or Rejected. |
| READY | Available: plug in to start. |
| HELLO | Plugged in, waiting for a card or the app. |
| CHECKING · AUTHORIZED | Asking the CSMS; the answer was yes. |
| NOT ACCEPTED | The CSMS (or the charger) refused. The second line says why. |
| CHARGING | Power is flowing. The ring shows the battery level. |
| DISCHARGING · ON HOLD | The car gives power back, or no power flows either way because you or the CSMS chose so. |
| PAUSED | The CSMS limit is 0 kW, or the car isn't drawing power. |
| DONE | The session ended: unplug the car. |
| OUT OF SERVICE · FAULT | Set out of service by the CSMS, or a fault you injected. |
| RESTARTING · NO SIGNAL | Rebooting after a Reset; the link to the CSMS dropped and the charger is reconnecting. |
Manual controls
⋯ Controls on the charger's screen sends messages by hand: BootNotification, StatusNotification, Heartbeat, meter values now, start or stop a session by hand, and Inject a fault (GroundFailure) / Clear the fault.
5Reading the conversation
Every message between the car, the charger and the CSMS appears at the bottom, newest last. Each line has the time, who sent it, a plain-language summary and, for replies, how long the answer took.
- Story shows plain words; Raw shows the exact OCPP-J frames as they went over the wire; Sequence draws a sequence diagram with EV, Charger and CSMS lanes: requests as solid arrows, replies dashed, errors red. Each car ↔ charger exchange is an amber arrow to the charger with a dashed one back. In Sequence view, Copy as Mermaid copies what's shown as a Mermaid diagram for docs, GitHub or tickets.
Sequence view. The same conversation as a sequence diagram; Copy as Mermaid exports it. - Schema checks: every message, in both directions, is checked against the official OCPP JSON schema of its version (replies against their request's response schema; on 1.6 the Plug & Charge message inside
DataTransferagainst the 2.0.1 schema). The inspector says ✅ Valid against the OCPP schema or lists each broken field; a message that breaks it gets a red schema ✗ chip and shows under Errors. That's how you see when your CSMS sends something malformed. - Filters: All, OCPP only, ISO 15118 (the car ↔ charger side and Plug & Charge), or Errors (refusals, CALLERRORs, failed checks).
- Search (/) finds a message by name, ID or content.
- Repeated messages, like heartbeats and meter values, fold into one line: ×3 · repeated, last at …. Click it to see the latest. The car's charge loop (one exchange a second) folds the same way, with a ×N chip.
- Scrolling up pauses the view; Jump to live (L) takes you back.
- In the inspector: Copy JSON (the payload), Copy frame (the whole OCPP-J frame) and Show the reply.
- Edit & resend, on any request the charger sent: change the action or the JSON and the charger sends it to the CSMS again as a new request. Rey checks it against the schema first and shows what's wrong; Send anyway sends it regardless, to see how your CSMS handles a bad message (for example whether it answers with a FormationViolation). The log notes that it was sent by hand.
- A CALLERROR shows its
errorDetailstoo, where a CSMS often says what really went wrong (for example "Too many concurrent requests" behind a generic SecurityError). If an error's ID matches no request, or the CSMS sent it back on one of the charger's own replies, the inspector says so.
Export → Conversation (JSON) saves the whole conversation as a JSON file, handy for a bug report or to compare runs. It contains IDs, card tokens and addresses from the session, but never your password. Clear empties the view; it doesn't affect the charger.
Error codes and the Explain button
Every problem Rey shows has a short code, such as REY-TLS-003, and an Explain button. In the conversation it is a small ? at the end of the line. You also find it in the inspector's checks, on the charger screen when it refuses a card or a contract, under a failed connection on the Connect card, in the bar of an opened capture when a connection stays encrypted, and on error messages in the corner of the screen.
Explain opens a short page inside Rey:
- The code, with Copy code for a bug report or a ticket.
- Most likely: the side that probably caused it. Your CSMS, the car, the charger, Rey itself, or your capture file.
- What it means and the likely causes, the most likely first.
- Steps to check: where to look in Rey (which page, which message, which field) and what you should see there.
- A spec reference, where one applies.
Answers from your CSMS get a code too: a CALLERROR by its error code, a refused card (Invalid, Blocked, Expired…), a contract certificate status (revoked, expired, not trusted…), and a BootNotification answered Pending or Rejected. The same goes for the negative ResponseCodes between the car and the charger, such as FAILED_SequenceError or Failed_NoNegotiation. Codes stay the same from one version of Rey to the next, so you can note them down and search for them later.
To look a code up, press ? for Help and choose Look up an error code. Type a code, or a word like revoked or BootNotification.
The Errors filter shows every line with a code, so you can step through the problems of a session one by one.
Wireshark: export and import
Export → Capture (pcapng) saves the link between the car and the charger as a file Wireshark opens: the SDP exchange, the TCP connection and every byte that crossed the cable (TLS records, or the V2GTP frames over plain TCP), with the real times. Rey's car and charger run in memory, so Rey writes the Ethernet, IPv6 (link-local, as on the charging cable) and TCP around those bytes itself. The OCPP messages come along as a second interface, decoded (Wireshark's JSON view); the WebSocket to your CSMS isn't in the file.
- With the TLS keys (the default), the file carries the session keys, so Wireshark decrypts TLS 1.2 and TLS 1.3 by itself. Anyone with the file can read those messages: Rey asks before it downloads. The keys belong to this test session only.
- Without keys gives a file you can share: the TLS records stay encrypted. TLS key log only saves the keys as a separate file (Wireshark: Preferences, Protocols, TLS, "(Pre)-Master-Secret log filename").
- With a filter or a search on, the export takes the shown part: every connection with a message in it, whole (TLS can't be decrypted from the middle).
- Rey keeps the capture in memory while the session runs, up to 2 MB a session (about an hour of charging) and 48 MB for all sessions on the server together; export it before you disconnect. Wireshark shows the decrypted V2GTP bytes as data unless you add a V2G dissector plugin; Rey's own import shows them decoded.
Open a capture reads a .pcap or .pcapng file (up to 10 MB) from Rey, Wireshark, tcpdump or a real car or charger, and shows it in the Story, Raw and Sequence views and the inspector, read-only, in place of the live conversation (your session carries on underneath; Back to the live conversation returns). Rey finds SDP and the connections that carry ISO 15118 or DIN 70121, puts TCP back together (out of order, repeated or missing packets), decodes each message, and for TLS uses the keys in the file or a key log you open with it. Without keys, TLS shows as encrypted records with the reason. A capture that starts mid-session, misses packets or holds other traffic is fine: Rey shows what it can and says what it couldn't read.
A capture you open is read on Rey's server in memory for that request only. It is never stored or logged, and neither is the key log.
6Step-by-step mode
In Realistic mode the charger behaves like a real one. In Step-by-step mode it holds every message it wants to send until you release it, so you can follow a flow one message at a time or check how your CSMS copes with an edited payload.
- Send ▶ (or N) releases it.
- Show JSON shows what will be sent.
- Edit first lets you change the JSON before sending, for example a wrong status or a missing field.
The charger's own timers (heartbeat, meter values) pause in this mode. Messages from the CSMS are still answered right away. Switch back to Realistic at any time.
7Acting as the CSMS (demo)
With the demo CSMS, the Act as CSMS button lets you play the back office: the demo sends a real OCPP command to the charger, and you watch the charger answer.
| Group | Commands |
|---|---|
| Session | Start from app (remote start), Remote stop |
| Reset | 1.6: Soft, Hard. 2.0.1: Immediate, OnIdle (after the session). 2.1 also: ImmediateAndResume (keeps the session; the charger refuses it during a session when TxCtrlr.ResumptionTimeout is 0; with TxCtrlr.AllowEnergyTransferResumption false the session comes back paused). |
| Charger | Set out of service, Set in service, Ask for StatusNotification |
| Configuration | 1.6: Read every configuration key (GetConfiguration). 2.x: Read the device model (GetBaseReport FullInventory; the charger answers in several NotifyReport parts), Ask for components with a problem (GetReport with the Problem criterion: EmptyResultSet unless the charger is faulted). |
| Smart charging | Send a charging schedule, Clear the schedule |
| Bidirectional power (V2X) | 2.1 only: setpoints to give back, charge or hold, update the setpoint, operation mode Idle, clear, allow and no longer allow. See the CSMS in control. |
| Security | Provision a certificate, Set up Plug & Charge, Revoke the charger's Plug & Charge certificate |
With your own CSMS there's no menu: your CSMS sends its own commands and Rey answers them automatically, like a real charger. They all show up in the conversation.
8Test suite
The Test suite checks your CSMS the way real chargers will, without clicking through every case by hand. Open it with ✓ Test suite in the top bar. It runs on OCPP 1.6, 2.0.1 and 2.1: 74, 77 and 86 tests in nine categories, from start-up and cards to smart charging, certificates and Plug & Charge. Rey is a simulator, not a certification: the Test suite shows how your CSMS behaves, so you can fix it before a real charger finds out.
The scorecard
The Test suite opens on a scorecard for the CSMS you're connected to: one per CSMS address, OCPP version and charger ID. The big number counts the latest result of each test. Each category has a tile with its own Run; click a tile to see its tests. To fix first lists the failures, newest first. When you're not connected, Tested before lists the CSMSs you tested in this browser, so you can open their scorecards. Results stay in this browser only.
Choosing tests and setting up
Choose tests offers Quick check (12 automatic tests, about a minute), Automatic only, Full, or Custom: tick a category, or open it with ▸ and tick single tests. The i next to a test says what it checks, what Rey does, when it passes, what it needs and the spec. A test that needs another one (for example the SECC certificate needs a V2G root first) brings it along.
Setup asks only for what the picked tests need, like a card your CSMS accepts, one it blocks, or one it has as expired. Check asks your CSMS about the card right away. Don't have one? Skip these tests takes them out of the run. Run waits until every setup item is filled in or skipped. On the demo CSMS there's nothing to set up.
Who starts a test
| Label | What happens |
|---|---|
| Rey | Rey sends the request and checks your CSMS's answer. Nothing to do. |
| Rey ⇄ CSMS | Rey sends, and your CSMS has to follow up by itself, like signing a certificate and sending it back. |
| Your turn | Only a CSMS can start it, like installing a root certificate. Rey tells you exactly what to send from your CSMS, then checks it. |
Plug & Charge: ISO 15118-2 and -20
The Plug & Charge tests come in two editions; where it matters, the test's title names its edition. Under Choose tests, open Plug & Charge with ▸ and tick the tests of one edition or both. The tests bring their own car and certificates, so your settings on the EV & contracts page don't change them, and they come back as they were after each test.
| ISO 15118-2 tests | ISO 15118-20 tests | |
|---|---|---|
| Keys | P-256 | P-521 (Ed448 is not tested) |
| Car ↔ charger | TLS 1.2: the charger shows its certificate | TLS 1.3: the car also shows its vehicle certificate (mutual TLS) |
| Charger certificate (SECC) | 1.6 and 2.x: V2GCertificate | 2.1: V2G20Certificate. 1.6 and 2.0.1: V2GCertificate, as they have no type for -20 |
| Contracts | valid, revoked, expired | valid, revoked, expired |
| Contract installation | 1.6, 2.0.1 and 2.1 | 2.1 only: a -20 answer doesn't fit the 5600 characters 1.6 and 2.0.1 allow |
| Root your CSMS needs | rey-demo-v2g-root.pem | rey-demo-20-v2g-root.pem |
Setup offers both root files to download: import them into your CSMS as contract (MO) roots, so it can check Rey's test contracts. ISO 15118-20 is part of OCPP 2.1. On 1.6 and 2.0.1 the -20 tests go beyond the standard, and their i card says so; skip them if your CSMS doesn't do -20 there.
Tests only on OCPP 2.1
| Test | What your CSMS does |
|---|---|
| Reset that keeps the charge | Sends Reset ImmediateAndResume, then takes the same transaction up again (TxResumed). |
| CSMS asks for a V2G certificate · ISO 15118-20 | Sends TriggerMessage SignV2G20Certificate and delivers the certificate. |
| Install a root for the car's vehicle certificate | Sends InstallCertificate with OEMRootCertificate. |
| Status of the car's vehicle certificates | Answers GetCertificateChainStatus with a status for every certificate. |
| Install a contract through your CSMS · ISO 15118-20 | Passes the car's -20 request to the contract provider and returns the answer. |
| A bidirectional car's charging needs | Allows DC_BPT for the card in Authorize, answers NotifyEVChargingNeeds, and after Accepted sends a TxProfile. |
| Set the power with a setpoint | Sends a TxProfile with operationMode CentralSetpoint; the charger runs at the setpoint, giving power back when it's negative. |
| Change the setpoint of a Dynamic profile | Sends a Dynamic TxProfile, then UpdateDynamicSchedule for it with a new setpoint. |
| Allow bidirectional power during a charge | Sends NotifyAllowedEnergyTransfer for the running transaction. |
The bidirectional tests (all but the last) run a car that can give power back over ISO 15118-20, so they need the -20 V2G root and SECC certificate first, and bring those tests along. They turn bidirectional power on for the test only. If your CSMS doesn't allow DC_BPT for the accepted card, they show as not supported. Not tested because Rey doesn't simulate them: DER control, tariffs and costs, battery swap.
A run
The automatic tests run first, so you can step away; the steps that need you come together at the end ("your part"). A test that needs one of your steps runs right after it. Each Your turn step names the message, the charger and the values, with Copy as JSON for a CSMS that can send a raw message, and a countdown of 2 minutes. While you're in your CSMS's tab, Rey's tab title says ● Your turn. +1 min gives you more time; My CSMS can't send this marks it not supported, and next time it's left out (with Try again); Skip leaves it for later. When the time runs out, Rey asks once and skips it a minute later, so a run never hangs. On the demo CSMS, the demo does your part by itself.
If your CSMS drops the connection, Rey reconnects. If it doesn't come back, the run pauses with every result kept: Resume carries on, End run stops. Closing or reloading the tab doesn't stop a run; it goes on at Rey's server and the page picks it back up, as a session does (see Sessions, reloads & tabs).
While a run goes on
The run uses the charger, so the Cockpit and Workbench only watch: they show 👁, a purple band and frame, and their buttons stay in place with a 🔒. Clicking one says why. The conversation still works: read, search, inspect and export. The Test suite tab shows the progress, like Test suite · 12/75. Stop and take control ends the run and keeps the results so far.
Results
Each test ends as Pass, Fail, Not supported by your CSMS (you said it can't send it) or Not run (skipped, or a test it needs didn't pass). A failure has its own code, REY-TEST-…, with an Explain button, like every error in Rey (see Error codes). Open a test on its category page to see what Rey did, what it expected and what your CSMS did instead, its last results as small squares, and Rerun this test, Show the messages and Copy for a ticket. Run failed again on the scorecard reruns every failure. Download report makes one HTML page with the context (CSMS, OCPP version, charger, dates), the score, the failures in plain words and each category; it prints to PDF.
Good to know
- The tests create real sessions and transactions in your CSMS. Use a test charger ID.
- Plug & Charge contract tests use Rey's test contracts (see ISO 15118-2 and -20). During a run Rey's car also trusts the V2G roots your CSMS installs on the charger.
- Your results, the CSMSs you tested and the cards you gave stay in this browser. The session log records each run's results and codes, never messages or cards (see Privacy).
9Smart charging
Charging profiles really limit the power. When the CSMS sends SetChargingProfile, the charger works out the combined limit and the car slows down or speeds up to match.
- Try it with the demo: Send a charging schedule installs 22 kW for 2 minutes, 11 kW for 3 minutes, then 50 kW. Start a charge and watch the power follow.
- Limits the charger enforces, like a real one: the highest stack level and the number of periods per schedule (on 1.6 also the number of installed profiles). A profile beyond them is rejected.
- With ISO 15118-2, or -20 in scheduled control, the car gets the combined schedule, steps included (-2: up to 12 entries). When a profile changes it, the charger asks the car for a renegotiation: a lower limit counts at once, a higher one when the car has agreed. Steps the car already knows need no renegotiation. On OCPP 2.0.1 and 2.1 the car's needs go to your CSMS first (
NotifyEVChargingNeeds); if it answers Accepted, the charger waits for its TxProfile. The car's plan follows inNotifyEVChargingSchedule. - The CSMS can read the profiles back (
GetChargingProfileson 2.x) and ask for the combined schedule (GetCompositeSchedule).
10Plug & Charge
With Plug & Charge (ISO 15118) the car identifies itself with a contract certificate as soon as it's plugged in: no card, no app. The charger checks the contract and asks the CSMS, which decides whether it may charge. Rey simulates the car and its certificates, but its ISO 15118 messages are real: EXI over a real TLS connection, with a real signature from the contract key. The OCPP part with your CSMS is real. It works on OCPP 1.6, 2.0.1 and 2.1.
What the car can present
- None: no Plug & Charge. The driver taps a card or uses the app.
- eMAID only: the charger sends only the contract ID, without certificates. Quick to test.
- Certificate contracts: the full flow with real certificates, signatures and OCSP data. The car carries one contract per ISO 15118 edition (a P-256 one for -2, a P-521 or Ed448 one for -20) and presents the one for the edition the charger picks.
- No contract yet: ask for one (one choice per edition, ISO 15118-2 and -20): the car has no contract for that edition and asks the CSMS for one with its OEM provisioning certificate. It appears once a provisioning certificate of that edition is loaded. See Getting a contract from the CSMS.
Walkthrough with the demo certificates
- Load the demo certificates. Contract → Car certificates… → Load demo certificates. You get valid, revoked and expired contracts for ISO 15118-2 (P-256) and for ISO 15118-20, in both -20 key types (P-521 and Ed448). Rey picks a valid one for each edition; the ISO 15118-2 / -20 switch at the top shows what each edition needs. To try Ed448 end to end, tick Ed448 under Configuration → Charger behaviour before setting up the charger: the demo CSMS signs it with its all-Ed448 chain, and an Ed448 contract then gets the charger's Ed448 certificate.
Car certificates. Left: what the car needs. Right: what the charger still needs from the CSMS. - Connect to the demo CSMS, then Act as CSMS → Set up Plug & Charge (or Ask the demo CSMS to set this up in the dialog). The CSMS installs the V2G roots and the charger asks for its own certificates. It then checks them with OCSP.
Certificates & security after the set-up on OCPP 2.1: one card per ISO 15118 edition, each chain from its V2G root down to the charger's certificate, marked OCSP good. - Plug in. With a valid contract, charging starts by itself. Switch the conversation to ISO 15118 to follow each step: SDP, TLS,
SupportedAppProtocol,SessionSetup, the services,PaymentDetails(-2), the signedAuthorizationReqand its check, the charger's own check,Authorize, then the charge parameters and the charge loop.Plug & Charge, step by step. Amber lines are the car's side (ISO 15118); blue lines are OCPP. - Try the failures. Unplug, pick the revoked or expired contract, and plug in again. The CSMS refuses and the charger tells you why.
A revoked contract. The CSMS answers certificateStatus: CertificateRevoked.
Getting a contract from the CSMS (ISO 15118-2 and -20)
A new car has no contract yet. What it has is an OEM provisioning certificate from its maker (its name, the CN, is the car's PCID). With it, the car asks for a contract while it is plugged in, and the CSMS (or the contract provider behind it) sends one back. A car whose contract runs out asks for a fresh one the same way. In OCPP these are use cases M01 and M02.
- Pick "No contract yet: ask for one". Load the demo certificates; on the EV & contracts page pick No contract yet: ask for one under the ISO 15118-2 contracts. The demo car's provisioning certificate is
WREY0DEMO0PCID001. - Set up the charger and plug in. The car and the charger agree on ISO 15118-2 over TLS 1.2 (a car that also speaks -20 uses -20 when the charger has a -20 certificate, so untick -20 under How it talks to the charger to see this). The car sends
CertificateInstallationReq, signed with its provisioning key, through the TLS connection. The charger passes it to the CSMS as it is, inGet15118EVCertificate(actionInstall), and passes the answer back. - The car checks the answer. It checks the signature of the contract provider (its CPS certificate chains to the V2G root), decrypts the contract's private key with its own key and checks that the key belongs to the new contract certificate. Then it charges with the new contract straight away:
Authorizecarries the new eMAID. - Keep the contract. The new contract lasts for the session. To use it later too, click Keep it on the EV & contracts page: it joins your certificates, key included, in this browser.
Renewing. When the car's ISO 15118-2 contract has expired or runs out within 30 days, the car asks to renew it with CertificateUpdateReq, signed with the contract's own key (action Update). The demo kit has a contract that runs out in 10 days, DE-REY-CEXPSOON1-0, to try this. The demo CSMS does not renew an expired contract: it answers Failed, and the car carries on with the old one.
When it goes wrong. The demo kit has a second provisioning certificate, WXYZ0OTHER0PCID01, from a car maker the demo CSMS doesn't know: it answers Failed with UnknownOEM, and the charger shows No contract installed. A CALLERROR or no answer within 5 seconds (the time ISO 15118-2 gives the car) also ends Plug & Charge with the reason on the screen.
See the messages. In the conversation, the car's request and the answer are rows with an EXI chip. Click one: the inspector shows the message decoded, its EXI bytes (decrypted), and the bytes on the cable, as TLS 1.2 encrypted them, with a check that the eMAID or PCID is in the decrypted message and nowhere on the cable. The Get15118EVCertificate message itself shows its exiRequest or exiResponse decoded too. The JSON export keeps all of it.
On the charger. OCPP 2.0.1 and 2.1 switch this with ISO15118Ctrlr.ContractCertificateInstallationEnabled (true by default). The OCPP 1.6 application note has no setting of its own: ISO15118PnCEnabled covers it, and Get15118EVCertificate travels inside DataTransfer.
With ISO 15118-20
A -20 car does the same over TLS 1.3, with its own -20 OEM provisioning certificate (EC P-521, or Ed448). It is not the vehicle certificate: that one only proves the car in TLS.
- Pick "No contract yet: ask for one" under the ISO 15118-20 contracts. The demo car's -20 provisioning certificates are
WREY0DEMO0PCID0201(P-521) andWREY0DEMO0PCID0448(Ed448, with an X448 key for the key exchange). Choose one on the EV & contracts page, ISO 15118-20 tab. - Plug in. The car and the charger agree on ISO 15118-20 over TLS 1.3; the car presents its vehicle certificate. The car sends
CertificateInstallationReq, signed with its provisioning key, and asks for up to 3 contracts. The charger passes it to the CSMS inGet15118EVCertificatewith the schemaurn:iso:std:iso:15118:-20:CommonMessages. On OCPP 2.1 it also sendsmaximumContractCertificateChainsand the car's prioritized eMAIDs. - One or more contracts. The answer says how many more the CSMS has (
RemainingContractCertificateChains; on OCPP 2.1 alsoremainingContracts). While that is above 0 the car asks again. The demo CSMS has two contracts for every car, a personal one and a fleet one. The car charges with the first; Keep it keeps them all. - The car checks each answer. The CPS signature (ECDSA P-521 with SHA-512, or Ed448), then it decrypts the contract key: ECDH (P-521, or X448), SHA-512, AES-256-GCM with the PCID and the contract's key ID as extra checked data. It checks the key belongs to the new contract certificate.
Renewing. ISO 15118-20 has no CertificateUpdate. A car whose -20 contract runs out within 30 days installs a new one and lists the old eMAID first.
OCPP 2.0.1 and 1.6. They define Get15118EVCertificate for ISO 15118-2 only. Rey sends the -20 request there anyway, without the 2.1 fields, and the log says it is outside the standard. They also allow at most 5600 characters for exiResponse. A P-521 answer is about 5900, so the demo CSMS answers Failed with ResponseTooLarge and says why. An Ed448 answer is about 4900 and fits. OCPP 2.1 allows 17000.
When it goes wrong. WXYZ0OTHER0PCID201 is a -20 provisioning certificate from a car maker the demo CSMS doesn't know: Failed with UnknownOEM. In the inspector, -20 messages say ISO 15118-20 and show the TLS 1.3 records on the cable.
Real EXI. ISO 15118 messages are coded in EXI, a compact binary form of XML. Rey uses EVerest's open-source codec (libcbv2g), compiled to WebAssembly, for ISO 15118-2 and -20, with real signatures and real key encryption, so your CSMS gets exactly what a car would send.
ISO 15118-2 or -20: what you need
| ISO 15118-2 | ISO 15118-20 | |
|---|---|---|
| The car | V2G root; contract certificate with its sub-CAs (Sub-CA 1, Sub-CA 2) and private key. To get a contract from the CSMS: an OEM provisioning certificate and its key instead of the contract | The same (a -20 provisioning certificate: P-521, or Ed448 with its X448 key), plus the vehicle certificate with its vehicle sub-CAs and private key |
| Key type | EC P-256 | EC P-521 or Ed448 |
| The charger | V2G root and an SECC certificate with a P-256 key | V2G root and an SECC certificate with a P-521 (or Ed448) key. The V2G root also checks the car's vehicle certificate (the CharIN PKI puts vehicle sub-CAs under it); on OCPP 2.1 a separate vehicle root can be installed as OEMRootCertificate |
The charger holds one certificate per key type and offers the one that fits the car. By default it asks for P-256 and P-521 on OCPP 2.1, and P-256 only on 1.6 and 2.0.1: ISO 15118-20 is part of OCPP 2.1, while 2.0.1 (and the 1.6 application note, which follows it) covers ISO 15118-2. Change the key types under Configuration → Charger behaviour; the choice is kept per OCPP version, and you can still tick P-521 or Ed448 on 1.6 or 2.0.1 if your CSMS signs -20 CSRs there.
Both editions run a real TLS handshake. After the checks, the car and the charger open an actual TLS connection inside Rey with these certificates and keys, offering only what their edition allows:
| ISO 15118-2 | ISO 15118-20 | |
|---|---|---|
| TLS | 1.2 | 1.3 |
| Cipher suite | TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | TLS_AES_256_GCM_SHA384 or TLS_CHACHA20_POLY1305_SHA256 |
| Key exchange | secp256r1 | secp521r1 or X448 |
| Signatures | ecdsa_secp256r1_sha256 | ecdsa_secp521r1_sha512 or ed448 |
| Who presents a certificate | The charger; the car checks it against its V2G root | Both (mutual TLS): the charger asks for the car's vehicle certificate |
When the car asks for it, the charger sends its OCSP response along (OCSP stapling). Lines starting TLS 1.2 handshake (OpenSSL) or TLS 1.3 handshake (OpenSSL) show what was agreed and what each side thought of the other's certificates, so certificate problems a real TLS stack would catch (key usage, a missing sub-CA, a key that doesn't match) show up here. ISO 15118-2 also lists TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 (static ECDH); OpenSSL no longer implements it, so the car and the charger agree on the ECDHE suite.
The vehicle chain's revocation status. ISO 15118-20 asks the charger to check that no certificate in the car's vehicle chain is revoked. On OCPP 2.1 the charger asks your CSMS with GetCertificateChainStatus (one OCSP entry per certificate); a revoked one stops a strict run (Vehicle cert revoked). OCPP 1.6 and 2.0.1 have no message for this, so the charger notes that it can't check. With the demo CSMS on 2.1, Revoke the car's vehicle certificate (demo) on the Certificates page shows what happens.
Using your own certificates
- Contract → Car certificates… and drop your files on the dialog: PEM or DER, certificates and keys, several at once. Rey sorts them into chains and checks them.
- Your CSMS sets up the charger over OCPP:
InstallCertificate(V2GRootCertificate), thenTriggerMessage SignV2GCertificate. The charger answers with oneSignCertificateper key type, and your CSMS sends backCertificateSigned. On OCPP 2.1 the ISO 15118-20 certificates (P-521, Ed448) have their own trigger and type:SignV2G20CertificateandV2G20Certificate. - The charger asks your CSMS for OCSP status with
GetCertificateStatus. - Plug in. Your CSMS receives
Authorizewith the eMAID, OCSP data for the contract chain and, if the charger couldn't check it itself, the chain. ItscertificateStatusdecides. - To test contract installation, load your car's OEM provisioning certificate and key and pick No contract yet: ask for one. Your CSMS receives
Get15118EVCertificatewith the car's real EXI request and answers with its contract provider'sexiResponse; the car checks it as a real car would.
Use test certificates only. They stay in your browser, keys included, until you remove them (Forget all). Rey's server uses them only during your session, in memory, and never logs or stores them.
Stop where a real car or charger would stop. By default, if the charger is missing something (no SECC certificate, an untrusted chain, a revoked charger certificate), Rey warns and still asks your CSMS, so you can test its contract check anyway. Tick this box in the dialog to stop exactly where a real car or charger would.
On OCPP 1.6 Plug & Charge follows the OCA application note: the same 2.0.1 messages travel inside DataTransfer (vendorId org.openchargealliance.iso15118pnc). The note simplifies two of them: its TriggerMessage has no fields (it only asks for the V2G certificate CSR), and the wrapped Authorize sends the eMAID without a token type. Get15118EVCertificate travels the same way. The configuration key ISO15118PnCEnabled must be true.
11Certificates & security
This page shows every certificate installed on the charger and lets you request new ones. The certificates are grouped: ISO 15118-2 (P-256), ISO 15118-20 (P-521 / Ed448, with the vehicle root if there is one) and Charger ↔ CSMS. Each group is drawn as a chain from its root down through the CPO sub-CAs to the charger's certificate, one line per certificate. A root missing chip means the chain's root isn't installed, and a red signed by the ISO 15118-2 chain chip marks a -20 certificate your CSMS signed with its -2 chain (or the other way round): a car of that edition won't accept it. Click a certificate to see its issuer, full serial number, validity and SHA-256 fingerprint. Copy PEM copies that certificate; on the charger's own certificates, Copy chain copies it with its sub-CAs, leaf first, the way your CSMS delivered it. Paste either into a file to inspect it, for example with openssl x509 -in cert.pem -noout -text.
- Request a certificate: the charger makes a real key pair and a CSR and sends
SignCertificate, the first step towards security profile 3. The demo CSMS installs its root and returns a signed chain. - Plug & Charge: open the car's certificates, set up the charger with the demo CSMS, and:
- Check OCSP now: the charger sends
GetCertificateStatusfor its own certificates right away. It also does this after a certificate is installed and whenever an answer is due for renewal. - Revoke the charger's certificate (demo): the demo CSMS marks the charger's certificates as revoked. Press Check OCSP now, then plug in: the car sees the revoked certificate.
- Revoke the car's vehicle certificate (demo), on OCPP 2.1: the demo CSMS marks the demo car's vehicle certificate as revoked, for your charger only. At the next ISO 15118-20 plug-in the charger asks with
GetCertificateChainStatusand finds out.
- Check OCSP now: the charger sends
| OCSP chip | Meaning |
|---|---|
| OCSP good | The CA confirms the certificate is valid. Hover for when it was checked and the next update. |
| OCSP revoked | The certificate was revoked. Cars won't trust it. |
| OCSP out of date | The answer has passed its next-update time; the charger should ask again. |
| OCSP failed · unknown | The CSMS couldn't answer, or the CA doesn't know the certificate. |
12Configuration
- Station name (info only) is a free-text name the charger reports as a setting. It is not the charge point ID: the CSMS knows the charger by the charge point ID next to the CSMS address.
- Charger profile: what the charger reports at boot: vendor, model, serial, firmware, connector, power, voltage, current, country code, operator ID, EVSE ID and more. The power never goes above the maximum current: on DC that is the current times the battery's voltage (the screen then says limited by the charger). Change these while disconnected. Vendor, model and serial go into the
BootNotification, so set them to what your CSMS has on record for the charger. - SECC ID and Organization: the common name (CN) and organization (O) the charger puts in its Plug & Charge certificate request (its domain component is
DC=CPOfor ISO 15118-2 andDC=CSO, the charging station operator, for ISO 15118-20). Left empty, the SECC ID is the full EVSE ID (for exampleUS*REY*E000001), which is what ISO 15118-2 expects, and the organization is the operator ID. For ISO 15118-20, enter the SECC ID your PKI gives you. You can also change them while connected:ISO15118Ctrlr.SeccIdandOrganizationName(2.x) orSeccIdandOrganizationName(1.6). They apply to the next certificate request. - Configuration keys (1.6) or device model (2.x): edit a value to change it on the charger, or let your CSMS read and change it (
GetConfiguration/ChangeConfiguration,GetVariables/SetVariables). Like a real charger:- read-only values can't be changed by the CSMS (Rejected).
- after reboot values are stored and applied after the next reboot (RebootRequired).
- Unknown keys and bad values are rejected; timers like the heartbeat and meter interval follow their setting at once.
- Greyed-out values (2.x) are live: the date and time, the connector status, the power, the number of certificates or cards. They follow the charger.
What your CSMS can read and set
A CSMS that configures a new charger reads its configuration first, then sets what it needs. Rey has every setting OCPP requires for the features it has, and each one does what it says. A setting Rey can't change (because it always behaves one way) is read-only, with that behaviour as its value, so your CSMS gets Rejected instead of an Accepted that changes nothing.
| OCPP 2.0.1 and 2.1 | What the charger does |
|---|---|
| Reading | GetBaseReport: FullInventory (every variable, with its mutability and characteristics: data type, unit, allowed values, maximum), ConfigurationInventory (what the CSMS can set), SummaryInventory (availability and problems). GetReport filters by component and variable (leave out the EVSE, the instance or the variable to get them all) and by Active, Available, Enabled or Problem; nothing left gives EmptyResultSet. The report comes as NotifyReport parts of at most DeviceDataCtrlr.ItemsPerMessage[GetReport] variables (50) and BytesPerMessage[GetReport] bytes, numbered by seqNo, with tbc true until the last. Lower them on this page to see a report split up. |
| Get and set | GetVariables answers each item: Accepted, UnknownComponent, UnknownVariable or NotSupportedAttributeType (Rey has the Actual value only). SetVariables also answers Rejected with a reason (ReadOnly, InvalidValue, ValueTooLow, ValueTooHigh, ValueOutOfRange) or RebootRequired. More than 50 items in one request: a CALLERROR for GetVariables and GetReport, Rejected (TooManyElements) for every SetVariables item. |
| Components | OCPPCommCtrlr, DeviceDataCtrlr, ClockCtrlr, SecurityCtrlr, AuthCtrlr, AuthCacheCtrlr (Available false: Rey has no cache), LocalAuthListCtrlr, TxCtrlr, SampledDataCtrlr, AlignedDataCtrlr, SmartChargingCtrlr, ISO15118Ctrlr, ChargingStation, EVSE 1 and Connector 1 on EVSE 1; on 2.1 also NetworkConfiguration (slot 1), V2XChargingCtrlr and ConnectedEV (what the plugged-in car speaks, its EVCCID and vehicle certificate). Not there, as Rey doesn't do them: reservations, tariffs, display messages, monitoring, firmware and log upload. |
| Settings that change the charger | HeartbeatInterval, WebSocketPingInterval, OfflineThreshold (after a dropped connection the charger sends its status again), MessageAttempts / MessageAttemptInterval[TransactionEvent] (a TransactionEvent the CSMS fails to take is sent again), AuthorizeRemoteStart, LocalPreAuthorize and LocalAuthListCtrlr.Enabled (whether the local list is used), EVConnectionTimeOut (an authorization without a cable lapses), StopTxOnInvalidId (a card the CSMS refuses after the start ends the session, or only stops the energy), the measurands and intervals of SampledDataCtrlr and AlignedDataCtrlr (clock-aligned meter values, samples in the Ended event), SmartChargingCtrlr.Enabled and LimitChangeSignificance, ISO15118Ctrlr.PnCEnabled, CentralContractValidationAllowed, ContractCertificateInstallationEnabled, SeccId, OrganizationName, SecurityCtrlr.OrganizationName (the O of the charger's own certificate request), TxCtrlr.ResumptionTimeout (2.1). |
| Fixed (read-only) | TxStartPoint and TxStopPoint are PowerPathClosed (the session starts when the car is plugged in and authorized, and ends when either stops); StopTxOnEVSideDisconnect true; UnlockOnEVSideDisconnect false (fixed cable); LocalAuthorizeOffline and ContractValidationOffline false (Rey charges only while connected); one network profile (slot 1). |
| Identity | EVSE.ISO15118EvseId (for example DE*REY*E000001) and ISO15118Ctrlr.CountryName apply after a reboot (RebootRequired). The nameplate (model, vendor, connector type, maximum power as EVSE.Power maxLimit) comes from the charger profile. |
| OCPP 1.6 | What the charger does |
|---|---|
| Keys | Every required key of Core, Local Auth List Management and Smart Charging, the Plug & Charge application note's, and the security keys Rey uses (CpoName, CertificateSignedMaxChainSize). GetConfiguration without keys lists them all with their read-only flag; asked keys it doesn't know go in unknownKey; more than GetConfigurationMaxKeys (50) gives a CALLERROR. There is no AuthorizationCacheEnabled: Rey has no cache, and ClearCache answers Rejected. |
| Changes | ChangeConfiguration answers Accepted, Rejected (a read-only key or a bad value, such as a measurand Rey can't measure), RebootRequired (the EVSE ID parts) or NotSupported (an unknown key). The same behaviour as on 2.x follows the keys: MeterValuesSampledData, ClockAlignedDataInterval with MeterValuesAlignedData, StopTxnSampledData and StopTxnAlignedData (in StopTransaction), ConnectionTimeOut, StopTransactionOnInvalidId, LocalPreAuthorize, LocalAuthListEnabled, TransactionMessageAttempts / TransactionMessageRetryInterval, WebSocketPingInterval. |
Rey measures six measurands: Energy.Active.Import.Register, Energy.Active.Export.Register, Power.Active.Import, Power.Active.Export, Power.Offered and SoC (while a car is connected). On 2.1 also Power.Import.Offered, Power.Export.Offered, Power.Active.Setpoint and Power.Active.Residual. To see a refusal after the start, tap a card starting with LATEBLOCK with the demo CSMS: it passes Authorize, then the CSMS answers the start with Invalid.
Charger behaviour
- Refuse Reset requests: the charger answers
Resetwith Rejected, to test how your CSMS handles it. - Take power back from a car: the charger offers bidirectional power to a car that speaks ISO 15118-20, up to the kW you enter.
- Plug & Charge certificate key types: which SECC certificates the charger asks for (one
SignCertificateeach), saved per OCPP version. By default OCPP 2.1 asks for P-256 and P-521, and 1.6 and 2.0.1 for P-256 only: ISO 15118-20 is part of OCPP 2.1, while 2.0.1 (and the 1.6 application note) cover ISO 15118-2. You can still tick P-521 or Ed448 on 1.6 or 2.0.1 if your CSMS signs -20 certificates there; Rey marks that as outside the standard. If your CSMS accepts only one request per trigger, keep just one ticked. On OCPP 2.1,SignV2GCertificatecovers P-256 andSignV2G20Certificatecovers P-521 and Ed448.
13Local auth list
Cards on this list are authorized by the charger itself: no Authorize goes to the CSMS. That's how a real charger keeps working offline. Add an RFID or eMAID here, or let your CSMS send the list (SendLocalList).
14EV & contracts
Everything about the car in one place: its model, battery and target level, how it talks to the charger, and the Plug & Charge contract it presents, with the certificates below.
How the car talks to the charger
Under The car, tick the protocols the car speaks (all three by default, like a current car), whether it asks for TLS or plain TCP when it finds the charger (SDP), and whether it asks for the charger's OCSP status during TLS (status_request). The car lists what it speaks and the charger picks, as on a real connection:
- SDP: the car asks for TLS or plain TCP. The charger can only offer TLS when it holds a V2G (SECC) certificate.
- TLS: the car offers TLS 1.3 if it speaks ISO 15118-20 and TLS 1.2 if it speaks ISO 15118-2. The charger picks the highest version it holds a certificate for, and the TLS version decides the edition: TLS 1.3 needs a P-521 or Ed448 SECC certificate, TLS 1.2 a P-256 one.
- SupportedAppProtocol, inside the connection: the car lists the protocols the connection allows, newest first, and the charger picks one. Over TLS 1.3 the car offers -20 and -2, over TLS 1.2 only -2, over plain TCP -2 and DIN 70121: it may not offer -20 without TLS 1.3. The log shows
OK_SuccessfulNegotiation. - The car presents its contract for that edition. Without one, it asks for a card or the app.
The cockpit shows the result as Talks, e.g. ISO 15118-2 · TLS 1.2.
| The car speaks | The charger holds | What happens |
|---|---|---|
| -20, -2, DIN | -20 and -2 SECC certificates | TLS 1.3, ISO 15118-20, mutual TLS; the car presents its -20 contract |
| -20, -2, DIN | a -2 SECC certificate only | Falls back: TLS 1.2, ISO 15118-2; the car presents its -2 contract |
| -20, -2, DIN | no SECC certificate | No TLS, so no Plug & Charge: card or app over ISO 15118-2 |
| -20 only | a -2 SECC certificate only | No TLS version in common (No TLS in common) |
| -20, -2 with only a -2 contract | -20 and -2 SECC certificates | ISO 15118-20 is agreed, but the car has no -20 contract: card or app |
| -2 or DIN (with or without -20), over plain TCP | anything | No Plug & Charge, which needs TLS: card or app over ISO 15118-2 or DIN 70121. -20 is out, since it requires TLS |
| -20 only | anything | Always TLS 1.3, for a card or the app too: Plain TCP can't be chosen, since ISO 15118-20 requires TLS |
| DIN 70121 only | anything | Always plain TCP and no Plug & Charge: card or app |
Not asking for the OCSP status means the charger sends none, so the car can't tell whether the charger's certificates are revoked; Plug & Charge still works. When the charger lacks the certificates the car needs, a real car falls back or gives up. Unless Stop where a real car or charger would stop is ticked, Rey warns and carries on with the car's first edition it has a contract for, so you can still test your CSMS's contract check.
A failure after the protocol is agreed (for example an expired -20 contract) doesn't make the car switch to -2 within the same session: the driver taps a card instead.
The messages between the car and the charger
Once they agree, the car and the charger talk in real messages: each one coded as EXI (the binary XML that ISO 15118 and DIN 70121 use), put in a V2GTP frame and sent over one connection that stays open from plug-in until the session stops or you unplug. TLS 1.2 for ISO 15118-2, TLS 1.3 for -20, plain TCP for DIN 70121 and for -2 without TLS. The car and the charger both run inside Rey, so the "cable" is in memory, but the bytes on it are the real ones.
- SDP comes first, before any connection: two small UDP messages, TLS or not.
- ISO 15118-2:
SupportedAppProtocol,SessionSetup(the car's EVCCID, the charger's EVSEID),ServiceDiscovery,PaymentServiceSelection,PaymentDetailswith Plug & Charge,Authorization,ChargeParameterDiscovery(one schedule: the charger's limit now, CSMS profile included), on DCCableCheckandPreCharge,PowerDelivery, the loop (CurrentDemandon DC,ChargingStatuson AC),PowerDeliveryto stop, on DCWeldingDetection, andSessionStop. - ISO 15118-20: the same idea with
AuthorizationSetup,ServiceDetail,ServiceSelectionandScheduleExchange, and DC_ or AC_ messages for the energy (DC_ChargeLoop,AC_ChargeLoop). - DIN SPEC 70121: DC only, plain TCP, a card or the app. On an AC connector a DIN-only car charges without these messages.
With a card or the app the car asks for authorization every second and the charger answers Ongoing until you tap the card or the app starts the session. With Plug & Charge the car signs AuthorizationReq with its contract key, and the charger checks that signature on the bytes it received. During charging the loop runs once a second with the power, battery level and meter you see on screen. STOP, a stop from the CSMS or a reset reach the car in the loop's answer; unplugging ends the session from the car's side. When the charger answers with a FAILED code, the session ends and the log says why.
In the conversation, each exchange is one line in plain words, for example SessionSetup: the car (EVCCID …) and the charger (EVSEID …) start a session, with chips for its size and the connection (TLS 1.2, TCP). Click it: the inspector shows the request and the answer, each decoded, as EXI bytes and on the cable. Over TLS the cable bytes are encrypted, and a check confirms the eMAID is nowhere in them; over TCP the cable bytes are the frame itself, not encrypted. The JSON export keeps all of it.
CHAdeMO itself talks over CAN, not ISO 15118. On a CHAdeMO connector Rey runs the ISO 15118 DC messages as on CCS, so you can test the same flows, and says so in the log.
Giving power back (bidirectional, V2G)
With ISO 15118-20 a car can give power back to the charger. Rey's car and charger do it over the real messages, on DC and on AC (DC_BPT, AC_BPT), with separate meters for the energy in and out.
What it needs:
- The charger: Configuration → Charger behaviour → Take power back from a car, and the most it takes back (11 kW unless you change it).
- The car: tick The car can give power back. The Older EV can't.
- ISO 15118-20 over TLS 1.3: the charger holds a P-521 or Ed448 SECC certificate. In the demo, use OCPP 2.1 and Act as CSMS → Set up Plug & Charge. You can still start with a card.
- On OCPP 2.1, the CSMS's permission:
allowedEnergyTransferin its answer toAuthorizeincludesDC_BPTorAC_BPT. Without it the session is charging only; the CSMS can allow it later withNotifyAllowedEnergyTransfer.
Then plug in and start. Talks says bidirectional, and the Virtual EV card gets Charge, Hold and Give back.
- Never below: the car stops giving power at this level. If it starts below it, it is charged up to it first.
- Leaves in: the departure time the car tells the charger.
- Who controls the power: The car (scheduled): the charger sends a schedule, the car plans within it, and each change is a schedule renegotiation. The charger (dynamic): the car says how much energy it needs and by when, and the charger sets the power in every loop answer.
- Metering: energy in and out have their own registers (
Energy.Active.Import.Register,Energy.Active.Export.Register), and so does the power (Power.Active.Import,Power.Active.Export). The values are always positive. - On OCPP 1.6 and 2.0.1 the CSMS sees only the exported energy and power: neither version has messages for bidirectional power.
OCPP 2.1: the CSMS in control
On OCPP 2.1 every ISO 15118-20 session, bidirectional or not, tells the CSMS what the car needs and plans:
NotifyEVChargingNeeds: the energy transfer asked for, the car's and the charger's limits both ways, the departure time. If the CSMS answers Accepted, the charger waits up to 30 seconds for its TxProfile. Processing and NoChargingProfile let it go on with the limits it has. Rejected ends the session.SetChargingProfilefrom the CSMS, with an operation mode:ChargingOnly,CentralSetpoint(asetpoint, below zero to discharge),CentralFrequencyorIdle, and adischargeLimitif it wants one. A profile without an operation mode means charging only, so it stops the car giving power back.NotifyEVChargingSchedule: the car's plan, in scheduled control.TransactionEventUpdated when the operation mode changes, with the setpoint measurands ofV2XChargingCtrlr.TxUpdatedMeasurands.- For a Dynamic profile:
UpdateDynamicSchedulefrom the CSMS, or the charger asks withPullDynamicScheduleUpdatewhen the profile has adynUpdateInterval.
Try it with the demo: Act as CSMS → Bidirectional power (V2X) sends a setpoint of 8 kW back, 20 kW charging or 0 kW, updates it, sets the mode Idle, clears it, or gives and withdraws the permission. While the CSMS sets the power, the buttons on the car are greyed out and the car card says so. A card starting with NOV2G is authorized without the permission.
Not in Rey: the External and Local operation modes, the mobility needs mode where the charger sets the departure time, priority charging, DER control, discharging while offline, reactive power, and prices. CHAdeMO has its own bidirectional charging, which Rey doesn't do.
15Sessions, reloads and tabs
The charger runs on Rey's server, not in your browser tab. That makes it behave like real hardware:
- Reloading the page is safe. The charger stays connected to the CSMS (heartbeats, meter values, answers to the CSMS) and the page picks the session back up, with the messages it missed.
- If your connection drops, a banner says Reconnecting… and the page keeps trying for up to 10 minutes.
- Opening the session in another tab moves it there; the first tab says so.
When does a session end?
| What happens | Result |
|---|---|
| You click Disconnect (charger menu, top left) | Ends immediately. This is the normal way to finish. |
| You reload, or your network drops briefly | Nothing ends; the page picks it back up. |
| You close the tab and don't come back within 10 minutes | Ends after 10 minutes. Until then your CSMS still sees the charger online. |
| Nobody uses the session for 30 minutes, even with the tab open | Ends after 30 minutes. Two minutes before, a banner offers Keep session. Use means a click in Rey or a request from your CSMS; the charger's own heartbeats and meter values don't count. A banner then says when and why it ended. |
| Rey's server restarts (an update) | Ends; the page tells you. |
Done testing? Click Disconnect rather than just closing the tab, so your CSMS sees the charger go offline right away.
16Present mode
Showing Rey to a room? Present (top right) goes full screen, large and dark, with only what the audience needs. Esc or Exit Present brings the normal view back.
17Keyboard shortcuts
| V | Cockpit ⇄ Workbench |
| P | Plug in / unplug the car |
| T | Tap the RFID card |
| S | STOP |
| N | Send the next message (Step-by-step) |
| / | Search the conversation |
| L | Jump to live |
| ? | Help |
Shortcuts don't fire while you're typing in a field or a dialog is open. Settings (⚙) holds the theme (system, light or dark), whether opening a message switches to the Workbench, and the next-step hint.
18Troubleshooting
Most problems in Rey carry a code and an Explain button (see Error codes and the Explain button): start there. The answers below cover the questions that come up most.
My CSMS refuses the connection
Check the code under the Connect button (see the table). The most common causes: the charge point ID isn't registered in your CSMS, it's already connected somewhere else, the path is wrong (many CSMSs expect …/ocpp), or the OCPP version isn't supported.
BootNotification is answered with Pending or Rejected
Your CSMS doesn't accept this charger yet. Register the charge point ID, or accept it in your CSMS's back office. If the CSMS gives a reason, Rey shows it on the status line and in the log. Many CSMSs also compare the vendor, model and serial number in the BootNotification with their record: set them under Configuration → Charger profile. Pending means the CSMS wants to configure the charger first; it sends its requests, and the charger answers them. The charger boots again by itself after the interval your CSMS gave, never sooner, as OCPP requires; Disconnect and Connect starts afresh.
The car doesn't charge after I tap the card
Look at the Authorize reply in the conversation. If it isn't Accepted, your CSMS doesn't know the card. Use a card your CSMS knows (click the card number next to the reader), or put it on the Local auth list.
The Cable switch is greyed out
Either you're not connected, or the car can't use the charger's connector (for example a CHAdeMO car on a CCS2 charger). Pick another car, or change the connector in Configuration.
Charging is slower than the charger's power
Power is the lowest of three limits: the charger, the car, and any charging profile from the CSMS. The note in the conversation says which one applies (limited by the car, limited by TxDefaultProfile #100…), and the Smart charging page shows the profile.
Plug & Charge is refused
The hint above the charger says why: no SECC certificate (set up the charger first), signature error (the private key doesn't match the contract), contract revoked/expired/not trusted (your CSMS's answer), wrong key type (an ISO 15118-20 car needs a P-521 or Ed448 SECC certificate), or charger cert revoked (OCSP). Filter the conversation by ISO 15118 to see each step.
My CSMS rejects the second SignCertificate
The charger asks for one certificate per key type. If your CSMS takes only one per trigger, untick the extra key type under Configuration → Charger behaviour.
"Waking up Rey's server…" takes a while
The hosted Rey sleeps after a quiet spell; the first visit wakes it in up to 30 seconds. Once you're connected, an open tab keeps it awake.
"Your previous session has ended" after a reload
The page was away for more than 10 minutes, nobody used the session for 30 minutes, or Rey's server restarted for an update. Connect again; the conversation from before stays in the view.
I want to share what happened with someone
Click Export and send the file. It includes IDs, card tokens and addresses from the session (never your password), so share it only with people who may see those.
19Privacy
- In your browser: the conversation and your settings. Your CSMS password is never saved, not even there. Car certificates and keys stay in your browser until you remove them.
- On Rey's server, during a session: the charger itself, your certificates (in memory only, never logged), the session's recent messages so a reloaded page can continue, and what crossed the car-charger cable with its TLS keys, for the Wireshark export. All of it is deleted when the session ends.
- Test suite: your results, the CSMSs you tested and the cards you gave in setup stay in your browser. The session log records each run's tests, results and codes, never messages or cards.
- Open a capture: the file, and any key log you open with it, is read in memory for that request only: never stored or logged.
- What Rey records: for each connection attempt and session, the time, the OCPP version, demo or own CSMS, your CSMS's host name, the charger ID, whether it connected, how long it lasted and how many of each message were exchanged; and for each OCPP request, its time, which side sent it, its name, a few protocol values (like eventType=Started) and the answer's status; and per browser, a random visitor ID kept in the browser, your country (when the host provides it; your IP address is never stored), time zone, language, device type, where your visit came from (the linking site's name, without the page, and any utm_ tag in Rey's address) and the charger settings you connect with. The Privacy dialog shows your visitor ID. Never your password, IP address, the full address path, IDs, card tokens or message contents.
- Usage statistics: on the hosted site, Google Analytics with IP anonymisation and advertising features off. It counts visits and a few fixed events; it never receives an address, host name, charger ID, card token or message.
The full text is under Privacy at the bottom of Rey.
20Glossary
| CSMS | Charging Station Management System: the back office a charger connects to. In OCPP 1.6 it's called the Central System. |
| OCPP | Open Charge Point Protocol: how chargers and the CSMS talk, as JSON messages over a WebSocket. |
| Charge point ID | The charger's identity at the CSMS, added to the end of the WebSocket address. |
| Session / transaction | One charge, from start to stop. OCPP calls it a transaction. |
| CALL / CALLRESULT / CALLERROR | A request, its answer, and an error answer in OCPP-J. A message ID pairs them. |
| Heartbeat | A small "still here" message the charger sends at a set interval. |
| Charging profile | A power limit over time sent by the CSMS (smart charging). |
| ISO 15118 | How the car and the charger talk over the cable; it makes Plug & Charge possible. -2 and -20 are the two versions of its message layer. |
| EXI, V2GTP, SDP | EXI is the compact binary form of the ISO 15118 messages; V2GTP is the 8-byte header around each one; SDP is how the car finds the charger and asks for TLS before they connect. |
| DIN SPEC 70121 | The older DC charging protocol that ISO 15118-2 grew from: no TLS, no Plug & Charge. |
| eMAID | The contract ID (like DE-REY-CVALID001-1) inside a contract certificate. |
| Contract certificate | The car's Plug & Charge credential, issued by a mobility operator (MO). |
| SECC certificate | The charger's own certificate (V2G certificate) that the car checks during TLS. |
| V2G root | The top certificate both car and charger trust in a Plug & Charge PKI. |
| OCSP | A signed "is this certificate still valid?" answer from the certificate authority. |
| Local auth list | Cards the charger may accept without asking the CSMS. |
Rey is a free virtual EV charger for testing and learning OCPP. Open Rey ↗
↑ Back to the top