Building a Central System for Charging Points Connecting via OCPP
What is OCPP ?
OCPP is a standard open protocol for communication between Charge Points a Central System and is designed to accommodate any type of charging technique.
What is a Central System ?
Central System manages Charge Points and has the information for authorizing users for using its Charge Points
We’ll be using microservices here. there will be one microservice(let’s call it charger service) that communicates with charge points via OCPP over websocket and another microservice providing the REST API for public communications(let’s call it main service). The main service will take care of users and charge points management.
For the intercommunication of the microservices we’ll use message queues.
We’ll use Python for development . The charger service will use OCPP library which is build to act both as a charger and a central system. The main service we’ll use FastAPI as the backend framework for providing the REST API. and for message passing between services Rabbitmq is used.
We’ll use Rabbitmq for both message passing and also the backend for Celery. In order to reduce the number of dependencies, we’ll use Kombu as the driver for Rabbitmq. Here comes the problem, our architecture is event driven and utilizes an event loop and making Kombu use that event loop isn’t very straight forward. The following is the way we defined a consumer that is run inside and event loop: