Skip to content

OCPP server and management UI written in .NET-Core

License

Notifications You must be signed in to change notification settings

jaeyongjaykim/OCPP.Core

 
 

Repository files navigation

OCPP.Core

OCPP.Core is an OCPP (Open ChargePoint Protocol) server written in .NET-Core. It includes a management Web-UI for administration of charge points and charge tokens (RFID-Token)

Status

It currently supports OCPP1.6J and 2.0(JSON/REST).

OCPP.Core is currently used with 4 KEBA P30c/x charge points operating in a load management and OCPP1.6J. Here's a report of my first real live experiences.

Please send feedback if it works with your charge station or has issues
The OCPP-Server currently handles the following messages:

OCPP V1.6:

  • BootNotification
  • Heartbeat
  • Authorize
  • StartTransaction
  • StopTransaction
  • MeterValues
  • StatusNotification
  • DataTransfer
  • Reset
  • UnlockConnector

OCPP V2.0:

  • BootNotification
  • Heartbeat
  • Authorize
  • TransactionEvent
  • MeterValues
  • StatusNotification
  • DataTransfer
  • LogStatusNotification
  • FirmwareStatusNotification
  • ClearedChargingLimit
  • NotifyChargingLimit
  • NotifyEVChargingSchedule
  • Reset
  • UnlockConnector

Management Web-UI

The Web-UI is localized in English and German. It has an overview page with all charge stations and their availabilty.

Overview

Every charge point (or connector!) is displayed as a tile with status information. If a car is charging the tile is red and shows the duration. If the charge station sends data about the current power and state of charge (SoC) itis displayed in the footer of the tile. Our KEBA devices e.g. are only sending the main meter value :-(

Charging details

If you click on a charge point/connector tile you get a list of the latest transactions and can download them as CSV.

Overview

The Web-UI has two different roles. A normal user can see the charge points and transactions (screenshots above). An Administrator can also create and edit the charge stations, charge tags and connectors.

Multi connector behavior

At first, I didn't pay much attention to multiple connectors. Charge points with multiple connectors are not very common. But then we got the charge points in our home installed and it turned out that our devices (with load management) operate as a single charge point with a connector for each charge point (see here).

I added multi connector support with V1.1. When the server receives an OCPP message with a connector number (status & transaction messages) the OCPP server dynamically builds a list of connectors in the database (table "ConnectorStatus"). Admin users can see this list and can optionally configure custom names.

This results in different scenarios for displaying charge points:

  • A charge point without known connectors => display charge point with its name
  • A charge point with one known connector without a specific name => display one charge point with the charge point name
  • A charge point with 2+ connectors without specific names => display each connector with a default name "charge point name:connector no."

If a connector has a name specified this name overrides the charge point name or default scheme (see above). This allows you to define custom names for every connector (like left / right).

System Requirements

OCPP.Core is written in .NET-Core 3.1 and therefore runs on different plattforms. I also installed it in Azure for testing purposes. The storage is based on the EntityFramework-Core and supports different databases. The project contains script für SQL-Server (SQL-Express) and SQLite.

Referenced Packages:

  • Microsoft.EntityFrameworkCore
  • Microsoft.EntityFrameworkCore.Sqlite
  • Microsoft.EntityFrameworkCore.SqlServer
  • Newtonsoft.Json
  • Karambolo.Extensions.Logging.File

Build, Configuration and Installation

The steps to build, configure and install OCPP.Core are described here in Detail.

Testing it...

Web-UI

Open the configured URL in a browser. The debug URL in the project is "http://localhost:8082/". You should see the login screen. Enter the configured admin account.

Login

Open the "Administration" menu and create a chargepoint with ID "station42" and a charge tag.

Administration menu:

Menu

Create new chargepoint:

NewChargePoint

Optionally, you can add authentication data for this chargepoint: Username/Passwort for basic authentication and/or a certificate thumbprint for a client certificate. When you're editing a chargepoint you can send restart or unlock commands to the chargepoint here.

Create new charge tag:

NewChargeTag

The Web-UI is localized in English and German language

OCPP-Server

An easy way to test the OCPP-Server are simulators:

Attention: Both simulators have minor and major bugs in certain actions. That's why I modified them both and included copies in this project.

Open one of the simulators in the browser and enter "ws://localhost:8081/OCPP/station42" as the central station URL. "station42" is the ID of the chargepoint you created in the previous step.

Enter the charge tag ID you entered before as "Tag".

Click "Connect"

Now the simulator hopefully show a success message at the bottom. When you start a transaction and refresh the Web-UI you should see the corresponding status in the charge point tiles.

About

OCPP server and management UI written in .NET-Core

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 84.6%
  • HTML 13.9%
  • TSQL 1.1%
  • Other 0.4%