Skip to content

Commit 40b148b

Browse files
hikinggrassPietfried
authored andcommitted
- Restructured libocpp into seperate parts for OCPP1.6 and OCPP2.0.1 and common functionality
- Updated code generator to generate schemas for 1.6 and 2.0.1 - Generalized Websocket, PkiHandler, MessageQueue, types and ChargePoint (all used as common base for 1.6 ChargePoint and 2.0.1 ChargePoint) - Very basic implementation of OCPP2.0.1 ChargePoint (BootNotification) ; Generated Datatypes and Enums are already included - Templated CiString type with length as template parameter - Templated MessageQueue, EnhancedMessage and ControlMessage with OCPP version - MessageQueue now handles message timeouts and respects retry attempts and retry intervals Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de> Signed-off-by: pietfried <piet.goempel@pionix.de>
1 parent 6c36130 commit 40b148b

File tree

332 files changed

+30801
-5661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+30801
-5661
lines changed

CMakeLists.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.14)
22

33
project(ocpp
4-
VERSION 0.4.1
4+
VERSION 0.5
55
DESCRIPTION "A C++ implementation of the Open Charge Point Protocol"
66
LANGUAGES CXX
77
)
@@ -45,8 +45,8 @@ endif()
4545
# library code
4646
add_subdirectory(lib)
4747

48-
# auxillary files
49-
add_subdirectory(aux)
48+
# config and auxillary files
49+
add_subdirectory(config)
5050

5151

5252
# packaging
@@ -74,11 +74,11 @@ if (OCPP_INSTALL)
7474
endif()
7575

7676

77-
if(LIBOCPP_BUILD_EXAMPLES)
78-
message("Building libocpp example binaries.")
77+
if(LIBOCPP16_BUILD_EXAMPLES)
78+
message("Building libocpp 1.6 example binaries.")
7979
add_subdirectory(src)
8080
else()
81-
message("Not building libocpp example binaries.")
81+
message("Not building libocpp 1.6 example binaries.")
8282
endif()
8383

8484
# configure clang-tidy if requested

README.md

+45-15
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
# C++ implementation of OCPP (currently 1.6 JSON)
1+
# C++ implementation of OCPP
22

3-
This is a C++ library implementation of OCPP, currently in Version 1.6 (https://www.openchargealliance.org/protocols/ocpp-16/). It enables charging stations to communicate with cloud backends for remote control, monitoring and billing of charging processes.
3+
This is a C++ library implementation of OCPP for version 1.6 (https://www.openchargealliance.org/protocols/ocpp-16/) and 2.0.1 (https://www.openchargealliance.org/protocols/ocpp-201/). It enables charging stations to communicate with cloud backends for remote control, monitoring and billing of charging processes.
44

55
Libocpp can be used for the communication of one charging station and multiple EVSE using a single websocket connection.
66

7-
## Feature Profile Support
7+
Libocpp provides a complete implementation of OCPP 1.6. The implementation of OCPP 2.0.1 is currently under development.
8+
## Feature Support
89

9-
The following table shows the current support for the listed feature profiles and application notes. The goal is to fully support all of these in the future.
10+
The following tables show the current support for the listed feature profiles / functional blocks and application notes.
1011

11-
| Feature-Profile | Supported |
12+
All documentation and the issue tracking can be found in our main repository here: https://github.com/EVerest/
13+
14+
### Feature Profile Support OCPP 1.6
15+
16+
| Feature Profile | Supported |
1217
| -------------------------- | ------------------------- |
1318
| Core | :heavy_check_mark: yes |
1419
| Firmware Management | :heavy_check_mark: yes |
@@ -23,10 +28,31 @@ The following table shows the current support for the listed feature profiles an
2328
| [Using ISO 15118 Plug & Charge with OCPP 1.6](https://www.openchargealliance.org/uploads/files/ocpp_1_6_ISO_15118_v10.pdf) | :x: |
2429
| [Autocharge](https://github.com/openfastchargingalliance/openfastchargingalliance/blob/master/autocharge-final.pdf) | :heavy_check_mark: yes |
2530

26-
All documentation and the issue tracking can be found in our main repository here: https://github.com/EVerest/
31+
### Functional Block support OCPP 2.0.1
32+
33+
| Functional Block | Supported |
34+
| ------------------------------------- | ------------------------------------ |
35+
| Provisioning | :x: |
36+
| Security | :x: |
37+
| Authorization | :x: |
38+
| LocalAuthorizationList Management | :x: |
39+
| Transactions | :x: |
40+
| RemoteControl | :x: |
41+
| Availability | :x: |
42+
| Reservation | :x: |
43+
| TariffAndCost | :x: |
44+
| MeterValues | :x: |
45+
| SmartCharging | :x: |
46+
| FirmwareManagement | :x: |
47+
| ISO 15118 CertificateManagement | :x: |
48+
| Diagnositcs | :x: |
49+
| DisplayMessage | :x: |
50+
| DataTransfer | :x: |
2751

2852
## CSMS Compatibility
2953

54+
### CSMS Compatibility OCPP 1.6
55+
3056
The following table shows CSMS with which this library was tested. If you provide a CSMS that is not yet listed here, feel free to [contact us](https://lists.lfenergy.org/g/everest)!
3157

3258
- chargecloud
@@ -51,9 +77,13 @@ The following table shows CSMS with which this library was tested. If you provid
5177
- ubitricity
5278
- Weev Energy
5379

80+
### CSMS Compatibility OCPP 2.0.1
81+
82+
The implementation of OCPP 2.0.1 has not yet been tested against any CSMS.
83+
5484
## Integration with EVerest
5585

56-
This library is automatically integrated as the OCPP module within [everest-core](https://github.com/EVerest/everest-core) - the complete software stack for your charging station. It is recommended to use EVerest together with this OCPP implementation.
86+
This library is automatically integrated as the OCPP and OCPP201 module within [everest-core](https://github.com/EVerest/everest-core) - the complete software stack for your charging station. It is recommended to use EVerest together with this OCPP implementation.
5787

5888
If you run libocpp with EVerest, the build process of [everest-core](https://github.com/EVerest/everest-core) will take care of installing all necessary dependencies for you.
5989

@@ -67,7 +97,7 @@ Libocpp needs registered **callbacks** in order to execute control commands defi
6797

6898
The implementation must call **event handlers** of libocpp so that the library can track the state of the charging station and trigger OCPP messages accordingly (e.g. MeterValues.req , StatusNotification.req)
6999

70-
Your reference within libocpp to interact is a single instance to the class [ChargePoint](include/ocpp1_6/charge_point.hpp).
100+
Your reference within libocpp to interact is a single instance to the class [ChargePoint](include/ocpp/v16/charge_point.hpp) for OCPP 1.6 or to the class [ChargePoint](include/ocpp/v201/charge_point.hpp) for OCPP 2.0.1.
71101

72102
### Install libocpp
73103

@@ -92,13 +122,13 @@ Execute cmake and then make install:
92122
make install
93123
```
94124

95-
## Quickstart
125+
## Quickstart for OCPP 1.6
96126

97-
Libocpp provides a small standalone OCPP client that you can control using command line.
127+
Libocpp provides a small standalone OCPP1.6 client that you can control using command line.
98128

99129
Install the dependencies and libocpp as described in [Install libocpp](#install-libocpp).
100130

101-
Make sure you modify the following config entries in the [aux/config.json](aux/config.json) file according to the CSMS you want to connect to before executing make install.
131+
Make sure you modify the following config entries in the [config.json](config/v16/config.json) file according to the CSMS you want to connect to before executing make install.
102132

103133
```json
104134
{
@@ -109,15 +139,15 @@ Make sure you modify the following config entries in the [aux/config.json](aux/c
109139
}
110140
```
111141

112-
Cd into libocpp/build and execute cmake and then make install:
142+
Change into libocpp/build and execute cmake and then make install:
113143

114144
```bash
115145
cd build
116-
cmake -DLIBOCPP_BUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=./dist ..
117-
make install
146+
cmake -DLIBOCPP16_BUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=./dist ..
147+
make -j$(nproc) install
118148
```
119149

120-
Use the following command to start the charge point. Replace the config with [config-docker.json](aux/config-docker.json) if you want to test with the [SteVe](https://github.com/steve-community/steve#docker) CSMS running in a docker container.
150+
Use the following command to start the charge point. Replace the config with [config-docker.json](config/v16/config-docker.json) if you want to test with the [SteVe](https://github.com/steve-community/steve#docker) CSMS running in a docker container.
121151

122152
```bash
123153
./dist/bin/charge_point \

config/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
add_subdirectory(v16)
3+
add_subdirectory(v201)
File renamed without changes.

aux/logging.ini config/logging.ini

File renamed without changes.

aux/CMakeLists.txt config/v16/CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
set(OCPP1_6_PROFILE_SCHEMAS_DIR "profile_schemas/ocpp1_6/")
2-
set(USER_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/user_config/user_config.json")
1+
set(OCPP1_6_PROFILE_SCHEMAS_DIR "profile_schemas/")
2+
set(USER_CONFIG_FILE "user_config/user_config.json")
33
set(SQL_INIT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/init.sql")
4-
set(CERTS_DIR "certs/")
4+
set(CERTS_DIR "../certs/")
55

66
list(APPEND OCPP1_6_PROFILE_SCHEMAS
77
Config.json
@@ -19,14 +19,14 @@ list(TRANSFORM OCPP1_6_PROFILE_SCHEMAS
1919

2020
install(
2121
FILES ${OCPP1_6_PROFILE_SCHEMAS}
22-
DESTINATION ${CMAKE_INSTALL_DATADIR}/everest/ocpp/profile_schemas/ocpp1_6
22+
DESTINATION ${CMAKE_INSTALL_DATADIR}/everest/ocpp/profile_schemas
2323
)
2424

2525
list(APPEND CONFIGS
2626
config.json
2727
config-docker.json
2828
config-docker-tls.json
29-
logging.ini
29+
../logging.ini
3030
)
3131

3232
install(
File renamed without changes.
File renamed without changes.
File renamed without changes.

aux/init.sql config/v16/init.sql

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

config/v201/CMakeLists.txt

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
set(OCPP2_0_1_PROFILE_SCHEMAS_DIR "component_schemas/")
2+
3+
list(APPEND OCPP2_0_1_PROFILE_SCHEMAS
4+
AlignedDataCtrlr.json
5+
AuthCacheCtrlr.json
6+
AuthCtrlr.json
7+
CHAdeMOCtrlr.json
8+
CPPWMController.json
9+
ChargingStation.json
10+
ClockCtrlr.json
11+
Config.json
12+
ConnectedEV.json
13+
Connector.json
14+
Controller.json
15+
CustomizationCtrlr.json
16+
DeviceDataCtrlr.json
17+
DisplayMessageCtrlr.json
18+
DistributionPanel.json
19+
EVSE.json
20+
FiscalMetering.json
21+
ISO15118Ctrlr.json
22+
InternalCtrlr.json
23+
LocalAuthListCtrlr.json
24+
LocalEnergyStorage.json
25+
MonitoringCtrlr.json
26+
OCPPCommCtrlr.json
27+
ReservationCtrlr.json
28+
SampledDataCtrlr.json
29+
SecurityCtrlr.json
30+
SmartChargingCtrlr.json
31+
TariffCostCtrlr.json
32+
TokenReader.json
33+
TxCtrlr.json
34+
)
35+
36+
list(TRANSFORM OCPP2_0_1_PROFILE_SCHEMAS
37+
PREPEND ${OCPP2_0_1_PROFILE_SCHEMAS_DIR})
38+
39+
install(
40+
FILES ${OCPP2_0_1_PROFILE_SCHEMAS}
41+
DESTINATION ${CMAKE_INSTALL_DATADIR}/everest/ocpp201/component_schemas
42+
)
43+
44+
list(APPEND CONFIGS
45+
config.json
46+
../logging.ini
47+
)
48+
49+
install(
50+
FILES ${CONFIGS}
51+
DESTINATION ${CMAKE_INSTALL_DATADIR}/everest/ocpp201
52+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"description": "Schema for AlignedDataCtrlr",
4+
"type": "object",
5+
"properties": {
6+
"Available": {
7+
"characteristics": {
8+
"supportsMonitoring": true,
9+
"dataType": "boolean"
10+
},
11+
"attributes": [
12+
{
13+
"type": "Actual",
14+
"mutability": "ReadOnly"
15+
}
16+
],
17+
"description": "If this variable reports a value of true",
18+
"type": "boolean"
19+
},
20+
"Enabled": {
21+
"characteristics": {
22+
"supportsMonitoring": true,
23+
"dataType": "boolean"
24+
},
25+
"attributes": [
26+
{
27+
"type": "Actual",
28+
"mutability": "ReadWrite"
29+
}
30+
],
31+
"description": "If this variable reports a value of true",
32+
"type": "boolean"
33+
},
34+
"Interval": {
35+
"characteristics": {
36+
"unit": "s",
37+
"supportsMonitoring": true,
38+
"dataType": "integer"
39+
},
40+
"attributes": [
41+
{
42+
"type": "Actual",
43+
"mutability": "ReadWrite"
44+
}
45+
],
46+
"description": "Size (in seconds) of the clock-aligned data interval",
47+
"type": "integer"
48+
},
49+
"Measurands": {
50+
"characteristics": {
51+
"supportsMonitoring": true,
52+
"dataType": "MemberList"
53+
},
54+
"attributes": [
55+
{
56+
"type": "Actual",
57+
"mutability": "ReadWrite"
58+
}
59+
],
60+
"description": "Clock-aligned measurand(s) to be included in MeterValuesRequest",
61+
"type": "string"
62+
},
63+
"SendDuringIdle": {
64+
"characteristics": {
65+
"supportsMonitoring": true,
66+
"dataType": "boolean"
67+
},
68+
"attributes": [
69+
{
70+
"type": "Actual",
71+
"mutability": "ReadWrite"
72+
}
73+
],
74+
"description": "If set to true",
75+
"type": "boolean"
76+
},
77+
"SignReadings": {
78+
"characteristics": {
79+
"supportsMonitoring": true,
80+
"dataType": "boolean"
81+
},
82+
"attributes": [
83+
{
84+
"type": "Actual",
85+
"mutability": "ReadWrite"
86+
}
87+
],
88+
"description": "If set to true",
89+
"type": "boolean"
90+
},
91+
"TxEndedInterval": {
92+
"characteristics": {
93+
"unit": "s",
94+
"supportsMonitoring": true,
95+
"dataType": "integer"
96+
},
97+
"attributes": [
98+
{
99+
"type": "Actual",
100+
"mutability": "ReadWrite"
101+
}
102+
],
103+
"description": "Size (in seconds) of the clock-aligned data interval",
104+
"type": "integer"
105+
},
106+
"TxEndedMeasurands": {
107+
"characteristics": {
108+
"supportsMonitoring": true,
109+
"dataType": "MemberList"
110+
},
111+
"attributes": [
112+
{
113+
"type": "Actual",
114+
"mutability": "ReadWrite"
115+
}
116+
],
117+
"description": "Clock-aligned measurands to be included in the meterValues element of TransactionEventRequest (eventType = Ended)",
118+
"type": "string"
119+
}
120+
},
121+
"required": [
122+
"Interval",
123+
"Measurands",
124+
"TxEndedInterval",
125+
"TxEndedMeasurands"
126+
]
127+
}

0 commit comments

Comments
 (0)