Developing an OCPP gateway for EVBox chargers
Project – current | Article by Maarten Tromp | Published | 2326 words
Introduction
I am currently developing a replacement for the modem in EVBox G2 and G3 chargers to connect them to an OCPP backend of your choice, such as a commercial backend, or Home Assistant, or keep them working stand-alone when there is no backend at all. This is a living article: it shows the current state of the project, what is done, and what is still uncertain.
This project is one part of a wider set of EVBox projects — see EVBox charger projects for the full picture.
If you only want your charger to work again, without a backend or network connection, the autostart module does that today.
My workbench, with development in progress
In this article:
When EVBox dropped support for its G2 and G3 chargers, it left many users without a working system. The chargers themselves are fine, but without a backend to talk to, they refuse to charge. I had already made my own charger work without a backend, so I turned that solution into an easy-to-use product for other people's chargers: the autostart module. More than a hundred customers now use their chargers again. Even so, requests for a more capable solution kept coming.
After holding off for a while, I decided to build it. It is an interesting engineering challenge, and a way to help more people whose chargers have stopped working. Even chargers connected to a backend other than EVBox's EverOn have limited time left: their modems use the 2G and 3G mobile networks, which are being switched off.
This article is a living document. I will update it as development continues, so you can follow where the project stands. The status section is kept up to date; progress updates are added at the end, with their date.
The gateway replaces the original modem, in the same way the autostart module does. The modem is the board that manages the charger and connects it to the backend. The gateway has the same size, mounting holes and connector as the original, so it can be swapped out without modification. Towards the charger it speaks EVBox's own protocol, "Max"; towards the network it speaks OCPP, the open standard for talking to charge points.
- Any OCPP backend. A commercial charging platform, a self-hosted one, or Home Assistant with its OCPP integration. No dependency on any cloud service, mine included, and no subscription.
- Stand-alone as well. Without a backend, the gateway does what the autostart module does: charge on plug-in, or only with a known charge card from a local list. When the backend is unreachable, charging continues and the sessions are reported once it is back.
- Up to 20 chargers per gateway, as with the original modem. G2 and G3 chargers can be mixed.
- A current limit for the supply circuit. Set the current the circuit can carry, and the gateway shares it between the chargers and never exceeds it. A 32 A charger on a 16 A circuit will not trip the breaker.
- Local management through a web interface, and a text menu over USB for service. No app, no account.
- Network: Wi-Fi and gigabit copper Ethernet, with fibre (SFP) and mobile data (4G or 5G) as possible options. IPv4, IPv6, or both.
- Firmware updates over the network, with two copies of the firmware on board: a new version runs on trial, and if it does not work, the gateway returns to the previous one by itself.
- Secure by default. Encrypted connections to the backend, no default passwords: every unit gets its own credentials, printed on a sticker.
This is an independent project. It is not an EVBox product, and it is not affiliated with, endorsed or supported by EVBox.
Autostart module or gateway?
The gateway is not a newer version of the autostart module: the two are for different people. The autostart module is deliberately minimal: it makes a charger work again, with nothing to configure and nothing to connect. The gateway is for when you want more: a backend, charge cards, monitoring, Home Assistant, or several chargers sharing one circuit. Which one fits depends on what you want from your charger.
Two versions: locked and open
The gateway will come in two versions, with the same hardware and the same firmware.
- Locked, for operators connecting to a commercial backend. Secure boot lets only signed firmware run, and the flash memory is encrypted, so the credentials for the backend cannot be read out of the board. It only connects to a backend with encryption.
- Open, for Home Assistant users, hobbyists and tinkerers. No secure boot, no flash encryption: build your own firmware, flash it over USB with the boot and reset buttons, as on any ESP32 development board, and change whatever you like. Spare I/O lines of the chip are brought out to test pads for your own additions. It can connect to a backend with or without encryption, for a local Home Assistant on your own network, say.
The difference is made once, during production, in one-time-programmable fuses in the chip. The two versions may differ in price.
The gateway is in early development. There is no finished hardware or firmware yet, and the details below may change as the project progresses. My rough estimate is about half a year; that is a guess, not a promise.
The feasibility research is done, and as far as I can see the project is feasible: the hardware, the charger side and the OCPP side all look doable. These are the steps I can foresee now; more will be added as the project progresses.
- Feasibility research
- Design document: requirements, decisions and open questions
- Chip chosen: Espressif ESP32-S31
- Development boards and fibre test equipment ordered
- Test backends set up
- Max library, the charger side
- OCPP library, the backend side
- Listing and measuring physical and electrical requirements
- Platform test on the development boards: Rust and Embassy, gigabit Ethernet, Wi-Fi, IPv6, an encrypted OCPP connection, updates, secure boot (waiting for the development boards to arrive)
- First end-to-end test: one charger, through the gateway on a development board, to a test backend
- Interest check: which interfaces people want
- First prototype PCB: proof of concept
- Max and OCPP libraries complete for the gateway, and their source code published
- Main firmware: web interface, configuration, current limit, updates
- Tests with real chargers, up to 20 on one bus
- Second prototype, as close to production as possible
- Prototypes to a few interested operators, to try in the field
- Certification: RoHS, and CE (EMC, radio, cybersecurity)
- End-of-line tester for production
- Manual
- First production batch
- All source code and project files published
- EVBox G2 and G3 chargers, HomeLine and BusinessLine, up to 20 per gateway
- Charging without a backend, as the autostart module does
- OCPP 1.6J, with encrypted connections
- Wi-Fi 6 and gigabit copper Ethernet; IPv4 and IPv6
- The supply-circuit current limit
- A drop-in replacement for the modem: same size, holes and connector
- Firmware in Rust, with Embassy
- Open source, released into the public domain
- Fibre (SFP). I would like to offer it, but whether it goes in depends on the interest check.
- Mobile data (4G or 5G). A possible option, for sites without a network connection; also depends on the interest check.
- OCPP 2.0.1. The aim, after 1.6J works. Not in the first version.
- The second RS-485 bus of the G3 modem, used for EVBox's SmartGrid load management. The hardware for it will be on the board; the firmware comes later.
- Dates and price. Too early to say.
- EVBox G4 (Elvi). Depends on whether its modem can be replaced.
The gateway is built around the Espressif ESP32-S31, in a pre-certified module. It has Wi-Fi 6 and gigabit Ethernet on chip, and runs Rust without an operating system underneath.
Fibre is for long runs, beyond copper's 100 m limit, and gives better electrical isolation between the chargers and the network. It is also something I have long wanted to develop for, and never have. A single Ethernet chip should serve either copper or an SFP module, so the installer would choose one or the other.
The board runs from the charger's internal supply, and is designed for chargers that stand outside, from Norwegian frost to full summer sun.
As with the autostart module, every unit will be programmed and fully tested at the end of production, on an automated end-of-line test rig, before it is shipped. The board gets test pads for that from the start.
The firmware is written in Rust, using Embassy, without the standard library (no_std), and without a heap where possible: memory that is fixed when the firmware is built cannot run out in the field. The logic is kept apart from the hardware, so the whole gateway runs on a PC against a simulated charger bus. That way most of the testing happens without hardware, as it did for the autostart module, where the tests caught many errors before a single board existed.
The Max library is built on what I have learnt in all my earlier EVBox projects. It is aimed at embedded systems, and fully implements both sides of the protocol: the CP (modem) and the CB (charger).
There was no suitable OCPP library in Rust for embedded systems, so I am writing one, building on existing open-source work where it fits. Where those projects fall short, I improve them and send the changes back upstream.
The glue is the main firmware: it joins the two libraries and turns them into a working gateway.
- Translation. Each charger's state, meter readings and charge-card requests go out as OCPP messages; start, stop and current limits from the backend go back to the right charger as Max commands.
- Offline operation. When the backend is unreachable, the gateway decides locally, keeps the charging sessions and meter values, and sends them in order once the connection is back.
- Current limiting. One place that takes every limit (the supply circuit, the backend, the charge card) and divides the lowest of them between the chargers.
- Networking. Wi-Fi and Ethernet, IPv4 and IPv6, and the encrypted connection to the backend (TLS).
- Configuration. One set of settings behind both the web interface and the USB menu, so the two always agree, with a log of every change.
- Updates and diagnostics. Firmware updates with automatic rollback, logs and crash records that survive a restart, and a diagnostic report you can paste into an email.
Testing is a large part of the work, as it was for the autostart module, where there is more test code than firmware.
- Unit tests for each part on its own: every Max command and OCPP message, the current limiting, the settings.
- Integration tests for the whole firmware on a PC: the gateway against a simulated bus of chargers, G2 and G3 mixed, and against real OCPP backends running as test servers, over IPv4 and IPv6.
- Regression tests from recordings of real chargers, so that behaviour that once worked keeps working, and every bug found gets a test of its own.
- Fuzzing of everything that reads outside input, from charger frames to OCPP messages and the configuration: feeding it large amounts of random and malformed data, to find the cases nobody thought of.
- Hardware tests with real chargers on the bench, up to 20 on one bus, before any unit goes into the field.
All tests run before every release.
Unlike the autostart module, the gateway has a radio and a network connection, so I aim to certify it: RoHS, and CE marking, which covers electromagnetic compatibility, the radio, and since August 2025 cybersecurity for connected radio equipment (EN 18031). That last one is why there are no default passwords. Using a pre-certified Wi-Fi module keeps the radio part manageable.
The target is EVBox G2 and G3 HomeLine and BusinessLine chargers, produced between 2013 and 2021: the same chargers the autostart module supports. If your charger has a modem like the one in the photo above, it is the right kind.
G4 (Elvi) support depends on whether its modem is replacable.
Newer EVBox chargers are built differently, and are not part of this project.
Like my other projects, everything I create for this one, hardware and firmware, is released into the public domain (CC0). The two libraries are published on their own.
This does not apply to material I did not create myself, such as the EVBox protocol and the open-source libraries the firmware builds on, which keep their own licences.
Open source and the locked version go together: the locked version's security rests on secret keys and fuses in the chip, not on the firmware being secret.
If you operate EVBox chargers, or would like to use the gateway yourself, I would like to hear from you. It helps me decide what comes first:
- Which backend do you use, or plan to use?
- How many chargers, and G2, G3 or both?
- Which network connection would you use: Wi-Fi, copper Ethernet, fibre (SFP), or mobile data (4G or 5G)?
- Locked or open version?
- Is there anything you need that is not on this page?
When the prototypes are capable enough, I may send a few to interested operators to try in the field. Contact me.
Feasibility research
Published
The project started at the end of November 2026, with a design document before any code. The question was never whether a gateway like this can be built; of course it can. The question was whether I can build it, with limited time, limited energy and a limited budget, and with my preference for open source. That came down to two questions: is this hardware I can build within a few months, and is this software I can write within a few months? Both answers look like yes: a suitable chip exists with open-source support in Rust, OCPP fits on a microcontroller without the memory problems of large libraries, and the charger side is well understood from my earlier projects. The chip is chosen, the Max library is underway, and the OCPP library has started. Development boards, fibre test equipment and a switch with SFP ports are on order, so the first experiments on real hardware can start soon.