Skip to content

Commit

Permalink
Adding Evse15118D20 module for iso15118-20 beta support:
Browse files Browse the repository at this point in the history
- Added config/config-sil-dc-d20.yaml for SIL testing
- Added Evse15118D20 module
- Modified PyEvJosev module for supported services
- Use device config option
- Additional umwc iso stop handlers
- Added logging skeleton
- Supporting tls negotiation strategy
- Support for exi log messages
- Logging format changes
- DC_EV_TargetVoltageCurrent is now published
- Added support for configurable keyfile password
- Added v2g_setup_finished & current_demand_started var callback
- Added signal start_cable_check
- Added first simple control event
- Added stop and unplug cmds to the auto exec commands. Now the ev stops the charging process after 15 seconds
- Send control_event presentvoltagecurrent
- Added the new feedback signals and foward the authorization status to the d20 state machine
- Handle_session_setup() is now in use
- Handle StopCharging
- Adding v2g_message_id callback, v2g_message_xml & json are now really optional
- Adding bidirectional to iso15118_charger interface
- Updating logging_callback with LogLevels

Co-authored-by: Cornelius Claussen <[email protected]>
Co-authored-by: Sebastian Lukas <[email protected]>
Signed-off-by: aw <[email protected]>
Signed-off-by: Sebastian Lukas <[email protected]>
  • Loading branch information
3 people committed Sep 17, 2024
1 parent fd3bf0f commit fdaf2bc
Show file tree
Hide file tree
Showing 25 changed files with 1,204 additions and 22 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/modules/EnergyNode/ @corneliusclaussen @hikinggrass @pietfried
/modules/EvseManager/ @corneliusclaussen @SebaLukas @hikinggrass @pietfried
/modules/EvManager/ @SebaLukas @pietfried @MarzellT
/modules/Evse15118D20/ @SebaLukas @a-w50 @corneliusclaussen
/modules/EvseSecurity/ @AssemblyJohn @pietfried @hikinggrass
/modules/EvseV2G/ @corneliusclaussen @SebaLukas @james-ctc
/modules/EvseSlac/ @a-w50 @corneliusclaussen @SebaLukas
Expand Down
1 change: 1 addition & 0 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ 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-dc-d20)
generate_config_run_script(CONFIG sil-dc-tls)
generate_config_run_script(CONFIG sil-dc-sae-v2g)
generate_config_run_script(CONFIG sil-dc-sae-v2h)
Expand Down
149 changes: 149 additions & 0 deletions config/config-sil-dc-d20.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
active_modules:
iso15118_charger:
module: Evse15118D20
config_module:
device: auto
iso15118_car:
module: PyEvJosev
config_module:
device: auto
supported_DIN70121: true
supported_ISO15118_2: true
supported_ISO15118_20_DC: true
tls_active: true
evse_manager:
module: EvseManager
config_module:
connector_id: 1
evse_id: DE*PNX*E12345*1
evse_id_din: 49A80737A45678
session_logging: true
session_logging_xml: false
session_logging_path: /tmp/everest-logs
charge_mode: DC
hack_allow_bpt_with_iso2: true
payment_enable_contract: false
connections:
bsp:
- module_id: yeti_driver
implementation_id: board_support
powermeter_car_side:
- module_id: powersupply_dc
implementation_id: powermeter
slac:
- module_id: slac
implementation_id: evse
hlc:
- module_id: iso15118_charger
implementation_id: charger
powersupply_DC:
- module_id: powersupply_dc
implementation_id: main
imd:
- module_id: imd
implementation_id: main
powersupply_dc:
module: DCSupplySimulator
yeti_driver:
module: JsYetiSimulator
config_module:
connector_id: 1
slac:
module: JsSlacSimulator
imd:
config_implementation:
main:
selftest_success: true
module: IMDSimulator
ev_manager:
module: EvManager
config_module:
connector_id: 1
auto_enable: true
auto_exec: false
auto_exec_commands: sleep 3;iso_wait_slac_matched;iso_start_v2g_session DC;iso_wait_pwr_ready;iso_wait_for_stop 15;iso_wait_v2g_session_stopped;unplug;
dc_target_current: 20
dc_target_voltage: 400
connections:
ev_board_support:
- module_id: yeti_driver
implementation_id: ev_board_support
ev:
- module_id: iso15118_car
implementation_id: ev
slac:
- module_id: slac
implementation_id: ev
auth:
module: Auth
config_module:
connection_timeout: 10
selection_algorithm: FindFirst
connections:
token_provider:
- module_id: token_provider
implementation_id: main
token_validator:
- module_id: token_validator
implementation_id: main
evse_manager:
- module_id: evse_manager
implementation_id: evse
token_provider:
module: DummyTokenProvider
config_implementation:
main:
token: TOKEN1
connections:
evse:
- module_id: evse_manager
implementation_id: evse
token_validator:
module: DummyTokenValidator
config_implementation:
main:
validation_result: Accepted
validation_reason: Token seems valid
sleep: 0.25
evse_security:
module: EvseSecurity
config_module:
private_key_password: "123456"
energy_manager:
module: EnergyManager
config_module:
schedule_total_duration: 1
schedule_interval_duration: 60
debug: false
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
implementation_id: energy_grid
powermeter:
- module_id: yeti_driver
implementation_id: powermeter
api:
module: API
connections:
evse_manager:
- module_id: evse_manager
implementation_id: evse
error_history:
- module_id: error_history
implementation_id: error_history
error_history:
module: ErrorHistory
config_implementation:
error_history:
database_path: /tmp/error_history.db
x-module-layout: {}
6 changes: 6 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ libfsm:
git_tag: v0.2.0
cmake_condition: "EVEREST_DEPENDENCY_ENABLED_LIBFSM"

# libiso15118
libiso15118:
git: https://github.com/EVerest/libiso15118.git
git_tag: v0.2.0
cmake_condition: "EVEREST_DEPENDENCY_ENABLED_LIBISO15118"

# LEM DCBM 400/600 module
libcurl:
git: https://github.com/curl/curl.git
Expand Down
8 changes: 8 additions & 0 deletions interfaces/ISO15118_charger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ cmds:
debug_mode:
description: Enable/Disable debug mode
type: boolean
bidirectional:
description: Set true if the powersupply (AC or DC) supports bidi mode
type: boolean
set_charging_parameters:
description: >-
At startup, set the the charging parameters at least once. May be updated later on.
Expand Down Expand Up @@ -346,3 +349,8 @@ vars:
description: >-
Debug - Contains the selected protocol
type: string
display_parameters:
description: >-
Parameters that may be displayed on the EVSE (Soc, battery capacity)
type: object
$ref: /iso15118_charger#/DisplayParameters
5 changes: 5 additions & 0 deletions module-dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ ev_define_dependency(
DEPENDENCY_NAME sqlite_cpp
DEPENDENT_MODULES_LIST ErrorHistory)

ev_define_dependency(
DEPENDENCY_NAME libiso15118
OUTPUT_VARIABLE_SUFFIX LIBISO15118
DEPENDENT_MODULES_LIST Evse15118D20)

if(NOT everest-gpio IN_LIST EVEREST_EXCLUDE_DEPENDENCIES)
set(EVEREST_DEPENDENCY_ENABLED_EVEREST_GPIO ON)
else()
Expand Down
1 change: 1 addition & 0 deletions modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ev_add_module(EnergyManager)
ev_add_module(EnergyNode)
ev_add_module(EvManager)
ev_add_module(ErrorHistory)
ev_add_module(Evse15118D20)
ev_add_module(EvseManager)
ev_add_module(EvseSecurity)
ev_add_module(EvseSlac)
Expand Down
11 changes: 6 additions & 5 deletions modules/DummyV2G/main/ISO15118_chargerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ void ISO15118_chargerImpl::ready() {
void ISO15118_chargerImpl::handle_setup(
types::iso15118_charger::EVSEID& evse_id,
std::vector<types::iso15118_charger::EnergyTransferMode>& supported_energy_transfer_modes,
types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) {
types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode, bool& bidirectional) {
// your code for cmd setup goes here
}

void ISO15118_chargerImpl::handle_set_charging_parameters(
types::iso15118_charger::SetupPhysicalValues& physical_values) {
// your code for cmd set_charging_parameters goes here
}

void ISO15118_chargerImpl::handle_session_setup(std::vector<types::iso15118_charger::PaymentOption>& payment_options,
bool& supported_certificate_service) {
// your code for cmd session_setup goes here
Expand Down Expand Up @@ -55,10 +60,6 @@ void ISO15118_chargerImpl::handle_stop_charging(bool& stop) {
// your code for cmd stop_charging goes here
}

void ISO15118_chargerImpl::handle_set_charging_parameters(
types::iso15118_charger::SetupPhysicalValues& physical_values) {
}

void ISO15118_chargerImpl::handle_update_ac_max_current(double& max_current) {
// your code for cmd update_ac_max_current goes here
}
Expand Down
3 changes: 2 additions & 1 deletion modules/DummyV2G/main/ISO15118_chargerImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class ISO15118_chargerImpl : public ISO15118_chargerImplBase {
// command handler functions (virtual)
virtual void handle_setup(types::iso15118_charger::EVSEID& evse_id,
std::vector<types::iso15118_charger::EnergyTransferMode>& supported_energy_transfer_modes,
types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode) override;
types::iso15118_charger::SaeJ2847BidiMode& sae_j2847_mode, bool& debug_mode,
bool& bidirectional) override;
virtual void handle_set_charging_parameters(types::iso15118_charger::SetupPhysicalValues& physical_values) override;
virtual void handle_session_setup(std::vector<types::iso15118_charger::PaymentOption>& payment_options,
bool& supported_certificate_service) override;
Expand Down
29 changes: 29 additions & 0 deletions modules/Evse15118D20/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# AUTO GENERATED - MARKED REGIONS WILL BE KEPT
# template version 3
#

# module setup:
# - ${MODULE_NAME}: module name
ev_setup_cpp_module()

# ev@bcc62523-e22b-41d7-ba2f-825b493a3c97:v1
target_sources(${MODULE_NAME}
PRIVATE
charger/session_logger.cpp
)

target_link_libraries(${MODULE_NAME}
PRIVATE
iso15118::iso15118
)
# ev@bcc62523-e22b-41d7-ba2f-825b493a3c97:v1

target_sources(${MODULE_NAME}
PRIVATE
"charger/ISO15118_chargerImpl.cpp"
)

# ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1
# insert other things like install cmds etc here
# ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1
15 changes: 15 additions & 0 deletions modules/Evse15118D20/Evse15118D20.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Pionix GmbH and Contributors to EVerest
#include "Evse15118D20.hpp"

namespace module {

void Evse15118D20::init() {
invoke_init(*p_charger);
}

void Evse15118D20::ready() {
invoke_ready(*p_charger);
}

} // namespace module
66 changes: 66 additions & 0 deletions modules/Evse15118D20/Evse15118D20.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Pionix GmbH and Contributors to EVerest
#ifndef EVSE15118D20_HPP
#define EVSE15118D20_HPP

//
// AUTO GENERATED - MARKED REGIONS WILL BE KEPT
// template version 2
//

#include "ld-ev.hpp"

// headers for provided interface implementations
#include <generated/interfaces/ISO15118_charger/Implementation.hpp>

// ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1
// insert your custom include headers here
// ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1

namespace module {

struct Conf {
std::string device;

Check notice on line 23 in modules/Evse15118D20/Evse15118D20.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/Evse15118D20/Evse15118D20.hpp#L23

struct member 'Conf::device' is never used.
std::string certificate_path;

Check notice on line 24 in modules/Evse15118D20/Evse15118D20.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/Evse15118D20/Evse15118D20.hpp#L24

struct member 'Conf::certificate_path' is never used.
std::string logging_path;

Check notice on line 25 in modules/Evse15118D20/Evse15118D20.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/Evse15118D20/Evse15118D20.hpp#L25

struct member 'Conf::logging_path' is never used.
std::string tls_negotiation_strategy;

Check notice on line 26 in modules/Evse15118D20/Evse15118D20.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/Evse15118D20/Evse15118D20.hpp#L26

struct member 'Conf::tls_negotiation_strategy' is never used.
std::string private_key_password;

Check notice on line 27 in modules/Evse15118D20/Evse15118D20.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/Evse15118D20/Evse15118D20.hpp#L27

struct member 'Conf::private_key_password' is never used.
bool enable_ssl_logging;

Check notice on line 28 in modules/Evse15118D20/Evse15118D20.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/Evse15118D20/Evse15118D20.hpp#L28

struct member 'Conf::enable_ssl_logging' is never used.
bool enable_tls_key_logging;

Check notice on line 29 in modules/Evse15118D20/Evse15118D20.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/Evse15118D20/Evse15118D20.hpp#L29

struct member 'Conf::enable_tls_key_logging' is never used.
};

class Evse15118D20 : public Everest::ModuleBase {
public:
Evse15118D20() = delete;
Evse15118D20(const ModuleInfo& info, std::unique_ptr<ISO15118_chargerImplBase> p_charger, Conf& config) :
ModuleBase(info), p_charger(std::move(p_charger)), config(config){};

const std::unique_ptr<ISO15118_chargerImplBase> p_charger;
const Conf& config;

// ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1
// insert your public definitions here
// ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1

protected:
// ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1
// insert your protected definitions here
// ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1

private:
friend class LdEverest;
void init();
void ready();

// ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1
// insert your private definitions here
// ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1
};

// ev@087e516b-124c-48df-94fb-109508c7cda9:v1
// insert other definitions here
// ev@087e516b-124c-48df-94fb-109508c7cda9:v1

} // namespace module

#endif // EVSE15118D20_HPP
Loading

0 comments on commit fdaf2bc

Please sign in to comment.