Make the default circular array size a const
[e-mobility-charging-stations-simulator.git] / README.md
1 # ev-simulator
2
3 ## Summary
4
5 Simple [node.js](https://nodejs.org/) program to simulate a set of charging stations based on the OCPP-J 1.6 protocol.
6
7 ## Start
8
9 To start the program, run: `npm start`.
10
11 ## Configuration syntax
12
13 All configuration files are in the JSON standard format.
14
15 The program's global configuration parameters must be within the src/assets/config.json file. A configuration template file is available at [src/assets/config-template.json](src/assets/config-template.json).
16
17 All charging station templates are in the directory [src/assets/station-templates](src/assets/station-templates).
18
19 A list of RFID tags must be defined for the automatic transaction generator with the default location and name src/assets/authorization-tags.json. A template file is available at [src/assets/authorization-tags-template.json](src/assets/authorization-tags-template.json).
20
21 ### Global configuration
22
23 **src/assets/config.json**:
24
25 Key | Value(s) | Default Value | Value type | Description
26 --- | -------| --------------| ---------- | ------------
27 supervisionURLs | | [] | string[] | array of connection URIs to OCPP-J servers
28 distributeStationsToTenantsEqually | true/false | true | boolean | distribute charging stations uniformly to the OCPP-J servers
29 statisticsDisplayInterval | | 60 | integer | seconds between charging stations statistics output in the logs
30 workerProcess | workerSet/staticPool/dynamicPool | workerSet | string | worker threads process type
31 workerStartDelay | | 500 | integer | milliseconds to wait at charging station worker threads startup
32 workerPoolMinSize | | 4 | integer | worker threads pool minimum number of threads
33 workerPoolMaxSize | | 16 | integer | worker threads pool maximum number of threads
34 chargingStationsPerWorker | | 1 | integer | number of charging stations per worker threads for the `workerSet` process type
35 logConsole | true/false | false | boolean | output logs on the console
36 logFormat | | simple | string | winston log format
37 logRotate | true/false | true | boolean | enable daily log files rotation
38 logMaxFiles | | 7 | integer | maximum number of files to keep
39 logLevel | emerg/alert/crit/error/warning/notice/info/debug | info | string | winston logging level
40 logFile | | combined.log | string | log file relative path
41 logErrorFile | | error.log | string | error log file relative path
42 stationTemplateURLs | | {}[] | { file: string; numberOfStations: number; }[] | array of charging template file URIs
43
44 ### Charging station template
45
46 Key | Value(s) | Default Value | Value type | Description
47 --- | -------| --------------| ---------- | ------------
48 supervisionURL | | '' | string | connection URI to OCPP-J server
49 ocppVersion | 1.6 | 1.6 | string | OCPP version
50 ocppProtocol | json | json | string | OCPP protocol
51 authorizationFile | | '' | string | RFID tags list file relative to src/assets path
52 baseName | | '' | string | base name to build charging stations name
53 nameSuffix | | '' | string | name suffix to build charging stations name
54 fixedName | true/false | false | boolean | use the baseName as the charging stations unique name
55 chargePointModel | | '' | string | charging stations model
56 chargePointVendor | | '' | string | charging stations vendor
57 chargeBoxSerialNumberPrefix | | '' | string | charging stations serial number prefix
58 firmwareVersion | | '' | string | charging stations firmware version
59 power | | | integer\|integer[] | charging stations maximum power value(s)
60 powerSharedByConnectors | true/false | false | boolean | charging stations power shared by its connectors
61 powerUnit | W/kW | W | string | charging stations power unit
62 currentOutType | AC/DC | AC | string | charging stations current out type
63 numberOfPhases | 0/1/3 | AC:3/DC:0 | integer | charging stations number of phase(s)
64 numberOfConnectors | | | integer\|integer[] | charging stations number of connector(s)
65 useConnectorId0 | true/false | true | boolean | use connector id 0 definition from the template
66 randomConnectors | true/false | false | boolean | randomize runtime connector id affectation from the connector id definition in template
67 resetTime | | 60 | integer | seconds to wait before the charging stations come back at reset
68 connectionTimeout | | 30 | integer | connection timeout to the OCPP-J server
69 autoReconnectMaxRetries | | -1 (unlimited) | integer | connection retries to the OCPP-J server
70 reconnectExponentialDelay | true/false | false | boolean | connection delay retry to the OCPP-J server
71 registrationMaxRetries | | -1 (unlimited) | integer | charging stations boot notification retries
72 enableStatistics | true/false | true | boolean | enable charging stations statistics
73 voltageOut | | AC:230/DC:400 | integer | charging stations voltage out
74 Configuration | | | ChargingStationConfiguration | charging stations OCPP configuration parameters
75 AutomaticTransactionGenerator | | | AutomaticTransactionGenerator | charging stations ATG configuration
76 Connectors | | | Connectors | charging stations connectors configuration
77
78 #### Configuration section
79
80 ```json
81 "Configuration": {
82 "configurationKey": [
83 ...
84 {
85 "key": "StandardKey",
86 "readonly": false,
87 "value": "StandardValue",
88 "visible": true,
89 "reboot": false
90 },
91 ...
92 {
93 "key": "VendorKey",
94 "readonly": false,
95 "value": "VendorValue",
96 "visible": false,
97 "reboot": true
98 },
99 ...
100 ]
101 }
102 ```
103
104 #### AutomaticTransactionGenerator section
105
106 ```json
107 "AutomaticTransactionGenerator": {
108 "enable": false,
109 "minDuration": 60,
110 "maxDuration": 80,
111 "minDelayBetweenTwoTransactions": 15,
112 "maxDelayBetweenTwoTransactions": 30,
113 "probabilityOfStart": 1,
114 "stopAfterHours": 0.3,
115 "stopOnConnectionFailure": true,
116 "requireAuthorize": false
117 }
118 ```
119 #### Connectors section
120
121 ```json
122 "Connectors": {
123 "0": {},
124 "1": {
125 "bootStatus": "Available",
126 "MeterValues": [
127 ...
128 {
129 "unit": "A",
130 "measurand": "Current.Import"
131 },
132 ...
133 {
134 "unit": "Wh"
135 },
136 ...
137 ]
138 }
139 },
140 ```
141
142 ## OCPP commands
143
144 ### Version 1.6
145
146 TODO
147
148 ## License
149
150 This file and all other files in this repository are licensed under the Apache Software License, v.2 and copyrighted under the copyright in [NOTICE](NOTICE) file, except as noted otherwise in the [LICENSE](LICENSE) file.
151
152 Please note that Docker images can contain other software which may be licensed under different licenses. This LICENSE and NOTICE files are also included in the Docker image. For any usage of built Docker images please make sure to check the licenses of the artifacts contained in the images.