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

Fix compatibility with linux #2

Merged
merged 16 commits into from
Dec 14, 2021
Merged

Fix compatibility with linux #2

merged 16 commits into from
Dec 14, 2021

Conversation

tropxy
Copy link
Contributor

@tropxy tropxy commented Dec 6, 2021

  • Support for IPv6 in Docker
  • Fixed build recipe to be compatible within Linux environment

Makefile Outdated Show resolved Hide resolved
…se; Updated Readme, adding a more detailed explanation of how to handle IPv6 communication within docker; fixed a bug on handling the configuration of the NIC interface
@tropxy tropxy force-pushed the fix_compatibility_linux branch from 9083ab5 to 8faa681 Compare December 7, 2021 20:09
Copy link
Contributor

@MarcMueltin MarcMueltin left a comment

Choose a reason for hiding this comment

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

Some editorial changes needed

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved

try:
nic = get_nic(secc_settings.NETWORK_INTERFACE)
except NoLinkLocalAddressError as exc:
Copy link
Contributor

Choose a reason for hiding this comment

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

So there's a guaranteed link-local address? What if someone configures the wrong interface? I believe we still do need this exception, no?

Copy link
Contributor Author

@tropxy tropxy Dec 8, 2021

Choose a reason for hiding this comment

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

No, there is no guarantee. So, first we need to check if the interface specified exists, secondly, we need to check if the interface contains a link-local address. If any of those checks fail, we raise an error and we are not supposed to go on, i.e. the application is supposed to crash.

Before, the code would just check if we had provided an interface and would not even check if the interface actually existed (would also not check, in this case if the interface had a valid link-local address). Later on, in case the interface didn't exist, this would throw an error but wouldnt be completely explicit:

interface_idx = socket.if_nametoindex(nic)

I modified the code to tackle that issue, but I realise now that it is not enough and we also need to check for the validity of the local link

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Due to the changes on handling exceptions I did some reworking on the UDP client and server services, as in some occasions (namely, when an invalid interface was selected) the code would throw the error:

evcc_1   | sys:1: RuntimeWarning: coroutine 'CommunicationSessionHandler.get_from_rcv_queue' was never awaited
evcc_1   | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
evcc_1   | sys:1: RuntimeWarning: coroutine 'CommunicationSessionHandler.restart_sdp' was never awaited
evcc_1   | RuntimeWarning: Enable tracemalloc to get the object allocation traceback

This was happening, because the UDP server and client tasks were not being handled by the wait_until_finished, which cancels properly the tasks in the list of tasks.

iso15118/shared/exceptions.py Show resolved Hide resolved
template.Dockerfile Outdated Show resolved Hide resolved
template.Dockerfile Outdated Show resolved Hide resolved
…re consise and close to the use case we have. For example, as the NETWORK_INTERFACE is always present, there is no need to scan for all the available interfaces to find one that contains a link-local address.
@tropxy
Copy link
Contributor Author

tropxy commented Dec 8, 2021

I have improved the handling of the network settings. As NETWORK_INTERFACE is always specified, we dont need to scan over the entire list of NICs.

At the start of the UDP server/client, there is a NIC validation step, which if fails, it breaks the entire application. These are the errors raised

  1. Interface cant be found
evcc_1   | Traceback (most recent call last):
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/shared/network.py", line 121, in validate_nic
evcc_1   |     _get_link_local_addr(nic)
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/shared/network.py", line 42, in _get_link_local_addr
evcc_1   |     nic_addr_list = nics_with_addresses[nic]
evcc_1   | KeyError: 'eth1'
evcc_1   |
evcc_1   | The above exception was the direct cause of the following exception:
evcc_1   |
evcc_1   | Traceback (most recent call last):
evcc_1   |   File "/venv/bin/iso15118", line 8, in <module>
evcc_1   |     sys.exit(run())
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/evcc/start_evcc.py", line 23, in run
evcc_1   |     asyncio.run(main())
evcc_1   |   File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
evcc_1   |     return loop.run_until_complete(main)
evcc_1   |   File "/usr/local/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
evcc_1   |     return future.result()
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/evcc/start_evcc.py", line 18, in main
evcc_1   |     await session_handler.start_session_handler()
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/evcc/comm_session_handler.py", line 239, in start_session_handler
evcc_1   |     self.udp_client = await UDPClient.create(self._rcv_queue)
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/evcc/transport/udp_client.py", line 83, in create
evcc_1   |     validate_nic(NETWORK_INTERFACE)
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/shared/network.py", line 123, in validate_nic
evcc_1   |     raise InvalidInterface(
    1 # General Settings
evcc_1   | iso15118.shared.exceptions.InvalidInterface: No interface eth1 with this name was found
  1. Interface was found but it has no link-local attached
evcc_1   | Traceback (most recent call last):
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/shared/network.py", line 121, in validate_nic
evcc_1   |     _get_link_local_addr(nic)
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/shared/network.py", line 52, in _get_link_local_addr
evcc_1   |     raise NoLinkLocalAddressError(
evcc_1   | iso15118.shared.exceptions.NoLinkLocalAddressError: No link-local address was found for interface lo
evcc_1   |
evcc_1   | The above exception was the direct cause of the following exception:
evcc_1   |
evcc_1   | Traceback (most recent call last):
evcc_1   |   File "/venv/bin/iso15118", line 8, in <module>
evcc_1   |     sys.exit(run())
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/evcc/start_evcc.py", line 23, in run
evcc_1   |     asyncio.run(main())
evcc_1   |   File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
evcc_1   |     return loop.run_until_complete(main)
evcc_1   |   File "/usr/local/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
evcc_1   |     return future.result()
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/evcc/start_evcc.py", line 18, in main
evcc_1   |     await session_handler.start_session_handler()
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/evcc/comm_session_handler.py", line 239, in start_session_handler
evcc_1   |     self.udp_client = await UDPClient.create(self._rcv_queue)
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/evcc/transport/udp_client.py", line 83, in create
evcc_1   |     validate_nic(NETWORK_INTERFACE)
evcc_1   |   File "/venv/lib/python3.10/site-packages/iso15118/shared/network.py", line 127, in validate_nic
evcc_1   |     raise InvalidInterface(f"Interface {nic} has no link-local address "
evcc_1   | iso15118.shared.exceptions.InvalidInterface: Interface lo has no link-local address associated with it

@tropxy tropxy requested a review from MarcMueltin December 8, 2021 12:46
README.md Outdated Show resolved Hide resolved
iso15118/evcc/transport/udp_client.py Outdated Show resolved Hide resolved
iso15118/shared/exceptions.py Outdated Show resolved Hide resolved
iso15118/shared/network.py Outdated Show resolved Hide resolved
iso15118/shared/network.py Outdated Show resolved Hide resolved
@tropxy tropxy requested a review from MarcMueltin December 8, 2021 19:34
…de, I did some reworking on the UDP client and server services, as in some occasions (e.g. when the interface configured was invalid) the application would throw the error 'evcc_1 | sys:1: RuntimeWarning: coroutine 'CommunicationSessionHandler.get_from_rcv_queue' was never awaited

evcc_1   | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
evcc_1   | sys:1: RuntimeWarning: coroutine 'CommunicationSessionHandler.restart_sdp' was never awaited
evcc_1   | RuntimeWarning: Enable tracemalloc to get the object allocation traceback'
docker-compose-host-mode.yml Outdated Show resolved Hide resolved
iso15118/evcc/transport/udp_client.py Outdated Show resolved Hide resolved
iso15118/evcc/transport/udp_client.py Outdated Show resolved Hide resolved
iso15118/evcc/transport/udp_client.py Outdated Show resolved Hide resolved
iso15118/secc/comm_session_handler.py Show resolved Hide resolved
iso15118/shared/network.py Outdated Show resolved Hide resolved
@tropxy tropxy requested a review from MarcMueltin December 14, 2021 13:44
iso15118/evcc/transport/udp_client.py Outdated Show resolved Hide resolved
iso15118/evcc/transport/udp_client.py Outdated Show resolved Hide resolved
@tropxy tropxy requested a review from MarcMueltin December 14, 2021 17:01
Copy link
Contributor

@MarcMueltin MarcMueltin left a comment

Choose a reason for hiding this comment

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

Good to go from my side

@tropxy tropxy merged commit 435fb3d into master Dec 14, 2021
MarcMueltin pushed a commit that referenced this pull request Jan 4, 2022
…s to implement the -20 states until ScheduleExchange.

Update README.md (#1)

* Update README.md

Corrected a few typos and added a sentence explaining why JRE is needed

* Update README.md

* Update README.md

* Update README.md

Removed mqtt api as dependency (#3)

Fix compatibility with linux (#2)

* Added ipv6 support in docker world; fixed compatibility issue with sed between BSD and Linux systems

* improved readme

* renamed the .env files to be more intuitive in regards to their purpose; Updated Readme, adding a more detailed explanation of how to handle IPv6 communication within docker; fixed a bug on handling the configuration of the NIC interface

* fixed bug in the host mode compose file

* Added a few more clarification in the build Makefile recipe

* Fixed language typos in the README and removed references to the MQTT api

* Refactored network tools methods and general handling of it, to be more consise and close to the use case we have. For example, as the NETWORK_INTERFACE is always present, there is no need to scan for all the available interfaces to find one that contains a link-local address.

* Removed references ot the PYPI credentials in the Dockerfile

* Fixed bug on printing the interface used

* addressed editorial comments and renamed exception to be consistent

* Fixed docstring typo

* Due to the changes regarding the handling of the exceptions of the code, I did some reworking on the UDP client and server services, as in some occasions (e.g. when the interface configured was invalid) the application would throw the error 'evcc_1   | sys:1: RuntimeWarning: coroutine 'CommunicationSessionHandler.get_from_rcv_queue' was never awaited
evcc_1   | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
evcc_1   | sys:1: RuntimeWarning: coroutine 'CommunicationSessionHandler.restart_sdp' was never awaited
evcc_1   | RuntimeWarning: Enable tracemalloc to get the object allocation traceback'

* improved docs

* fixed grammar and context

* removed more PYPI references

* fixed bug on EVCC side when requesting to stop charging

Simplification of the Authorization process_message method (#5)

* Removed explicit call to process CharParameterDiscoveryReq message; instead we can just decide which is the next expected state

* Updated README and Authoruzation docstring

* converted the wanring to a TODO

improved secc and evcc configuration handling and updated readme (#6)

* improved secc configuration handling and updated readme

* Added configuration handling for the evcc

* Refactored the collection of shared settings and log configuration. Also provided a way to select the location of the PKI certificate structure directory

* Added new line at the end

* improved README

* minor editorial change

Fix 1090 physical types validation error (#7)

* Fixed max value validation for the PhysicalValue types

* Changed multiplier to test the changes

* On favour of DRY, I moved the root_validator of the PhysicalTypes to their parent class

* added extra comment related to the private method validation with pydantic

* changed physical value restrictions after comments by Marc

* Revert "changed physical value restrictions after comments by Marc"

This reverts commit cf88330.

* used the enums for a few fields

Github actions workflow and reformat of the code (#8)

* Added github workflows for testing and publish; Reformatted the code using black and updated the CHANGELOG

* Added initial tests

* reformatted tests

* typo

* install with pip

* attempt to run tests without poetry

* added pytest to the workflow

* suspended temporarily the tests run

* fixed typo

* re-added poetry to call black

* added iso15118 for black

* attempt to run tests (using docker)

* copied tests dir to the container

* retry poetry tests

* added init to iso15118 dir

* docker as testing stage

* try to run tests with poetry again

* run tests with docker

* typo on the github action tag

* Editorial change

Added the skeleton for the remaining states (message handling classes) on the SECC side

Added the skeleton for the remaining states (message handling classes) on the EVCC side

Minor editorial edits and deactivating PnC in the settings to test EIM implementation first

Fixed the list issues regarding the EXI codec as raised by Shalin for the AuthorizationReq message and CertificateInstallationReq message

Implemented AuthorizationReq for EVCC and SECC

Modified exi_codec to complete the list of ISO 15118-20 messages that shall be used to parse an object from an incoming decoded EXI stream.

Implemented ServiceDiscoveryReq and -Res

Implemented ServiceDetailReq and -Res

Implemented ServiceSelectionReq and -Res

Changed settings.py in shared directory as ROOT_DIR did not point to the actual root directory but to settings.py in the shared folder, which messed up the path to the pki folder. As a result, the ssl_context could not be created.

Minor editorial edits and bugfix to get the application to run again

Made use of the new enums INT_16_MIN, INT_16_MAX, INT_8_MIN, INT_8_MAX in common_messages.py and common_types.py

Made use of the new enums INT_16_MAX in evcc_settings.py. Plus minor editorial edits to respect column length of 88

Added the specific payload type for each V2GTP message the EVCC and SECC sends in ISO 15118-20. In -20, we have energy mode-specific payload types we need to distinguish so that the EXI decoder gets pointed to the right XSD to decode the message.

Added the failed response for DCChargeParameterDiscoveryReq and modified the failed_responses.py to return also the payload type, which is important for the EXI codec (as in -20, we have energy mode-specific payload types).

Improved implementation of the class ServiceSelection on EVCC and SECC side

Implemented class DCChargeParameterDiscovery on SECC side

Fixed a small bug after changing the signature of the EVCC interface's get_charge_params_v20() function

Improved implementation of ServiceDiscovery and ServiceDetails in order to better handle the offered and selected service and their associated parameter sets. Needed some changes in the comm_session.py and comm_session_handler.py (both EVCC and SECC) as well as the state classes.

Working on finishing the implementation of the class DC_ChargeParameterDiscovery on the EVCC side. Implementing the ScheduleExchangeReq message.

Changed the implementation of the selected energy service and selected value-added services as session variables in the comm_session object. This way, we have easier access to the various service parameters, especially useful for the selected energy service.

Applied ge and le restrictions to departure_time and added the missing fields ev_max_v2x_energy_request and ev_min_v2x_energy_request to the class DynamicScheduleExchangeReqParams

Finished implementing state DCChargeParameterDiscovery on the EVCC side

Improved/fixed the implementation of class ServiceSelection on SECC side to check if the EVCC selected the correct pairs of service ID and parameter set ID per selected service

Introduced NumericID type in common_types.py and replaced simple int types for schedules IDs etc. with that type. Also changed the name of the class ListOfRootCertificateIDs to RootCertificateIDList to be consistent with the latest changes coming with PR#4

Started implememting the class ScheduleExchange on the SECC side, which includes work on the get_scheduled_se_params() and get_dynamic_se_params() functions on the EVCC and SECC side.

Finished implememting the class ScheduleExchange on the SECC side

Ran black on the files in this branch

Ran flake8 on the files in this branch

Forgot to add evcc_state.py to my last commit
tropxy added a commit that referenced this pull request Apr 1, 2022
* 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 <[email protected]>
Co-authored-by: tropxy <[email protected]>
tropxy added a commit that referenced this pull request Apr 12, 2022
* Updated branch to use jar with DINSpec support

* Updated timeout values for DINSpec. Minor formatting to stop black from complaining.

* Added reference schema files.

* DIN SPEC schema representation - first draft

* Updated din_spec/datatypes.py

* Updated comm_session.py and exi_codec to accept DINSPEC message types.

* Updated abstract method definition in states.py and updated associated implementations in -2 and -20 on both secc and evcc sides.

* Setting preferred protocol to DIN SPEC on evcc side for now (to be changed later.)

* Fixed flake8 and black errors. Removed message types not used by DINSpec.

* Fixed flake8 and black errors. Moved EnergyTransferMode to common enums.

* Initial checkin - DIN SPEC states for EVCC and SECC.

* Code format mods to pass tests on GitHub.

* Support for remaining states till SessionStop

* Refactoring to move common classes between -2 dc and dinspec messages.

* Updated EXICodec.jar with fix for WeldingDetectionRes message (#27)

* feat: Addressed some of the comments on PR(AB#1439)

* feat: DIN SPEC should not be listed in supported protocols if use_tls set to false (AB#1439)

Also, Major version for DIN SPEC is 2 (in supportedAppProtocolReq).

* feat: Add timeout handling to CableCheck, renamed ServiceAndPaymentSelection to ServicePaymentSelection

* feat: Added tests. Fixed identified issue with CableCheck.

* Feature/dc states till session stop (#21)

* 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 <[email protected]>
Co-authored-by: tropxy <[email protected]>

* feat: More fixes. (AB#1439)

* Updated timeout values for DINSpec. Minor formatting to stop black from complaining.

* Added reference schema files.

* DIN SPEC schema representation - first draft

* Updated din_spec/datatypes.py

* Updated comm_session.py and exi_codec to accept DINSPEC message types.

* Updated abstract method definition in states.py and updated associated implementations in -2 and -20 on both secc and evcc sides.

* Setting preferred protocol to DIN SPEC on evcc side for now (to be changed later.)

* Fixed flake8 and black errors. Removed message types not used by DINSpec.

* Fixed flake8 and black errors. Moved EnergyTransferMode to common enums.

* Initial checkin - DIN SPEC states for EVCC and SECC.

* Code format mods to pass tests on GitHub.

* Support for remaining states till SessionStop

* Refactoring to move common classes between -2 dc and dinspec messages.

* feat: Addressed some of the comments on PR(AB#1439)

* feat: DIN SPEC should not be listed in supported protocols if use_tls set to false (AB#1439)

Also, Major version for DIN SPEC is 2 (in supportedAppProtocolReq).

* feat: Add timeout handling to CableCheck, renamed ServiceAndPaymentSelection to ServicePaymentSelection

* feat: Added tests. Fixed identified issue with CableCheck.

* feat: More fixes. (AB#1439)

* feat: Rebased to master. Re-added missed (AB#1439)

* feat: Updated failing tests(AB#1439)

* feat: Addressed comments in PR (AB#1439)

* feat: Fixed failing tests(AB#1439)

* feat: added timeout checkj to CableCheck, WeldingDetection, updated tests., Also added timeout check to WeldingDetectionRes in -2

* feat: Addressed comments on PR. Added missing docstrings.(AB#1439)

* feat: Addressed comments on PR(AB#1439)

* feat: Renamed shared/messages/datatypes_iso15118_2_dinspec to shared/messages/datatypes. Fixed dinspec related mypy issues.

* feat: Fixed flake8 errors

* feat: Updated tests following file rename (AB#1439)

Co-authored-by: lukaslombriserdesignwerk <[email protected]>
Co-authored-by: Martin Bachmann <[email protected]>
Co-authored-by: tropxy <[email protected]>
shalinnijel2 pushed a commit that referenced this pull request Apr 19, 2022
…s to implement the -20 states until ScheduleExchange.

Update README.md (#1)

* Update README.md

Corrected a few typos and added a sentence explaining why JRE is needed

* Update README.md

* Update README.md

* Update README.md

Removed mqtt api as dependency (#3)

Fix compatibility with linux (#2)

* Added ipv6 support in docker world; fixed compatibility issue with sed between BSD and Linux systems

* improved readme

* renamed the .env files to be more intuitive in regards to their purpose; Updated Readme, adding a more detailed explanation of how to handle IPv6 communication within docker; fixed a bug on handling the configuration of the NIC interface

* fixed bug in the host mode compose file

* Added a few more clarification in the build Makefile recipe

* Fixed language typos in the README and removed references to the MQTT api

* Refactored network tools methods and general handling of it, to be more consise and close to the use case we have. For example, as the NETWORK_INTERFACE is always present, there is no need to scan for all the available interfaces to find one that contains a link-local address.

* Removed references ot the PYPI credentials in the Dockerfile

* Fixed bug on printing the interface used

* addressed editorial comments and renamed exception to be consistent

* Fixed docstring typo

* Due to the changes regarding the handling of the exceptions of the code, I did some reworking on the UDP client and server services, as in some occasions (e.g. when the interface configured was invalid) the application would throw the error 'evcc_1   | sys:1: RuntimeWarning: coroutine 'CommunicationSessionHandler.get_from_rcv_queue' was never awaited
evcc_1   | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
evcc_1   | sys:1: RuntimeWarning: coroutine 'CommunicationSessionHandler.restart_sdp' was never awaited
evcc_1   | RuntimeWarning: Enable tracemalloc to get the object allocation traceback'

* improved docs

* fixed grammar and context

* removed more PYPI references

* fixed bug on EVCC side when requesting to stop charging

Simplification of the Authorization process_message method (#5)

* Removed explicit call to process CharParameterDiscoveryReq message; instead we can just decide which is the next expected state

* Updated README and Authoruzation docstring

* converted the wanring to a TODO

improved secc and evcc configuration handling and updated readme (#6)

* improved secc configuration handling and updated readme

* Added configuration handling for the evcc

* Refactored the collection of shared settings and log configuration. Also provided a way to select the location of the PKI certificate structure directory

* Added new line at the end

* improved README

* minor editorial change

Fix 1090 physical types validation error (#7)

* Fixed max value validation for the PhysicalValue types

* Changed multiplier to test the changes

* On favour of DRY, I moved the root_validator of the PhysicalTypes to their parent class

* added extra comment related to the private method validation with pydantic

* changed physical value restrictions after comments by Marc

* Revert "changed physical value restrictions after comments by Marc"

This reverts commit cf88330.

* used the enums for a few fields

Github actions workflow and reformat of the code (#8)

* Added github workflows for testing and publish; Reformatted the code using black and updated the CHANGELOG

* Added initial tests

* reformatted tests

* typo

* install with pip

* attempt to run tests without poetry

* added pytest to the workflow

* suspended temporarily the tests run

* fixed typo

* re-added poetry to call black

* added iso15118 for black

* attempt to run tests (using docker)

* copied tests dir to the container

* retry poetry tests

* added init to iso15118 dir

* docker as testing stage

* try to run tests with poetry again

* run tests with docker

* typo on the github action tag

* Editorial change

Added the skeleton for the remaining states (message handling classes) on the SECC side

Added the skeleton for the remaining states (message handling classes) on the EVCC side

Minor editorial edits and deactivating PnC in the settings to test EIM implementation first

Fixed the list issues regarding the EXI codec as raised by Shalin for the AuthorizationReq message and CertificateInstallationReq message

Implemented AuthorizationReq for EVCC and SECC

Modified exi_codec to complete the list of ISO 15118-20 messages that shall be used to parse an object from an incoming decoded EXI stream.

Implemented ServiceDiscoveryReq and -Res

Implemented ServiceDetailReq and -Res

Implemented ServiceSelectionReq and -Res

Changed settings.py in shared directory as ROOT_DIR did not point to the actual root directory but to settings.py in the shared folder, which messed up the path to the pki folder. As a result, the ssl_context could not be created.

Minor editorial edits and bugfix to get the application to run again

Made use of the new enums INT_16_MIN, INT_16_MAX, INT_8_MIN, INT_8_MAX in common_messages.py and common_types.py

Made use of the new enums INT_16_MAX in evcc_settings.py. Plus minor editorial edits to respect column length of 88

Added the specific payload type for each V2GTP message the EVCC and SECC sends in ISO 15118-20. In -20, we have energy mode-specific payload types we need to distinguish so that the EXI decoder gets pointed to the right XSD to decode the message.

Added the failed response for DCChargeParameterDiscoveryReq and modified the failed_responses.py to return also the payload type, which is important for the EXI codec (as in -20, we have energy mode-specific payload types).

Improved implementation of the class ServiceSelection on EVCC and SECC side

Implemented class DCChargeParameterDiscovery on SECC side

Fixed a small bug after changing the signature of the EVCC interface's get_charge_params_v20() function

Improved implementation of ServiceDiscovery and ServiceDetails in order to better handle the offered and selected service and their associated parameter sets. Needed some changes in the comm_session.py and comm_session_handler.py (both EVCC and SECC) as well as the state classes.

Working on finishing the implementation of the class DC_ChargeParameterDiscovery on the EVCC side. Implementing the ScheduleExchangeReq message.

Changed the implementation of the selected energy service and selected value-added services as session variables in the comm_session object. This way, we have easier access to the various service parameters, especially useful for the selected energy service.

Applied ge and le restrictions to departure_time and added the missing fields ev_max_v2x_energy_request and ev_min_v2x_energy_request to the class DynamicScheduleExchangeReqParams

Finished implementing state DCChargeParameterDiscovery on the EVCC side

Improved/fixed the implementation of class ServiceSelection on SECC side to check if the EVCC selected the correct pairs of service ID and parameter set ID per selected service

Introduced NumericID type in common_types.py and replaced simple int types for schedules IDs etc. with that type. Also changed the name of the class ListOfRootCertificateIDs to RootCertificateIDList to be consistent with the latest changes coming with PR#4

Started implememting the class ScheduleExchange on the SECC side, which includes work on the get_scheduled_se_params() and get_dynamic_se_params() functions on the EVCC and SECC side.

Finished implememting the class ScheduleExchange on the SECC side

Ran black on the files in this branch

Ran flake8 on the files in this branch

Forgot to add evcc_state.py to my last commit
@tropxy tropxy deleted the fix_compatibility_linux branch May 24, 2022 08:45
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.

2 participants