You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Open OCPP** is an Open Source C++ implementation of the OCPP 1.6 protocol written by the [Open Charge Alliance](https://www.openchargealliance.org/).
3
+
**Open OCPP** is an Open Source C++ implementation of the OCPP 1.6 protocol ([Open Charge Alliance](https://www.openchargealliance.org/)).
4
4
This implementation targets only the Websocket/JSON version of this protocol.
5
5
6
6
This implementation is based on the following libraries :
@@ -10,13 +10,15 @@ This implementation is based on the following libraries :
*[doctest](https://github.com/doctest/doctest) : Unit tests
12
12
13
-
**Table of contents**
13
+
## Table of contents
14
14
15
-
1.[Features](#features)
16
-
2.[Build](#build)
17
-
3.[Quick start](#quick-start)
18
-
4.[Contributing](#contributing)
19
-
5.[Examples](./examples/README.md)
15
+
*[Features](#features)
16
+
*[Build](#build)
17
+
*[Quick start](#quick-start)
18
+
+[Charge Point role](#charge-point-role)
19
+
+[Central System role](#central-system-role)
20
+
*[Contributing](#contributing)
21
+
*[Examples](./examples/README.md)
20
22
21
23
## Features
22
24
@@ -30,21 +32,26 @@ This implementation is based on the following libraries :
30
32
31
33
As of this version :
32
34
33
-
* Only websocket client has been implemented
34
-
* Only Charge Point role has been implemented
35
-
* No Charge Point behavior related to the OCPP 1.6 security whitepaper edition 2 has been implemented (work in progress)
36
-
* Nearly all the messages defined in the OCPP 1.6 edition 2 protocol have been implemented
37
-
* Nearly all the configuration keys defined in the OCPP 1.6 edition 2 protocol have been implemented for the Charge Point role
35
+
* No Charge Point nor Central System behavior related to the OCPP 1.6 security whitepaper edition 2 has been implemented (work in progress)
36
+
* All the messages defined in the OCPP 1.6 edition 2 protocol have been implemented except GetCompositeSchedule for Charge Point role
37
+
* All the configuration keys defined in the OCPP 1.6 edition 2 protocol have been implemented for the Charge Point role
38
38
39
39
The user application will have to implement some callbacks to provide the data needed by **Open OCPP** or to handle OCPP events (boot notification, remote start/stop notifications, meter values...).
40
40
41
41
The persistent data handled by **Open OCPP** is stored into a single file which is an [SQLite](https://www.sqlite.org/) database. It contains :
42
42
43
-
* Internal configuration
44
-
* Persistent data : Central System's registration status, connector state, OCPP transaction related messages when offline, StopTx meter values
45
-
* Badge cache and local list
46
-
* Smart charging profile
47
-
* Logs
43
+
* For Charge Point role :
44
+
45
+
+ Internal configuration
46
+
+ Persistent data : Central System's registration status, connector state, OCPP transaction related messages when offline, StopTx meter values
47
+
+ Badge cache and local list
48
+
+ Smart charging profile
49
+
+ Logs
50
+
51
+
* For Central System role :
52
+
53
+
+ Internal configuration
54
+
+ Logs
48
55
49
56
The standard OCPP configuration persistency has to be handled by the user application.
50
57
@@ -56,10 +63,10 @@ The standard OCPP configuration persistency has to be handled by the user applic
56
63
| Firmware Management | Support for firmware update management and diagnostic log file download | Actual file download/upload as well as firmware installation must be handled by the user application in the callbacks provided by **Open OCPP**|
57
64
| Local Auth List Management | Features to manage the local authorization list in Charge Points | None |
58
65
| Reservation | Support for reservation of a Charge Point. | None |
59
-
| Smart Charging | Support for basic Smart Charging, for instance using control pilot | GetCompositeSchedule is not supported for now |
66
+
| Smart Charging | Support for basic Smart Charging, for instance using control pilot | GetCompositeSchedule is not supported for now in Chare Point role |
60
67
| Remote Trigger | Support for remote triggering of Charge Point initiated messages | None |
61
68
62
-
### Supported OCPP configuration keys
69
+
### Supported OCPP configuration keys (Charge Point role)
63
70
64
71
In the "Owner" column, "S" means that the configuration key behavior is handled by the stack, "U" means that it must handled by the user application.
65
72
@@ -160,14 +167,16 @@ And to run the unit tests :
160
167
161
168
## Quick start
162
169
163
-
The best way to start is to take a look at the [examples](./examples/README.md) and more specifically at the [quick start example](./examples/quick_start_chargepoint/README.md).
170
+
The best way to start is to take a look at the [examples](./examples/README.md) and more specifically at the [quick start Charge Point example](./examples/quick_start_chargepoint/README.md) and the [quick start Central System example](./examples/quick_start_centralsystem/README.md).
164
171
165
-
The implementation of a program using **Open OCPP** is done in 3 steps :
172
+
### Charge Point role
173
+
174
+
The implementation of a program using **Open OCPP** in Charge Point role is done in 3 steps :
166
175
* Implementation of the configuration interfaces [IOcppConfig](./src/config/IOcppConfig.h) and [IChargePointConfig](./src/chargepoint/interface/IChargePointConfig.h)
167
176
* Implementation of the event handler interface [IChargePointEventsHandler](./src/chargepoint/interface/IChargePointEventsHandler.h)
168
177
* Instanciation and use of the Charge Point object [IChargePoint](./src/chargepoint/interface/IChargePoint.h)
169
178
170
-
### Configuration interface
179
+
####Configuration interface
171
180
172
181
The configuration interface allow **Open OCPP** to access to the values of the standard OCPP configuration keys and to the user application specific configuration keys.
173
182
@@ -183,7 +192,7 @@ The configuration interface is split in 2 parts :
183
192
184
193
In the examples, the interfaces have been implemented to retrieve the values from a file stored into an INI format. This is a simple implementaton which is good to show how to implement these interfaces but which is not the most optimized one since every access to a configuration value implies a conversion from a string. Try to have a better implementation to boost the performances of the software ;)
185
194
186
-
### Event handler interface
195
+
####Event handler interface
187
196
188
197
Most of the OCPP behavior is handled by **Open OCPP** but to complete the implementation of the OCPP standard, some information may be needed by **Open OCPP** (Meter values, change availability permissions...) or some operations may be done by the user application (File upload/download, firmware install...).
189
198
@@ -193,7 +202,7 @@ Most of the notifications/operations can be left empty if the corresponding OCPP
193
202
194
203
Please keep in mind that all the calls to the event handler interface are made from different threads managed by **Open OCPP** depending the kind of notification/operation and that the treatment of theses calls must not be blocking (except for file upload/download) since it will have an impact to the global scheduling of **Open OCPP**.
195
204
196
-
### Charge Point object
205
+
####Charge Point object
197
206
198
207
This is the easiest part :)
199
208
@@ -222,15 +231,15 @@ Once the Charge Point object has been started, **Open OCPP** will continuously t
222
231
223
232
Connectivity status, registration status and Central System initiated operations will be notified through the event handler interface.
224
233
225
-
OCPP Charge Point operation are triggered by the Charge Point object interface.
234
+
OCPP Charge Point operations are triggered by the Charge Point object interface.
The implementation of a program using **Open OCPP** in Central System role is done in 3 steps :
316
+
* Implementation of the configuration interface [ICentralSystemConfig](./src/centralsystem/interface/ICentralSystemConfig.h)
317
+
* Implementation of the event handler interfaces [ICentralSystemEventsHandler](./src/centralsystem/interface/ICentralSystemEventsHandler.h) and [IChargePointRequestHandler](./src/centralsystem/interface/IChargePointRequestHandler.h)
318
+
* Instanciation and use of the Central System object [ICentralSystem](./src/centralsystem/interface/ICentralSystem.h)
319
+
320
+
#### Configuration interface
321
+
322
+
The configuration interface allow **Open OCPP** to access to its configuration values.
323
+
The persistency of the configuration is not handled by **Open OCPP** for 2 main reasons :
324
+
325
+
* The user application will surely already have a configuration management component
326
+
* The user application may have to access the **Open OCPP** configuration
327
+
328
+
In the examples, the interface has been implemented to retrieve the values from a file stored into an INI format. This is a simple implementaton which is good to show how to implement this interface but which is not the most optimized one since every access to a configuration value implies a conversion from a string. Try to have a better implementation to boost the performances of the software ;)
329
+
330
+
#### Event handler interfaces
331
+
332
+
In Central System role, the OCPP behavior must be implemented by the user application. **Open OCPP** handles all the other layers of the stack (websocket, RPC, JSON serialization/deserialization).
333
+
334
+
The **Open OCPP** stack will interact with the user application through 2 interfaces :
335
+
336
+
*[ICentralSystemEventsHandler](./src/centralsystem/interface/ICentralSystemEventsHandler.h) : used for all connection related events (credentials check, connection notification...)
337
+
*[IChargePointRequestHandler](./src/centralsystem/interface/IChargePointRequestHandler.h) : used to handle incoming requests from a Charge Point (boot notification, status notification, start transaction...)
338
+
339
+
The **ICentralSystemEventsHandler** must be instanciated only once for a Central System implementation.
340
+
341
+
The **IChargePointRequestHandler** must be instanciated and registered to each connected Charge Point in the **ICentralSystemEventsHandler::chargePointConnected** method implementation.
Please keep in mind that all the calls to the event handler interface are made from different threads managed by **Open OCPP** depending the kind of notification/operation and that the treatment of theses calls must not be blocking since it will have an impact to the global scheduling of **Open OCPP**.
367
+
368
+
#### Central System object
369
+
370
+
This is the easiest part :)
371
+
372
+
The Central System object is instanciated through a factory interface :
The 2 parameters are the instances of the interfaces you have implemented in the previous steps.
385
+
386
+
Before starting the Central System object and thus the OCPP stack with the ```start()``` method, you can clear existing persistent data using the following method:
387
+
388
+
```resetData()``` : clear all the persistent data
389
+
390
+
Once the Central System object has been started, **Open OCPP** will continuously listen to incoming connections from the Charge Points until a call to the ```stop()``` method which will disconnect all the Charge Points and release the connection.
391
+
392
+
Connectivity status and Charge Point initiated operations will be notified through the event handler interfaces.
393
+
394
+
OCPP Central System operations are triggered by the Charge Point proxy interface [ICentralSystem::IChargePoint](./src/centralsystem/interface/ICentralSystem.h) which is instanciated by **Open OCPP** for each connected Charge Point.
Copy file name to clipboardExpand all lines: examples/README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,10 @@
3
3
All the examples are licensed under the MIT licence so that code can be used and modified at will without having to contribute back.
4
4
5
5
The following examples are available :
6
+
*[Quick start Central System example](./quick_start_centralsystem/README.md)
6
7
*[Quick start Charge Point example](./quick_start_chargepoint/README.md)
7
8
*[Remote Charge Point example](./remote_chargepoint/README.md)
8
9
9
10
How to run the examples:
10
11
* Customize the *config.ini* file of the selected example with the URL of the Central System and the other connection parameters has well has the OCPP configuration keys
11
-
* Run the exmaple using the **-w** option to specify the path of the configuration file
12
+
* Run the example using the **-w** option to specify the path of the configuration file
0 commit comments