Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

Coordinated with Fredrik

Coordinated with Fredrik artwork

Special Deep Dive for David: OCPP Without the Marketing Fluff

Feb 27, 202628 minAudio
ShareXLinkedInFacebookWhatsAppEmail

It wasn’t for a broad audience. It wasn’t for policymakers or the energy-curious. It was built for one specific person: David - a firmware engineer driving north on the E4 toward Linköping. Long highway. Solo drive. Brain half in traffic, half in state machines. So we decided to go deep into something that actually matters if you’re building charging infrastructure: OCPP - Open Charge Point Protocol. No marketing fluff. No “empowering the green transition.”Just architecture, protocol evolution, firmware headaches, and where this is all going. What OCPP Actually Is Strip it down and OCPP is simple: It is the application-layer language between a charging station (EVSE) and a backend system (CSMS). That’s it. Today, that means: * JSON payloads * WebSockets transport * TLS security * Deterministic state machines It is the pipe between hardware and cloud. And if you’re writing firmware, it is the difference between “works in the lab” and “survives production.” The Early Days: SOAP, XML, and Pain Before OCPP 1.6, we lived in the SOAP era. XML everywhere. Heavy envelopes. Verbose messages. Request/response HTTP only. That created a structural problem: chargers sit behind NATs and cellular modems. Servers couldn’t easily push commands down to them. So chargers had to poll. “Do you have work for me?”“Do you have work for me?”“Do you have work for me?” Inefficient. Expensive. Messy. And for embedded systems? Parsing XML on a constrained MCU was not fun. OCPP 1.6J - The WebSocket Revolution Then came OCPP 1.6J. The “J” mattered. JSON instead of XML.Persistent WebSockets instead of pure HTTP.Bidirectional messaging. Suddenly: * The backend could push commands instantly. * Latency dropped. * Cellular data usage shrank. * Parsing became lighter. For firmware engineers, this was a major quality-of-life upgrade. And 1.6 became everywhere. AC chargers. DC chargers. Public networks. Private networks. It worked. But it wasn’t clean. The Ambiguity Problem OCPP 1.6 had a philosophical flaw: It was ambiguous. Take a simple case. A user plugs in a cable before authorizing. The charger sends: StatusNotification: Preparing What does that mean? * Plug inserted? * Authorized but waiting? * Internal self-check? * Something else? The backend had to infer meaning from sequence patterns. That’s brittle engineering. And when you scale across vendors, those interpretations diverge. OCPP 2.0 → 2.0.1: The Hard Reset OCPP 2.0 tried to fix everything. It introduced a massive architectural shift - including a hierarchical device model. But the specification itself had issues: * Broken schema references * Circular definitions * Inconsistencies You couldn’t strictly validate against it. So 2.0.1 replaced it. And this is important: * 2.0.1 is not backward compatible with 1.6. * It’s a structural rewrite. * If someone says “OCPP 2.0,” they almost certainly mean 2.0.1. Flat World vs Hierarchical World In 1.6, configuration was flat. Key → Value. Like an INI file with a networking layer. In 2.0.1, everything becomes a tree. Charging Station→ EVSE→ Connector And beyond that: * Cooling systems * Power modules * Converters * Displays * Locks * Subsystems Each defined as: * Component * Variable * Attribute This is no longer just a protocol. It’s a digital twin of the hardware. For firmware engineers, that means: * Internal state model required * Memory allocation planning * Component indexing strategies * Careful RAM management You’re not just flipping relays anymore. You’re modeling the machine. Transactions: From Guessing to Determinism 1.6 had separate messages: * StartTransaction * StopTransaction * MeterValues 2.0.1 consolidates everything into: TransactionEvent Each event includes: * Event type * Trigger reason Now the charger can explicitly say: * CablePluggedIn * Authorized * RemoteStart * EVConnected No guessing. No backend inference. Just a deterministic state machine. This is one of the most important improvements in the protocol’s history. Offline Handling: The Reality of Cellular Networks Cellular drops. Forests exist. Power glitches happen. In 1.6: * Local whitelist for RFID * Vague retry behavior * Data sometimes lost * Billing inconsistencies In 2.0.1: * Defined queuing behavior * Sequential ordering * Transaction sequence numbers * Explicit retry logic But here’s the firmware cost: You now need: * Non-volatile message storage * Flash wear-leveling * Circular buffer logic * Message prioritization This is where embedded engineering meets infrastructure-grade reliability. Ping Is Not Heartbeat One subtle but critical distinction: WebSocket pingKeeps the TCP connection alive. OCPP heartbeatConfirms the application logic is running. You can have: * Working ping * Deadlocked firmware loop If your watchdog logic monitors only socket state, you will miss application failures. Network uptime ≠ system health. Error Handling: Stop Using “OtherError” In 1.6, the error enum was limited. Anything outside predefined values became: OtherError Operationally useless. 2.0.1 improves this with structured NotifyEvent messages tied to components. Then industry alignment brought standardized Minimum Required Error Codes (MRECs). Instead of “OtherError,” you can send precise fault codes for: * Ground fault * Pilot failure * UI failure * Network outage That difference saves unnecessary truck rolls. And truck rolls are expensive. Security: From Naive to Cryptographic Security evolved dramatically. Profile 1:Plain HTTP. Not acceptable. Profile 2:TLS - server authentication. Profile 3:Mutual TLS - charger and server authenticate each other. 2.0.1 improves: * Certificate lifecycle management * CSR handling * Renewal flows Add secure firmware updates with signature verification, and now you have something defensible. Without that, your charger is just an exposed Linux box with high voltage attached. ISO 15118 and Plug & Charge Plug & Charge requires certificate exchange between: * Vehicle OEM * Mobility operator * Charging infrastructure In 1.6, this required awkward tunneling and vendor extensions. In 2.0.1, it is native. If you are building serious DC fast chargers today, 2.0.1 is not optional. OCPP 2.1: The Grid Starts Moving Released in January 2025, OCPP 2.1 extends 2.0.1 and adds: * Bidirectional charging (V2X) * DER integration * Dynamic payment support * Secure QR-based session flows This is where it gets interesting. When vehicles can discharge power: * V2H (vehicle-to-home) * V2G (vehicle-to-grid) The charger becomes a coordination node. And the backend becomes an orchestrator of distributed batteries. At scale, that means millions of mobile storage units participating in grid balancing. The physical charger becomes infrastructure plumbing. The real asset becomes the battery - moving down the highway. The Bigger Picture The shift from 1.6 to 2.0.1 and 2.1 is a shift: From ambiguity → determinismFrom flat config → digital twinFrom best effort → structured reliabilityFrom charging → energy orchestration We are moving from “start a charging session” to: “Coordinate distributed energy assets dynamically across the grid.” And that is a completely different future. The car is no longer just consuming electricity. The car is becoming part of the grid. David, if you’re reading this - or listening back - May your TLS handshakes succeed. May your heap never fragment. May your sequence numbers stay ordered. And may your latency be low and your uptime high. See you in the next deep dive. This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit frahlg.substack.com

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

SPEAKER_01Welcome back to the deep dive. We are doing something completely different today.

SPEAKER_02Yeah, very different. We are breaking the fourth wall a little bit because we have a very specific mission and honestly a very specific target coordinate for this deep dive.

SPEAKER_00We do. We are riding shotgun with a listener named David who is currently navigating the

SPEAKER_01highway, I believe it is the E4, on his way to Lincupping.

SPEAKER_02That is right. David, eyes on the road, hands on the wheel. But keep that part of your brain that processes asynchronous logic wide open.

SPEAKER_00Exactly.

SPEAKER_02We know exactly why you were driving to Lynn Cupping. And congratulations, by the way, on the romantic motivation waiting for you at the destination. That is fantastic.

SPEAKER_01It really is.

SPEAKER_02But we also know something else about you. We know you are a firmware engineer.

SPEAKER_01Right. And we know that the only thing that keeps a firmware engineer's brain happy and engaged on a long solo drive isn't top 40 pop music.

SPEAKER_02No, definitely not.

SPEAKER_01Or audiobooks about dragons. It is a problem to solve. Or in this case, a really, really deep technical analysis of the invisible language that powers the electric vehicle world.

SPEAKER_02We're talking about the umbilical cord of the EV ecosystem. We are talking about OCPP.

SPEAKER_01The open charge point protocol.

SPEAKER_02Yes.

SPEAKER_01And David, I want to make a promise to you right now. We are stripping away the marketing fluff.

SPEAKER_02Totally gone. We are not going to talk about empowering the green transition or seamless user

SPEAKER_01experiences in that vague corporate brochure sense.

SPEAKER_02We are throwing that out the window.

SPEAKER_01We are going to talk about byte level details. We are going to talk about architectural shifts.

SPEAKER_02The fun stuff. And the specific headaches you face when you are trying to parse a JSON payload on

SPEAKER_01a microcontroller with limited RAM and a shaky cellular connection.

SPEAKER_02Because that is the reality of the job.

SPEAKER_01Yeah. We are going to explain exactly how we got from the Wild West of version 1.6 to the

SPEAKER_02structured hierarchical world of 2.0.1. Right. And even look at the brand new V2X capabilities of 2.1, which, as you probably know, just dropped recently in January 2025. So settle in, keep your eyes on the road to link hopping, and let's unpack this beast.

SPEAKER_01OK, first things first, let's define the terms.

SPEAKER_02Sure.

SPEAKER_01What is OCPP really when you strip it down to the studs?

SPEAKER_02Well, if you want the technical elevator pitch. But for an elevator in a Femiconductor fab, it is the application layer Esperanto between the charging station, what the industry calls the charge point or EVSE, and the central system or CSMS.

SPEAKER_01So it is the pipe between the hardware and the cloud.

SPEAKER_02Precisely. And in the modern versions we are discussing today, it operates almost exclusively over WebSockets using JSON formatting.

SPEAKER_00Which makes sense.

SPEAKER_02Now, there are ghosts of the past, like SOP and XML, lingering in the history books and in some very old legacy chargers. But for a modern firmware engineer like David, you are dealing with JSON over WebSockets.

SPEAKER_01Okay, so the mission today is to trace the evolution. Because it feels like for a long time the industry was just stuck on version 1.6. Oh, yeah. It was the standard that just wouldn't die.

SPEAKER_02It was. It was the Windows XP of charging protocols. Reliable enough... Everyone knew how to break it. Everyone knew how to fix it.

SPEAKER_00Yeah.

SPEAKER_02But before we get to why 1.6 stuck around so long, we have to briefly acknowledge the primitives. We have to look at the stack trace of history.

SPEAKER_01The early days. Versions 1.2 and 1.5.

SPEAKER_02Right. These were the SOAP-based days. Simple object access protocol, which, as any engineer knows, is a massive misnomer.

SPEAKER_00There was nothing simple about it.

SPEAKER_02Absolutely nothing simple.

SPEAKER_00It's XML-based.

SPEAKER_02Pure XML. Verbose.

SPEAKER_00Yeah.

SPEAKER_02Heavy. If you look at an SOAP envelope, you have the header, the body, the namespaces. It is a lot of bytes just to say, start charging.

SPEAKER_00Yeah, I can imagine the cellular bills.

SPEAKER_02Exactly. But the bigger problem for firmware engineers and for David specifically, if he ever has to maintain a legacy stack, was the networking model itself.

SPEAKER_00How so?

SPEAKER_02So SAP over HTTP is inherently a request response protocol. It follows the client server model strictly. Right. The charger is the client. The central system is the server. The client makes requests, the server sends a response.

SPEAKER_00That sounds standard, though.

SPEAKER_02It is standard for browsing the web. But think about the use case here. Sometimes the server needs to tell the charger to do something, like remote start transaction or unlock connector.

SPEAKER_00Oh, I see.

SPEAKER_02In a stripped HTTP model, the server cannot just initiate connection to the client if the client's behind a NAT router or a firewall.

SPEAKER_01Right, because the charger doesn't have a public IKEA address. It is sitting behind a cellular modem's NAT.

SPEAKER_02Exactly. So the 1.5 days you had to deal with complex port forwarding, which is a security nightmare. Right. Or the charger had to pull. It basically had to knock on the server's door every few seconds asking, do you have work for me? Do you have work for me?

SPEAKER_01That is incredibly inefficient. It burns data. It keeps the radio active. It drains power.

SPEAKER_02It was a huge mess. Which brings us to the revolution of 2015, OCPP 1.6, and specifically the flavor we call OCPP 1.6J.

SPEAKER_01The J stands for JSON.

SPEAKER_02Yes. But the hero here isn't just the data format. It is the transport layer. 1.6J introduced persistent WebSocket connections.

SPEAKER_01Let's explain why that matters for David's firmware architecture.

SPEAKER_02Well, with a WebSocket, you start with HTTP. You send an HTTP upgrade request. Ideally, you get back a 101 switching protocols response from the server.

SPEAKER_00Right. Once that handshake is complete, you have a single persistent bidirectional TCP pipe. Always on connectivity.

SPEAKER_02Exactly. The server can push a message, a call, down to the charger instantly. No polling required. The latency drops from whenever the next poll happens down to milliseconds.

SPEAKER_01And JSON, why is that better than XML for David?

SPEAKER_02Bandwidth and parsing. XML is text heavy with all those opening and closing tags. JSON is lean.

SPEAKER_01Right, less overhead.

SPEAKER_02Yeah. If you were paying for a cellular data plan for thousands of chargers, that byte reduction saves real money. But more importantly for David, if he is working on an embedded microcontroller, say an ARM Cortex-M4 or an ESP32, parsing JSON is computationally cheaper. You don't need a heavy DOM parser. You can deserialize it into a C struct much faster.

SPEAKER_01Using libraries like Arduino JSON or something similar.

SPEAKER_02Exactly. So 1.6 becomes the standard because it solved the connectivity problem. But then things get messy. We have 2.0, we have 2.0.1, and people get very confused about the compatibility here.

SPEAKER_01This is what I call the great schism.

SPEAKER_02It is a schism. OCPP 2.0 came out around 2018. It was a massive architectural rewrite. It introduced the device model, which we will get to. But, and this is a critical note for anyone digging through old archives, it had bugs.

SPEAKER_01Bugs in the spec itself.

SPEAKER_02In the JSON schema. There were inconsistencies. There were references to types that weren't defined. There were circular dependencies.

SPEAKER_01Oh, wow. Yeah, it made it technically impossible to implement a strictly validating parser. So you literally couldn't build it according to the spec because the spec contradicted itself.

SPEAKER_02Exactly. So the Open Charge Alliance released 2.0.1 in 2020. This fixed the bugs. It cleaned up the schema. But here is the kicker. And this is the part that hurts. Okay. 2.0.1 is not backward compatible with 1.6.

SPEAKER_01It is a completely different language structure.

SPEAKER_02Totally different. It is like moving from C to Python. They share some concepts, but you cannot copy-paste the code. And technically, 2.0 isn't compatible with 2.0.1 either.

SPEAKER_00Good to know. So if you see OCPP 2.0 in marketing literature or in RFP, they almost certainly mean 2.0.1.

SPEAKER_02No one should be implementing 2.0 today, if you are a stop.

SPEAKER_01And then just recently, January 2025, we got OCPP 2.1.

SPEAKER_02The new arrival. Now, the good news here, and David, you can breathe the sigh of relief, is that 2.1 is backward compatible with 2.0.1. Thank goodness. It extends it. It adds the really cool stuff like bidirectional charging or V2X and control for distributed energy resources. But structurally, it follows the 2.0.1 model.

SPEAKER_01Okay, so that is the roadmap. 1.6 is the legacy giant, 2.0.1 is the modern standard, and 2.1 is the future proofing. Now let's get into the pain points.

SPEAKER_02Let's do it.

SPEAKER_01I want to talk about architecture and the device model, because this seems to be the biggest friction point for engineers moving from 1.6.

SPEAKER_02Absolutely. If you are coming from 1.6, you're used to a flat world.

SPEAKER_01Explain flat in terms of code.

SPEAKER_02In 1.6, you basically have a charging station and you have connectors. That is it. Configuration is just a massive flat list of keys and values.

SPEAKER_01Like an any file.

SPEAKER_02Exactly. You might have a key called meter value sample interval or heartbeat interval. It is just a lookup table. Simple, yes, but severely limiting. Imagine you have a complex site. You have the main controller, but maybe you also have a separate cooling system for the cables because you were pushing 500 amps.

SPEAKER_01Right, those liquid-cooled cables.

SPEAKER_02Yeah. Maybe you have a local energy management controller. Maybe you have a fan inside the cabinet. In 1.6, there's no standard way to talk to that fan. So if you want to report the fan speed to the back end, you have to hack it. You rely on vendor-specific extensions. You make up your own configuration keys, like vendor name underscore fan speed.

SPEAKER_01That sounds like a nightmare for the backend developers. It is a total mess of proprietary implementations that the central system has to

SPEAKER_02hard code support for. It breaks the whole promise of an open protocol.

SPEAKER_01Enter the 2.0.1 hierarchical device model. This is where it gets elegant, but also much more complex for the firmware developer.

SPEAKER_02In 2.0.1, the station isn't a flat list. It is a tree. Everything is a component.

SPEAKER_01Walk us through the hierarchy.

SPEAKER_02You have the physical logical hierarchy. The charging station is the root. The charging station contains an EVSE. That stands for electric vehicle supply equipment. Let's pause and define EVSEs strictly because I know junior engineers mix this up

SPEAKER_01with connector all the time.

SPEAKER_02Great point. An EVSE is the logical unit that can charge one car at a time.

SPEAKER_00Okay.

SPEAKER_02If you have a station with two plugs, say a Shadebo and a CCS combo, but they show the power module and you can only use one at a time, that is one EVSE with two connectors.

SPEAKER_01Okay. But if you can charge two cars simultaneously.

SPEAKER_02That is two EVSEs.

SPEAKER_01Got it. So station down to EVSE, down to connector, that is the backbone.

SPEAKER_02Right. But it goes much deeper. In 2.0.1, you can define a component called air cooling system. And that component has variables like fan speed. You can define an ACDC converter component with a temperature variable.

SPEAKER_01I see. So instead of a flat list of keys, you have a 3D coordinate system, component variable, and then attribute.

SPEAKER_02Exactly. And the implication for David, and this is where the rubber meets the road, is that his firmware needs to maintain this internal state machine.

SPEAKER_01It is not just looking up a value in a list anymore.

SPEAKER_02Right. It needs to map the physical reality of the hardware. Like, is the fan spinning? What is the voltage on phase L1? It maps that to this standardized digital twin.

SPEAKER_01And this enables monitoring, right? This is a big deal in 2.0.1.

SPEAKER_02It is massive. In 1.6, if something went wrong, you usually sent a diagnostics file, which is just a big zip file of text logs, and a human had to parse it.

SPEAKER_01not very scalable.

SPEAKER_02No. In 2.0.1, the CSMS can say, hey, I want to subscribe to the temperature variable of the ACDC converter, but don't spam me. Only send a message if it goes above 65 degrees Celsius.

SPEAKER_01That is essentially moving intelligence to the edge.

SPEAKER_02Correct. It saves bandwidth and allows for proactive maintenance. But for David, it means he has to implement the logic to handle those monitors. He has to check that threshold in his main loop and trigger the alert. David, if you were listening, this is where you need to be careful with your memory management. Oh, yeah. Maintaining a complex component tree and all these active monitors can really eat

SPEAKER_01up RAM on a small microcontroller.

SPEAKER_02It absolutely can. You need a robust data structure. Don't just malloc everything wildly.

SPEAKER_01Heap fragmentation is real.

SPEAKER_02Very real. You need a structured way to index these components, maybe using memory pools or static allocation if your device model is fixed at compile time.

SPEAKER_01Let's move to the actual act of charging, the transaction, because this is another area where 1.6 drove engineers crazy with ambiguity.

SPEAKER_02The famous plug-in first problem.

SPEAKER_01Walk us through the 1.6 nightmare scenario.

SPEAKER_02Picture this. David drives up to a charger. He gets out. He plugs the cable into his car, but he hasn't swiped his card or opened the app yet.

SPEAKER_01Okay, so the cable is physically connected. There is a hardware signal.

SPEAKER_02Right. The control pilot signal changes state.

SPEAKER_01Yeah.

SPEAKER_02But in OCPP 1.6, there is no explicit message that says cable plugged in. Right. None. The station sends a status notification, and typically it changes the status of the connector from available to preparing.

SPEAKER_01Preparing. That sounds reasonable, though. It sounds reasonable to a human, but for a machine, it is completely ambiguous.

SPEAKER_02Does preparing mean I am plugged in and waiting for auth? Or does it mean I am authorized and I am waiting for you to plug in? Or does it mean I am doing an internal self-check? Or I am rebooting? So the backend system doesn't actually know if there is a car physically there? Not definitively.

SPEAKER_01Yeah.

SPEAKER_02CSMS developers have to write all this guessing logic. They look at the sequence of events. Okay, it was available now. It is preparing, and I didn't send an off command, so it must be plugged in.

SPEAKER_01That sounds incredibly brittle.

SPEAKER_02It is brittle. Different hardware vendors implemented preparing differently. Some stayed available until you authorized. It was a total mess.

SPEAKER_01And 2.0.1 fixes this. With a sledgehammer, 2.30.1 removes stop transaction and meter values as separate messages. Whoa, those are the core messages. That is like 90% of the protocol traffic.

SPEAKER_02They're gone. They are replaced by a unified message called transaction event. And this message has a field called trigger reason.

SPEAKER_01I love explicit triggers.

SPEAKER_02So now, when David plugs in the firmware, sends a transaction event with event type set to started and trigger reason set to cable plugged in.

SPEAKER_01No ambiguity.

SPEAKER_02None. There's no ambiguity. The back end knows exactly what happened physically at the station.

SPEAKER_01That creates a deterministic state machine.

SPEAKER_02Exactly. And it handles the other way around, too.

SPEAKER_01Yeah.

SPEAKER_02If you authorize first, the trigger reason is authorized. It decouples the physical action from the logical session start.

SPEAKER_01That makes so much more sense. It matters because it lets the back end give much better feedback to the user app.

SPEAKER_02It can say car connected versus please plug in.

SPEAKER_01That sounds like a dream for debugging. Speaking of things going wrong, what happens when the network goes down? David is in Sweden. Maybe he drives through a deep forest with no cell signal.

SPEAKER_02Offline behavior. In 1.6, this was another gray area, you had a local authorization list, basically a whitelist of hex strings for RFID cards. If the net was down, you checked the list.

SPEAKER_01But what about the transaction data, the meter values?

SPEAKER_02The station was supposed to store it and send it later, but the rules on retries, timeouts, and order of operations were vague. Best effort, really.

SPEAKER_01So you could just lose data. Often stations would lose data or send it out of order, which is terrible for billing.

SPEAKER_02And 2.0.1. 2.0.1 brings in a feature called queue all messages. There is a configuration variable, ocppcomctrl.queueallmessages. If you set this to true, the station queues everything during downtime.

SPEAKER_01Not just the transaction start and stop.

SPEAKER_02Everything. Status updates, alerts security logs, heartbeat messages. When the connection comes back, the station flushes that queue in strictly sequential order.

SPEAKER_01Because 2.0.1 uses strict sequence numbers, right?

SPEAKER_02Yes, the SQL field. 1.6 had message IDs, but they were mostly for matching requests to responses. 2.0.1 adds a sequence number to the transaction events. So if you send event 4, then 5, then 6. Right. If the backend receives 4 and then 6, it knows it missed 5.

SPEAKER_01That is huge for billing accuracy.

SPEAKER_02It is. But David here is the firmware headache. You need to store this queue. If you lose power, that queue needs to be a non-volatile memory.

SPEAKER_01Like EEPROM or flash.

SPEAKER_02Yes. Do you have enough SPI flash? What happens when the flash fills up? You have to think about where leveling.

SPEAKER_01Right. You can't just write to the same sector over and over or you burn out the flash chip.

SPEAKER_02Exactly. And 2.0.1 actually defines a strategy for dropping the least important messages while preserving the critical transaction start and stop frames. You need to implement that circular buffer logic carefully.

SPEAKER_01Okay. Let's talk about keeping the connection alive. Uptime monitoring. There is a distinction here that I think trips up a lot of junior engineers. The difference between a ping and a heartbeat.

SPEAKER_02This is a classic OSI layer confusion.

SPEAKER_01Break it down for us.

SPEAKER_02First, you have the WebSocket ping. This is a layer four or layer five mechanism, depending on how you count. It is part of the WebSocket protocol definition in RFC 6455.

SPEAKER_01OK.

SPEAKER_02The station sends a tiny ping frame and the server sends a pong.

SPEAKER_01And this is mostly just to keep the TCP connection open right, to stop a NAT router or a cellular firewall from closing the port due to inactivity.

SPEAKER_02Exactly. It tells you the pipe is open. You configure this with WebSocket ping interval maybe every 60 seconds. But, and here's the trap, a successful ping does not mean the charging application is actually running. The network stack could be fine, but the main application loop could be frozen solid. Precisely. The microcontroller could be deadlocked in a while true loop waiting for a mutex that never unlocks. But the separate network processor or the kernel network stack is still happily replying to pings because that happens at a lower level interrupt.

SPEAKER_01So that is where the application heartbeat comes in.

SPEAKER_02Yes. This is a layer 7 application layer message. The firmware explicitly constructs a JSON heartbeat request and sends it to the CSMS.

SPEAKER_01Right. If the CSMS receives this, it knows the main logic of the firmware, the business logic.

SPEAKER_02is actually executing.

SPEAKER_01So David, if you are writing that hardware watchdog timer in your firmware, make sure you are tracking the application heartbeat success, not just the WebSocket connection state.

SPEAKER_02Crucial advice. Don't confuse network uptime with application uptime.

SPEAKER_01Now, inevitably, things break. Hardware fails. Relays weld. Ground faults happen. How do we tell the back end?

SPEAKER_02In 1.6, we had the status notification message. It had an error code field. And the standard values were things like ground failure over current failure. Reader failure. But the list was short. It was a fixed enum. And reality is complex. So what did firmware developers do when they encountered an error that wasn't on the list? Say, a specific contactor welded in a specific way.

SPEAKER_01Or the LCD screen died.

SPEAKER_02Right. They used other error.

SPEAKER_01The dreaded other error.

SPEAKER_02It became a black hole. Why is the charger down? I know it says other error. You cannot dispatch a technician with the right parts based on other error. Do they need a fuse, a new screen, a reboot?

SPEAKER_01So 2.0.1 changes this mechanism. completely error code is removed from status notification entirely instead errors are events you send a notify event message and you target a specific component give me an example of that you would send component is connector lock variable is problem value is true that is so much more specific it tells you exactly what is broken but there was still a problem even with components manufacturers might name things differently one might call it lock another might call it solenoid so we need standardization of the error codes themselves

SPEAKER_02Enter the ChargeX Consortium. This is a group largely driven by the U.S. national labs, like Idaho National Lab, that came up with MRECs, Minimum Required Error Codes.

SPEAKER_01MRECs, what do they look like?

SPEAKER_02They look like standard alphanumeric codes. For example, CX002 is strictly defined as a ground failure. CX013 is no internet. CX012 is a pilot fault. CX009 is user interface failure.

SPEAKER_01And you can use these in both versions?

SPEAKER_02Yes. In 1.6, you put the code CX002 in the vendor error code field. In 2.0.1, there is a dedicated field called tech code in the notify event.

SPEAKER_01David, take note. Do not use other error. Use the MRECs. Your operations team will love you because they will know whether to send an electrician or just remotely reboot the mode.

SPEAKER_02And you will save a lot of unnecessary truck rolls. And truck rolls cost hundreds of euros.

SPEAKER_01Let's shift gears to security, because if we are connecting these high-voltage devices to the internet, we better lock them down.

SPEAKER_02Security has evolved massively. In the early days, people just ran plain HTTP or unencrypted web sockets. That is Profile 1.

SPEAKER_01Profile 1, the please hack me profile.

SPEAKER_02Don't do it, David. Just don't. It sends passwords in plain text. Then we have Profile 2, which is TLS. That is standard HTTPS or WSS. The charger verifies the server certificate. That ensures you are talking to the right server and nobody is sniffing the

SPEAKER_01traffic, but does the server know who the charger is?

SPEAKER_02Only via basic auth. Your username and password in the HTTP header. That is okay, but passwords can be stolen or hard-coded in firmware. Profile 3 is the gold standard. Mutual TLS or MTLS.

SPEAKER_01Client-side certificates.

SPEAKER_02Exactly. The charger has its own unique digital certificate burned into a secure element or secure storage. The server verifies the charger, and the charger verifies the server. It is a cryptographic handshake that is very hard to spoof.

SPEAKER_01And 2.0.1 makes managing these certificates easier, right?

SPEAKER_02Yes, 2.0.1 has native messages for certificate signing requests, CSRs. So the charger can say, hey, my certificate is expiring here is a request for a new one.

SPEAKER_01And the back end handles it.

SPEAKER_02And the CSMS can sign it and send it back automatically. In 1.6, that was often a manual nightmare involving sideloading files via USB or SSH.

SPEAKER_01What about secure firmware updates?

SPEAKER_02Mandatory. The firmware must verify the digital signature of the binary before it even attempts to install it. If the signature doesn't match the public key stored in the bootloader, it rejects the update.

SPEAKER_01Like checking an RSA or ED25519 signature.

SPEAKER_02Precisely. This prevents someone from uploading a malicious firmware that turns the charger into a brick. Or worse, a botnet node.

SPEAKER_01Or a crypto miner.

SPEAKER_02Exactly.

SPEAKER_01Now I want to touch on ISO 15118. This is the plug-and-charge standard where the car talks to the charger to identify itself, eliminating the need for an RFID card or app.

SPEAKER_02ISO 15118 is a beast of its own. It involves a very complex exchange of certificates between the car, meaning the OEM, and the grid, meaning the mobility operator.

SPEAKER_01How does OCPP handle that?

SPEAKER_02In 1.6. Poorly. It wasn't designed for it. You have to use complex vendor extensions and data transfer messages to tunnel the certificate data. It is messy and fragile.

SPEAKER_01And in 2.0.1.

SPEAKER_02It is native. There is a dedicated functional block for ISO 15118. It handles the contract certificate installation and the payment details exchange naturally. If David is building a DC fast charger today, he effectively needs 2.0.1 to support plug and charge properly.

SPEAKER_01Which brings us to the future, the shiny new thing. OCPP 2.1, it was released in January 2025. What is the headline feature?

SPEAKER_02Bi-directional charging. V2X. Vehicle to everything.

SPEAKER_01This is the dream of using the car battery to power your home. V2H. Or push energy back to the grid.

SPEAKER_02B2G.

SPEAKER_01Exactly. OCPP 2.1 introduces functional blocks specifically for controlling discharge. The CSMS can tell the charger, OK, price is high. Discharge 10 kilowatts back to the grid. That requires tight integration with distributed energy resources or DERs. Right. And 2.1 aligns with grid codes like ICE 2030.5. It allows the charger to act as a smart node in the energy grid managing solar input battery storage and vehicle discharge. It essentially turns the EV into a mobile power plant.

SPEAKER_02There is also something about payments in 2.1. Ad hoc payments. Regulators, especially in the EU and U.S., are demanding that Chargers accept credit cards directly. No apps, no subscriptions.

SPEAKER_01Just tap and go.

SPEAKER_022.1 adds support for local payment terminals. And it supports secure, dynamic QR codes.

SPEAKER_00What is that?

SPEAKER_02You know the sticker QR codes on Chargers? Scammers have been pasting their own stickers over them to steal payment info.

SPEAKER_01Oof. Low-tech hack, but effective.

SPEAKER_02A secure dynamic QR code is displayed on the charger's LCD screen. It changes for every session and includes a cryptographic signature. 2.1 standardizes how the backend generates and validates those codes so the user knows they are paying the right entity.

SPEAKER_01That is really smart. Okay, so we have covered the protocol. Now, David has to actually build this and get it certified. He cannot just say it works on my desk.

SPEAKER_02No, the works on my machine badge doesn't fly here. The Open Charge Alliance has a rigorous certification process.

SPEAKER_00Walk us through the steps. First, David needs to fill out the PICS, the Protocol Implementation Conformance Statement. That sounds like a tax form.

SPEAKER_02It is essentially a checklist. Do you support smart charging? Check. Do you support remote trigger? Check. This defines what you will be tested against.

SPEAKER_01Then comes the OCTT.

SPEAKER_02This is an automated software tool provided by the OCA. You run your firmware against it. It throws thousands of test cases at you. Valid inputs, invalid inputs, weird timing sequences.

SPEAKER_01And you have to pass this before you can go to a lab. You really should because the labs charge by the hour or day and they aren't cheap.

SPEAKER_02You don't want to be debugging your JSON parser while paying lab rates.

SPEAKER_01Who are these labs?

SPEAKER_02Independent testing laboratory is selected by the OCA. They verify the OCT2 results and run additional checks to ensure the device actually behaves as the protocol says it does.

SPEAKER_01And a cool detail for 2.01, you can certify the software separately.

SPEAKER_02Yes. Charging station software stack certification. This means if you write a portable OCPP stack like Everest or OpenOCPP, you can get the stack certified. Then a hardware vendor can license your stack, and they have a much faster path to certifying their device.

SPEAKER_01That is a great segue to the ecosystem. David doesn't have to write every line of code from scratch right.

SPEAKER_02Please don't reinvent the wheel, David. Unless you love parsing strings in C, which, I mean, maybe you do. But there are great open source projects.

SPEAKER_00Let's need to check a few.

SPEAKER_02For the back end of the CSMS, the grandfather is Steve. S-T-E-V-E. It is Java-based, handles 1.6 nicely. It's getting old, but it is great for a test bench.

SPEAKER_01What on the charger side?

SPEAKER_02Everest is the big one right now. It is a project under the Linux Foundation Energy. It is a full software stack for chargers written in C++ bound. It handles OCPP 1.6, 2.0.1, and ISO 151.18. It essentially turns the Linux board into a fully functional charger controller. And if David is running on a microcontroller, maybe an ESP32 or a Nordic chip. Open OCPP, formerly known as Micro OCPP. It is optimized for embedded systems, much smaller footprint, pre-certified. It's excellent for AC wall boxes where you don't have a full Linux OS.

SPEAKER_01And what about testing? Can David run a CSMS on his laptop?

SPEAKER_02Even better, he can run it on a Raspberry Pi 4. A Pi 4 is plenty powerful enough to run a Docker container with Steve or Citrini OS, which is a newer modular CSMS. You can have your own personal cloud sitting on your desk to test your firmware again.

SPEAKER_01Fantastic. So we have covered the history, the architecture, the transaction logic, the errors, and the certification. It is a lot.

SPEAKER_02It is. But if you take one thing away, David, it is this. The shift from 1.6 to 2.0.1 and 2.1 is a shift from ambiguity to determinism.

SPEAKER_01From guessing what preparing means to knowing cable plugged in.

SPEAKER_02Exactly. And while the hierarchical device model is a pain to implement initially, and I know it feels like over-engineering where you just want to flip a relay, it gives you the power to actually know what is happening inside your hardware. It lets you build a real digital twin.

SPEAKER_01And please, for the love of engineering, use the ChargeX MRECs. Stop using other error.

SPEAKER_02Amen to that. David, we hope this deep dive kept your brain engaged on the road to link cupping. We hope the handshake with your firmware is successful, but more importantly. Focus on that implementation. Get that handshake right. Both the TLS one and the one with your partner in Linköping.

SPEAKER_01Actually, before we go, I want to leave everyone with one final thought. We talked a lot about V2X today and standardizing how a car discharges energy. But if you extrapolate that out, with 2.1 turning every EV into a highly responsive standardized DER in the grid, We are rapidly approaching a reality where the centralized utility companies won't just be managing power plants. They will be using AI to orchestrate millions of moving batteries dynamically across the continent via OCPP telemetry. The physical charging station is just going to become a pass through.

The real grid infrastructure will literally be driving on the highway with you.

SPEAKER_02That is wild to think about. The car is the grid.

SPEAKER_01Exactly. Something to mull over. May your latency be low and your uptime be high. Drive safe, David.

SPEAKER_02Safe travels.

SPEAKER_01And for everyone else listening, thanks for geeking out with us. We will catch you on the next Deep Dive.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. Counting Years

    Nov 22, 202642 minAudio

    Coordinated with Fredrik, Episode 127. Forty-two minutes on how a company gets its price: what a multiple counts, why the same krona can be worth seven years in one company and twenty-seven in another, how a rise in...

    Credit the people on this episode

  2. Shoulder Check

    Oct 31, 202650 minAudio

    Fifty minutes on two runs a day apart: the rest of Vancouver, and the road from ten Helium gateways to physics first. An interview with Lily. On Thursday I answered her questions in English; on Friday I went back to...

    Credit the people on this episode

  3. We Live Where We Are

    Oct 27, 202637 minAudio

    Thirty-seven minutes on two runs a day apart: the two years after the money came in, and home. An interview with Lily. I answered her questions in Swedish while running; the English voice you hear is my cloned voice...

    Credit the people on this episode

  4. Momentum

    Oct 24, 202639 minAudio

    Thirty-nine minutes on the two years before a term sheet arrived on my birthday, and what it took to turn it into money. An interview with Lily. I answered her questions in Swedish on a fifteen-kilometre run; the...

    Credit the people on this episode

  5. EP123: The Drive. Somebody Has to Say Yes

    Oct 15, 202634 minAudio

    This episode started in a car. A clear October day, low sun, the drive from Kalmar to Stockholm. I could have flown, and it would have been faster. But the hours in the car are a different kind of time. The car keeps...

    Credit the people on this episode