Skip to content

Commit

Permalink
- Adjusted OCPP module to new libocpp namespaces and structure
Browse files Browse the repository at this point in the history
- Added basic OCPP201 module
- Removed config parameters from ocpp201 module and added evse manager requirement

Signed-off-by: pietfried <piet.goempel@pionix.de>
  • Loading branch information
Pietfried committed Feb 23, 2023
1 parent 25f6d43 commit dc6334e
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
generate_config_run_script(CONFIG sil)
generate_config_run_script(CONFIG sil-two-evse)
generate_config_run_script(CONFIG sil-ocpp)
generate_config_run_script(CONFIG sil-ocpp201)
generate_config_run_script(CONFIG sil-dc)
generate_config_run_script(CONFIG sil-two-evse-dc)
generate_config_run_script(CONFIG hil)
Expand Down
152 changes: 152 additions & 0 deletions config/config-sil-ocpp201.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
active_modules:
iso15118_charger:
module: JsRiseV2G
config_implementation:
main:
mqtt_base_path: everest_external/iso15118/java
device: auto
iso15118_car:
module: JsCarV2G
config_implementation:
main:
stack_implementation: RISE-V2G
mqtt_base_path: everest_external/iso15118/ev
device: auto
evse_manager_1:
module: EvseManager
config_module:
connector_id: 1
three_phases: true
has_ventilation: true
country_code: DE
rcd_enabled: true
evse_id: "1"
session_logging: true
session_logging_xml: false
session_logging_path: /tmp
ac_hlc_enabled: false
ac_hlc_use_5percent: false
ac_enforce_hlc: false
connections:
bsp:
- module_id: yeti_driver_1
implementation_id: board_support
powermeter_grid_side:
- module_id: yeti_driver_1
implementation_id: powermeter
slac:
- module_id: slac
implementation_id: evse
hlc:
- module_id: iso15118_charger
implementation_id: charger
evse_manager_2:
module: EvseManager
config_module:
connector_id: 2
three_phases: true
has_ventilation: true
country_code: DE
rcd_enabled: true
evse_id: "2"
session_logging: true
session_logging_xml: false
session_logging_path: /tmp
ac_hlc_enabled: false
ac_hlc_use_5percent: false
ac_enforce_hlc: false
connections:
bsp:
- module_id: yeti_driver_2
implementation_id: board_support
powermeter_grid_side:
- module_id: yeti_driver_2
implementation_id: powermeter
slac:
- module_id: slac
implementation_id: evse
hlc:
- module_id: iso15118_charger
implementation_id: charger
yeti_driver_1:
module: JsYetiSimulator
yeti_driver_2:
module: JsYetiSimulator
slac:
module: JsSlacSimulator
car_simulator_1:
module: JsCarSimulator
config_module:
connector_id: 1
auto_enable: true
auto_exec: false
auto_exec_commands: sleep 1;iec_wait_pwr_ready;sleep 1;draw_power_regulated 16,3;sleep 30;unplug
connections:
simulation_control:
- module_id: yeti_driver_1
implementation_id: yeti_simulation_control
ev:
- module_id: iso15118_car
implementation_id: ev
slac:
- module_id: slac
implementation_id: ev
car_simulator_2:
module: JsCarSimulator
config_module:
connector_id: 2
auto_enable: true
auto_exec: false
connections:
simulation_control:
- module_id: yeti_driver_2
implementation_id: yeti_simulation_control
ev:
- module_id: iso15118_car
implementation_id: ev
slac:
- module_id: slac
implementation_id: ev
ocpp:
module: OCPP201
config_module:
ChargePointConfigPath: config.json
connections:
evse_manager:
- module_id: evse_manager_1
implementation_id: evse
- module_id: evse_manager_2
implementation_id: evse
token_provider_1:
module: JsDummyTokenProviderManual
energy_manager:
module: EnergyManager
connections:
energy_trunk:
- module_id: grid_connection_point
implementation_id: energy_grid
grid_connection_point:
module: EnergyNode
config_module:
fuse_limit_A: 40.0
phase_count: 3
connections:
price_information: []
energy_consumer:
- module_id: evse_manager_1
implementation_id: energy_grid
- module_id: evse_manager_2
implementation_id: energy_grid
powermeter:
- module_id: yeti_driver_1
implementation_id: powermeter
api:
module: API
connections:
evse_manager:
- module_id: evse_manager_1
implementation_id: evse
system:
module: System

x-module-layout: {}
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RISE-V2G:
# OCPP
libocpp:
git: https://github.com/EVerest/libocpp.git
git_tag: 904343c96f945710586b45975beb5b6dfed811d6
git_tag: v0.5.1
# Josev
Josev:
git: https://github.com/EVerest/ext-switchev-iso15118.git
Expand Down
16 changes: 16 additions & 0 deletions modules/OCPP201/OCPP201.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ void OCPP201::init() {

this->charge_point = std::make_unique<ocpp::v201::ChargePoint>(json_config, this->ocpp_share_path.string(),
this->config.MessageLogPath);

int evse_id = 1;
for (const auto &evse : this->r_evse_manager) {
evse->subscribe_session_event([this, evse_id](types::evse_manager::SessionEvent session_event) {
switch (session_event.event) {
case types::evse_manager::SessionEventEnum::SessionStarted:
this->charge_point->on_session_started(evse_id, 1);
break;
case types::evse_manager::SessionEventEnum::SessionFinished:
this->charge_point->on_session_finished(evse_id, 1);
break;
}
});
evse_id++;
}

this->charge_point->start();
}

Expand Down

0 comments on commit dc6334e

Please sign in to comment.