Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dinspec implementation #24

Merged
merged 50 commits into from
Apr 12, 2022
Merged

Dinspec implementation #24

merged 50 commits into from
Apr 12, 2022

Conversation

shalinnijel2
Copy link
Contributor

Initial checkin DIN SPEC implementation. Added support for states until ChargeParameterDiscoveryReq.

Copy link
Contributor

@tropxy tropxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Havent finished,but already have some comments

iso15118/evcc/controller/simulator.py Outdated Show resolved Hide resolved
iso15118/evcc/controller/simulator.py Outdated Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
Comment on lines 17 to 56
V2G_SECC_READYTOCHARGE_PERFORMANCE_TIME = 148
V2G_EVCC_READYTOCHARGE_TIMEOUT = 150
V2G_SECC_COMMUNICATIONSETUP_PERFORMANCE_TIME = 18
V2G_EVCC_COMMUNICATIONSETUP_TIMEOUT = 20
V2G_SECC_CABLE_CHECK_PERFORMANCE_TIME = 38
V2G_EVCC_CABLE_CHECK_TIMEOUT = 40
V2G_SECC_PRE_CHARGE_PERFORMANCE_TIME = 5
V2G_EVCC_PRE_CHARGE_TIMEOUT = 7
V2G_SECC_CPState_Detection_Timeout = 1.5
V2G_SECC_CPOscillator_Retain_time = 1.5

# Message specific timings
# Refer section 9.6.2 (Table 75)
SUPPORTED_APP_PROTOCOL_REQ = 2
SESSION_SETUP_REQ = 2
SERVICE_DISCOVERY_REQ = 2
SERVICE_PAYMENT_SELECTION_REQ = 2
CONTRACT_AUTHENTICATION_REQ = 2
CHARGE_PARAMETER_DISCOVERY_REQ = 2
POWER_DELIVERY_REQ = 2
CABLE_CHECK_REQ = 2
PRE_CHARGE_REQ = 2
CURRENT_DEMAND_REQ = 0.25
WELDING_DETECTION_REQ = 2
SESSION_STOP_REQ = 2
SUPPORTED_APP_PROTOCOL_RES = 1.5
SESSION_SETUP_RES = 1.5
SERVICE_DISCOVERY_RES = 1.5
SERVICE_PAYMENT_SELECTION_RES = 1.5
CONTRACT_AUTHENTICATION_RES = 1.5
CHARGE_PARAMETER_DISCOVERY_RES = 1.5
POWER_DELIVERY_RES = 1.5
CABLE_CHECK_RES = 1.5
PRE_CHARGE_RES = 1.5
CURRENT_DEMAND_RES = 0.025
WELDING_DETECTION_RES = 1.5
SESSION_STOP_RES = 1.5

V2G_SECC_SEQUENCE_TIMEOUT = 60
V2G_EVCC_SEQUENCE_PERFORMANCE_TIME = 59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need the performance timers...we are only interested in the timeouts.
it is also a bit counter intuitive, but when we enter into an EVCC state, we already sent a Req, so then we are waiting for the Res and therefore there is a Timeout. In the spec they associate the timeout to the Req, like CHARGE_PARAMETER_DISCOVERY_REQ i.e., the EVCC has sent the CHARGE_PARAMETER_DISCOVERY_REQ message and is waiting for the Response. In my perspective the timeout should be called one of this options:

  • EVCC_CHARGE_PARAMETER_DISCOVERY
  • CHARGE_PARAMETER_DISCOVERY_RES

but not CHARGE_PARAMETER_DISCOVERY_REQ

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm...I see you mean the timeout is actually associated with the upcoming response message and so should indicate that. Instead of saying - this request that I just sent has a timeout value of x_req before receiving a response.

I feel it is a matter of perspective and the convention is to have it from the request's perspecitve. For instance lost ping message would say request timed out?

iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
shalinnijel2 and others added 6 commits March 29, 2022 18:32
… set to false (AB#1439)

Also, Major version for DIN SPEC is 2 (in supportedAppProtocolReq).
* ability to add existing EVSEController

* Separate config validataion in order to have another way to configure iso15118

* Added some some abstract methods for DC-Charging

* Completed State CableCheck. But is not tested

* Added State Precharge

* Implemented CableCheck in EVCC states.
Reached State Precharge with EVCC/EVSE simulation

* simulatin with SECC/EVCC works until beginning of CurrentDemand

* simulatin with SECC/EVCC works until beginning of CurrentDemand

* Simulation with SECC/EVCC reaches CurrentDemand and is constantly sending CurrendDemandReq/Res

* Just Layout changes and some comments. No changes in productive Code

* First sucessfull unittest

* wip DC_state current_demand and pytests

* DC-States until Welding-Detection.

* Added some pytests

* added timeouts for CableCheck and Precharge

* some changes in interface

* implemented feedback from André

* review from Shalin

* improvements #2 from Pullrequest

* improvements # from Pullrequest

* improvements #4 from pullrequest

* reformat code to fullfill black and flake8

* Decreased the number of Precharge cycles to avoid the Timeout. Reformated a few error messages around the code

* Reformated the Exi Codec class creation as its former use complicated testing; fixed the tests

* reformated the code

* fixed flake8 issues

* Revert "Reformated the Exi Codec class creation as its former use complicated testing; fixed the tests"

This reverts commit 1b6e798.

* fixed bugs inserted after the git reverse

* fixed the tests by patching the to_exi method

* flaked 8 the code

* marked tests as async for future compatability and added  mode on the pytest init config as specified here: https://github.com/pytest-dev/pytest-asyncio\#modes

* added conftest

* fixed flake eror

Co-authored-by: Martin Bachmann <martin.bachmann@designwerk.com>
Co-authored-by: tropxy <andre14x@gmail.com>
Copy link
Contributor

@tropxy tropxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just reviewed the EV side.

iso15118/evcc/controller/simulator.py Outdated Show resolved Hide resolved
iso15118/evcc/controller/simulator.py Outdated Show resolved Hide resolved
iso15118/evcc/controller/simulator.py Outdated Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Show resolved Hide resolved
iso15118/evcc/states/din_spec_states.py Outdated Show resolved Hide resolved
@tropxy tropxy marked this pull request as ready for review April 10, 2022 14:27
Copy link
Contributor

@tropxy tropxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check it plz

iso15118/evcc/controller/simulator.py Outdated Show resolved Hide resolved
iso15118/evcc/controller/simulator.py Show resolved Hide resolved
iso15118/shared/messages/din_spec/datatypes.py Outdated Show resolved Hide resolved
iso15118/shared/messages/din_spec/datatypes.py Outdated Show resolved Hide resolved
iso15118/shared/messages/din_spec/datatypes.py Outdated Show resolved Hide resolved
iso15118/secc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/secc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/secc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/secc/states/din_spec_states.py Outdated Show resolved Hide resolved
iso15118/secc/states/din_spec_states.py Outdated Show resolved Hide resolved
@shalinnijel2 shalinnijel2 requested a review from tropxy April 11, 2022 15:15
iso15118/secc/states/din_spec_states.py Outdated Show resolved Hide resolved
@shalinnijel2 shalinnijel2 requested a review from tropxy April 12, 2022 12:30
tropxy
tropxy previously approved these changes Apr 12, 2022
Copy link
Contributor

@tropxy tropxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ufff, it was a tough one!

@tropxy tropxy merged commit a2258b0 into master Apr 12, 2022
@tropxy tropxy deleted the dinspec_implementation branch May 24, 2022 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants