Connecting a charge point to a CSMS sounds like it should be a hardware problem. It is not. From the backend’s point of view, a charging station is a WebSocket client that opens a secure connection, names itself, agrees on a protocol version, and then starts sending JSON. If you understand those four steps, you can connect a virtual charge point to your real CSMS from a browser tab and watch the whole handshake happen. That is exactly what Rey, the free browser-based virtual charge point, is built to do.
This article walks the connection step by step, covering the wss:// URL, the station id, the subprotocol, and the boot handshake, then does it live against a CSMS. If you just want the hands-on version, open Rey, choose “My CSMS”, and follow along. If you are brand new to the protocol, what OCPP is gives you the big picture first.
The connection is just a WebSocket
OCPP 2.0.1 (and 1.6-J before it) runs as JSON over a single WebSocket. The charge point is the WebSocket client; the CSMS is the server. The station opens the connection, and it stays open for the life of the station. Every heartbeat, status change, authorization, and transaction event travels over that one socket, in both directions.
That has one important consequence for testing: anything that can open a WebSocket and speak the right handshake is, as far as your CSMS knows, a charge point. It does not matter whether the frames come from firmware on a wall-mounted unit in a car park or from JavaScript in a browser tab. This is why software emulation covers almost all backend testing, a point covered in depth in testing an OCPP charge point without hardware.
So the whole job of “connecting” comes down to getting four things right in the WebSocket upgrade. Before you start, collect these from whoever runs the CSMS; most failed first connections are a missing line on this list:
| What you need | Example | Where it goes |
|---|---|---|
| WebSocket base URL, including any path | wss://csms.example.com/ocpp/ | Step 1 |
| A station id the CSMS has registered | CP001 | Step 1, appended to the URL |
| The OCPP version that id is set up for | ocpp2.0.1 | Step 2 |
| The security profile | 2 (TLS plus Basic auth) | Step 3 |
| The Basic auth password for that id | set per station in the CSMS | Step 3 |
| Which CA signed the server certificate | a public CA, or a private root the client must trust | Step 3 |
| What the CSMS answers an unknown model or serial | Accepted, Pending or Rejected | Step 4 |
Let us take the four steps in order.
Step 1: The wss:// URL and the station id
The endpoint is the CSMS’s secure WebSocket URL, with the station identity as the final path segment:
wss://csms.example.com/ocpp/CP001
Two things matter here. First, wss://, as opposed to ws://, is WebSocket over TLS. Production CSMS endpoints are almost always wss://, and OCPP Security Profiles 2 and 3 require it. Plain ws:// shows up only on local test rigs.
Second, CP001 is the station id (OCPP calls it the charging station identity). It is not decoration. The CSMS reads it straight out of the URL path to decide which station just connected, before a single OCPP message is exchanged. It has to match an identity the CSMS was provisioned with. Get it wrong and a well-behaved CSMS rejects the upgrade outright, while a lax one accepts the socket and then rejects the BootNotification. Either way, a mismatched station id is one of the most common reasons a connection that “looks fine” never boots.
Step 2: The subprotocol (ocpp2.0.1)
WebSocket has a built-in mechanism for negotiating what will be spoken over the socket: the Sec-WebSocket-Protocol header. OCPP uses it to pin the version. The charge point advertises one or more of:
ocpp1.6for OCPP 1.6-Jocpp2.0.1for OCPP 2.0.1ocpp2.1for OCPP 2.1
The CSMS must echo back exactly one of the offered subprotocols in its 101 Switching Protocols response. If the CSMS and station share no common version, the CSMS is supposed to not select a subprotocol and close the connection. It should never silently accept a socket and then guess. In practice, if you point a 2.0.1 station at a 1.6-only backend, this is where it breaks, and the symptom is a socket that opens and immediately closes with no OCPP messages at all.
This negotiation is invisible in most logs unless you go looking, which is why a tool that surfaces the chosen subprotocol saves real debugging time.
Step 3: Authentication over TLS
wss:// gives you the encrypted transport; it does not, by itself, prove who the station is. That is what OCPP’s security profiles handle, and which one your CSMS uses determines what you supply at connection time:
- Profile 1. HTTP Basic auth in the WebSocket upgrade request. The username is the station id; the password is the
BasicAuthPasswordthe CSMS was configured with. - Profile 2. The same Basic auth, but over server-side TLS, meaning
wss://with a CSMS certificate your client trusts. - Profile 3. Mutual TLS, where the station presents its own client certificate instead of a password and the CSMS verifies it.
For a virtual charge point, Profiles 1 and 2 are the everyday cases. You supply the station id and the Basic-auth password, and the CSMS validates them during the upgrade. There is a catch that trips people up immediately: browsers deliberately forbid setting the Authorization header (or any custom header) on a WebSocket. That is a browser security rule, not an OCPP one. Rey works around it with a small relay that presents the Basic-auth header the browser cannot, so a browser tab can still authenticate to a real wss:// CSMS exactly as firmware would.
Step 4: The boot handshake
Once the socket is open, authenticated, and speaking an agreed version, the station has to introduce itself before it is allowed to do anything else. It sends BootNotification, and the CSMS replies with a status:
Accepted: you are provisioned, here is yourheartbeatInterval, carry on.Pending: I know you, but I am not ready. Keep retrying at the interval I give you.Rejected: go away and retry later.
Nothing else happens until BootNotification returns Accepted. No StatusNotification, no Authorize, no transaction. A station stuck re-sending BootNotification and getting Pending or Rejected is the number-one “it connects but nothing works” symptom, and it is almost always a provisioning mismatch, where the station id or model the station reports does not line up with what the CSMS expects. The full field breakdown and every failure mode live in the BootNotification message.
On the wire the request is a plain JSON array, [2, "unique-id", "BootNotification", { ... }], and the CSMS answers [3, "unique-id", { "status": "Accepted", "interval": 300, ... }]. Once you have seen this exchange a few times you can read it straight off a network tab.
Do it live in Rey
Here is where the four steps stop being theory. Rey is a virtual OCPP charge point you run from your browser, in 1.6, 2.0.1 or 2.1, and it does precisely what we just walked through. This 75-second video shows the whole connection, from the version pick to the BootNotification reply and the raw frames:
To do the same with your own backend:
- Open Rey, pick 2.0.1, and choose My CSMS on the “Connect to a CSMS” card.
- Paste your CSMS’s
wss://address, set the charge point ID (Rey adds it to the end of the address, as OCPP-J requires; if you paste your CSMS’s full per-charger URL with the ID already on the end, Rey doesn’t add it twice, and a trailing slash is ignored), and add the Basic-auth password if your backend uses one. Press Connect. - Rey opens the real WebSocket, negotiates the
ocpp2.0.1subprotocol, presents the auth via its relay, and sendsBootNotification. If the connection fails, the card says why in plain language (DNS, TLS, a401, an ID that is already connected) and offers the fix. When your CSMS refuses the WebSocket with an HTTP error, Rey shows the status, the reason text your CSMS sent and the exact address it dialled: a404usually means a wrong path or a charge point ID your CSMS hasn’t registered, a409an ID that is already connected, a5xxa problem on the CSMS side. The handbook’s Connect section covers each case. - Once the CSMS returns
Accepted, plug in the cable with the switch on the car card, then tap the card on the charger. Rey sendsAuthorizeand runs aTransactionEventfromStartedthrough meteredUpdatedframes toEnded.
Rey reaches only public wss:// addresses on the internet, not localhost, a VPN or an office network. For any failure before the first message, whatever tool you connect with, OCPP WebSocket connection errors goes through each HTTP status and what to change. The Rey handbook lists each connection error and its fix.

Click any message to open it in the inspector. The Workbench view gives the message list and the JSON the whole screen, with the reply paired to its request and the time the CSMS took to answer.

Want to see a frame before your CSMS does? Switch Drive from Realistic to Step-by-step: Rey holds each outgoing message, lets you edit the JSON, and sends it only when you press Send. It’s the quickest way to check how your backend handles a wrong field.
Because Rey shows each frame as its real wire array, you can copy any of them out as test fixtures, or diff them against the traffic from your production chargers. And it works against any conformant CSMS, whether that is your own build, a commercial platform, or one of the open-source stacks below. No firmware, no lab, no hardware on your desk.
Once the connection works, open Test suite in Rey to run 74 to 86 guided tests against the same CSMS, from start-up and cards to smart charging and Plug & Charge. How to test your CSMS with Rey’s Test suite walks through a run.
If you would rather learn the flow first
If the message sequence is still fuzzy, do not start by connecting a live backend. Start by watching a healthy conversation end to end. The walkthrough in the charging session message flow guide replays a full session frame by frame so you can learn the order and the field names passively, with nothing to configure. Then come back to Rey to test your CSMS live. Learn the flow in the walkthrough, and exercise your backend in Rey.
Where open-source stacks fit
You may be connecting to an open-source CSMS, or you may be comparing your build against one. A few worth knowing, kept balanced across the ecosystem:
- CitrineOS is an open-source CSMS hosted by LF Energy under the Apache 2.0 licence, built around OCPP 2.0.1. For its current certification status check the Open Charge Alliance list of certified products rather than any secondary source. A natural
wss://target to point Rey at. - SteVe is a long-running open-source CSMS in Java, community-maintained since 2013 under GPLv3 and focused on OCPP 1.6. It does not implement 2.0.1.
- EVerest is an LF Energy charge-point firmware stack under Apache 2.0, whose
libocppimplements OCPP 1.6, 2.0.1 and 2.1. This is the station side, not a CSMS. - MicroOcpp is a lightweight OCPP client for microcontrollers, MIT-licensed. Again the station side, aimed at constrained firmware. Repository details checked August 2026.
The pattern to notice: SteVe and CitrineOS are servers you connect to, while EVerest and MicroOcpp are the charge-point side you would otherwise need to emulate. A browser virtual charge point stands in for that station side against any of the server-side backends, and it does so identically wherever the CSMS happens to run, because OCPP is deliberately vendor-neutral and region-neutral.
The connection, in one line
Connecting a charge point to a CSMS is four things done in order: a wss:// URL carrying the station id, an ocpp2.0.1 subprotocol both sides agree on, auth appropriate to the security profile, and a BootNotification that comes back Accepted. Get those four right and everything above them is just messages on an open socket. It is worth noticing how much of this is settled before a single OCPP message is exchanged: the station id in the URL, the subprotocol both ends agree on, and the credential are all resolved during the upgrade. That is why so many “it connects but nothing works” tickets turn out not to be OCPP problems at all. The fastest way to prove your CSMS handles all four correctly is to connect Rey to it and watch it happen.