Giter Site home page Giter Site logo

iso15118's People

Contributors

aadritg avatar adoebber avatar anudeep-20 avatar danielgordon-switch-ev avatar dependabot[bot] avatar guanminliao avatar heavyweight87 avatar ikaratass avatar lukaslombriserdesignwerk avatar marcmueltin avatar martinbachmanndesignwerk avatar mdwcrft avatar nikkigithub1 avatar orangetux avatar rstanchak avatar santiagosalamandri avatar sdrabb avatar sebalukas avatar shalinnijel2 avatar snorkman88 avatar touchlinux avatar tropxy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

iso15118's Issues

Timeout wrong for the SessionSetup sequence

The file 'iso15118/shared/messages/timeouts.py' states a value of 20.0 seconds for:
V2G_EVCC_COMMUNICATION_SETUP_TIMEOUT
The specification for iso1 and din however specifies 2.0 seconds.

Am I missing something here or is it simply wrong in this file?

The file 'tests/dinspec/evcc/test_dinspec_evcc_states.py' even has a value of 1 so it looks some (wrong) duplication or mis-alignment is present in the different files?

The ProfileEntryType/RelativeTimeInterval check has a wrong limit check.

The PMaxType in the DIN 70121:2014 specification has a range of 0 to UINT16_MAX so le=65535 but it rejects a message on a le=255 boundary for the message "ChargeParameterDiscoveryRes".

Also the alias looks wrong and should me 'PMax' iso 'ChargingProfileMaxPower' ?

Also the python code completely breaks on this with a very sloppy stack trace, instead of a descent handling/displaying of the error.

See this dump:

{'V2G_Message': {'Header': {'SessionID': '4242424242424242'}, 'Body': {'ChargeParameterDiscoveryRes': {'ResponseCode': 'OK', 'EVSEProcessing': 'Finished', 'SAScheduleList': {'SAScheduleTuple': [{'SAScheduleTupleID': 1, 'PMaxSchedule': {'PMaxScheduleID': 1, 'PMaxScheduleEntry': [{'RelativeTimeInterval': {'start': 0, 'duration': 28800}, 'PMax': 32767}]}}]}, 'DC_EVSEChargeParameter': {'DC_EVSEStatus': {'EVSEIsolationStatus': 'Invalid', 'EVSEStatusCode': 'EVSE_IsolationMonitoringActive', 'NotificationMaxDelay': 0, 'EVSENotification': 'None'}, 'EVSEMaximumCurrentLimit': {'Multiplier': 0, 'Unit': 'A', 'Value': 180}, 'EVSEMaximumPowerLimit': {'Multiplier': 1, 'Unit': 'W', 'Value': 18000}, 'EVSEMaximumVoltageLimit': {'Multiplier': 0, 'Unit': 'V', 'Value': 1000}, 'EVSEMinimumCurrentLimit': {'Multiplier': 0, 'Unit': 'A', 'Value': 0}, 'EVSEMinimumVoltageLimit': {'Multiplier': 0, 'Unit': 'V', 'Value': 200}, 'EVSEPeakCurrentRipple': {'Multiplier': 0, 'Unit': 'A', 'Value': 1}}}}}}
XSD namespace: urn:din:70121:2012:MsgDef
INFO 2022-08-03 16:08:55,952 - iso15118.shared.comm_session (215): ChargeParameterDiscoveryRes received
ERROR 2022-08-03 16:08:55,952 - iso15118.shared.comm_session (226): ValidationError: [ErrorWrapper(exc=NumberNotLeError(), loc=('ChargingProfileMaxPower',))]
Traceback (most recent call last):
File "/home/henri/SwitchEV/iso15118/iso15118/shared/comm_session.py", line 216, in process_message
await self.current_state.process_message(decoded_message, v2gtp_msg.payload)
File "/home/henri/SwitchEV/iso15118/iso15118/evcc/states/din_spec_states.py", line 382, in process_message
schedule_id = await ev_controller.process_sa_schedules_dinspec(
File "/home/henri/SwitchEV/iso15118/iso15118/evcc/controller/simulator.py", line 469, in process_sa_schedules_dinspec
profile_entry_details = ProfileEntryDetailsDINSPEC(
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for ProfileEntryDetails
ChargingProfileMaxPower
ensure this value is less than or equal to 255 (type=value_error.number.not_le; limit_value=255)
INFO 2022-08-03 16:08:55,953 - iso15118.shared.comm_session (371): The data link will Terminate in 2 seconds and the TCP connection will close in 5 seconds.
INFO 2022-08-03 16:08:55,953 - iso15118.shared.comm_session (375): Reason: ValidationError occurred while processing message in state ChargeParameterDiscovery: 1 validation error for ProfileEntryDetails
ChargingProfileMaxPower
ensure this value is less than or equal to 255 (type=value_error.number.not_le; limit_value=255)

Communication is closed after ServiceDiscovery

I'm testing the project with a Tesla Model S, my hardware is a Raspi3 + QCA7000. I followed the documentation and successfully ran pyslac and iso15118 (0.10.2), but after the first handshake the communication is lost. I tried reading the code but I don't see any obvious issue.

(iso15118-py3.10) pi@raspberrypi:~/josev/iso15118 $ make run-secc
make[1]: Entering directory '/home/pi/josev/iso15118'
/home/pi/.cache/pypoetry/virtualenvs/iso15118--MgU4mn_-py3.10/bin/python iso15118/secc/main.py
DEBUG    2022-09-08 17:19:06,002 - asyncio (54): Using selector: EpollSelector
INFO    2022-09-08 17:19:22,343 - iso15118.secc.secc_settings (88): Using CPO Backend: False
INFO    2022-09-08 17:19:22,345 - iso15118.secc.secc_settings (128): Loaded protocols: ['ISO_15118_2', 'DIN_SPEC_70121', 'ISO_15118_20_AC']
INFO    2022-09-08 17:19:22,347 - iso15118.secc.secc_settings (140): Loaded authentication modes: ['EIM', 'PNC']
INFO    2022-09-08 17:19:22,367 - iso15118.shared.exi_codec (175): EXI Codec version: 1.55
INFO    2022-09-08 17:19:22,368 - iso15118.secc.comm_session_handler (199): Communication session handler started
INFO    2022-09-08 17:19:22,386 - iso15118.secc.transport.udp_server (110): UDP server socket ready
INFO    2022-09-08 17:19:22,390 - iso15118.secc.transport.udp_server (97): UDP server started at address FF02::1%eth1 and port 15118
INFO    2022-09-08 17:19:22,393 - iso15118.secc.transport.tcp_server (109): TLS server started at address fe80::8905:3a7f:a326:7eee%eth1 and port 60332
INFO    2022-09-08 17:19:22,394 - iso15118.secc.transport.tcp_server (109): TCP server started at address fe80::8905:3a7f:a326:7eee%eth1 and port 60903
DEBUG    2022-09-08 17:19:32,116 - iso15118.secc.transport.udp_server (125): Message received from ('fe80::9aed:5cff:fe9a:9090', 49153, 0, 3): 01fe9000000000021000
DEBUG    2022-09-08 17:19:32,118 - iso15118.secc.comm_session_handler (288): SDPRequest received: [Security: NO_TLS, Protocol: TCP]
DEBUG    2022-09-08 17:19:32,120 - iso15118.secc.comm_session_handler (328): Sending SDPResponse: [ IP address: fe80::8905:3a7f:a326:7eee, Port: 60903 , Security: NO_TLS , Transport: TCP ]
DEBUG    2022-09-08 17:19:32,159 - iso15118.secc.comm_session_handler (224): TCP client connected, client address is ('fe80::9aed:5cff:fe9a:9090', 49153, 0, 3).
INFO    2022-09-08 17:19:32,242 - iso15118.shared.comm_session (341): Starting a new communication session
INFO    2022-09-08 17:19:32,243 - iso15118.shared.states (137): Entered state SupportedAppProtocol
INFO    2022-09-08 17:19:32,244 - iso15118.shared.states (141): Waiting for up to 20.0 s
DEBUG    2022-09-08 17:19:33,420 - iso15118.shared.exi_codec (313): Decoded message:
{'supportedAppProtocolReq': {'AppProtocol': [{'ProtocolNamespace': 'urn:din:70121:2012:MsgDef', 'VersionNumberMajor': 2, 'VersionNumberMinor': 0, 'SchemaID': 1, 'Priority': 2}, {'ProtocolNamespace': 'urn:tesla:din:2018:MsgDef', 'VersionNumberMajor': 0, 'VersionNumberMinor': 7, 'SchemaID': 2, 'Priority': 1}]}}
 XSD namespace: urn:iso:15118:2:2010:AppProtocol
INFO    2022-09-08 17:19:33,422 - iso15118.shared.comm_session (231): supportedAppProtocolReq received
DEBUG    2022-09-08 17:19:33,426 - iso15118.shared.exi_codec (246): Message to encode:
{"supportedAppProtocolRes": {"ResponseCode": "OK_SuccessfulNegotiation", "SchemaID": 1}}
XSD namespace: urn:iso:15118:2:2010:AppProtocol
DEBUG    2022-09-08 17:19:33,809 - iso15118.secc.states.sap_states (146): Chosen protocol: DIN_SPEC_70121
INFO    2022-09-08 17:19:33,810 - iso15118.shared.comm_session (415): Sending supportedAppProtocolRes
INFO    2022-09-08 17:19:33,811 - iso15118.shared.states (137): Entered state SessionSetup
INFO    2022-09-08 17:19:33,812 - iso15118.shared.states (141): Waiting for up to 20.0 s
DEBUG    2022-09-08 17:19:36,742 - iso15118.shared.exi_codec (313): Decoded message:
{'V2G_Message': {'Header': {'SessionID': '0000000000000000'}, 'Body': {'SessionSetupReq': {'EVCCID': '98ED5C9A9090'}}}}
 XSD namespace: urn:din:70121:2012:MsgDef
INFO    2022-09-08 17:19:36,744 - iso15118.shared.comm_session (231): SessionSetupReq received
WARNING    2022-09-08 17:19:36,745 - iso15118.secc.states.din_spec_states (114): EVCC's session ID 0000000000000000 does not match . New session ID ACEBA28B4F011F3A assigned
DEBUG    2022-09-08 17:19:36,749 - iso15118.shared.exi_codec (246): Message to encode:
{"V2G_Message": {"Header": {"SessionID": "ACEBA28B4F011F3A"}, "Body": {"SessionSetupRes": {"ResponseCode": "OK_NewSessionEstablished", "EVSEID": "49A89A6361", "DateTimeNow": 1662650376}}}}
XSD namespace: urn:din:70121:2012:MsgDef
INFO    2022-09-08 17:19:38,136 - iso15118.shared.comm_session (415): Sending SessionSetupRes
INFO    2022-09-08 17:19:38,138 - iso15118.shared.states (137): Entered state ServiceDiscovery
INFO    2022-09-08 17:19:38,140 - iso15118.shared.states (141): Waiting for up to 60.0 s
INFO    2022-09-08 17:19:38,143 - iso15118.shared.comm_session (387): The data link will Terminate in 2 seconds and the TCP connection will close in 5 seconds.
INFO    2022-09-08 17:19:38,144 - iso15118.shared.comm_session (391): Reason: TCP peer closed connection
INFO    2022-09-08 17:19:40,148 - iso15118.shared.comm_session (396): Terminated the data link
INFO    2022-09-08 17:19:43,155 - iso15118.shared.comm_session (403): TCP connection closed to peer with address ('fe80::9aed:5cff:fe9a:9090', 49153, 0, 3)
DEBUG    2022-09-08 17:19:43,158 - iso15118.secc.comm_session_handler (268): Existing session with ('fe80::9aed:5cff:fe9a:9090', 49153, 0, 3) ended.

On Wireshark, I see a 0 length tcp packet sent to the car, and after that the connection is closed:
image

Am I doing something wrong?
Thanks

How to disable json format conversion before/after EXI encode/decode

As per ISO15118-2, EXI encoding/decoding output message format is different than JSON format. Is there any way to disable JSON conversion before/after EXI encoding/decoding.
for example SessionSetupRes message
the xml format is

<v2gci_d:V2G_Message
xmlns:v2gci_h="urn:iso:15118:2:2013:MsgHeader"
xmlns:v2gci_d="urn:iso:15118:2:2013:MsgDef"
xmlns:v2gci_t="urn:iso:15118:2:2013:MsgDataTypes"
xmlns:xmlsig="http://www.w3.org/2000/09/xmldsig#"
xmlns:v2gci_b="urn:iso:15118:2:2013:MsgBody"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<v2gci_d:Header><v2gci_h:SessionID>3031323334353637</v2gci_h:SessionID>
</v2gci_d:Header>
<v2gci_d:Body>
<v2gci_b:SessionSetupRes>
<v2gci_b:ResponseCode>OK</v2gci_b:ResponseCode>
<v2gci_b:EVSEID>FRA23E45B78C</v2gci_b:EVSEID>
</v2gci_b:SessionSetupRes>
</v2gci_d:Body>
</v2gci_d:V2G_Message>

encode data is 80 98 02 0C 0C 4C 8C CD 0D 4D 8D D1 E0 00 39 19 49 04 C8 CD 14 D0 D5 08 DC E1 0C 80
but in iso15118 source code the data is receiving in json format.
how I can get data as mentioned in iso15118-2 standard?

Thanks in advance !!

The "unitSymbolType" is optional for the DIN70121 protocol, it is rejected now.

See V2G-DC-297 The PhysicalValueType has 3 attributes: Multiplier, Unit, Value. Here the 'Unit' is optional (in iso spec this is mandatory).
The test now rejects this which is wrong.

See the example log below:
DEBUG 2022-08-04 10:22:40,424 - iso15118.evcc.states.sap_states (142): Chosen protocol: DIN_SPEC_70121
.....
Decoded dict: {'V2G_Message': {'Header': {'SessionID': '4242424242424242'}, 'Body': {'ChargeParameterDiscoveryRes': {'ResponseCode': 'OK', 'EVSEProcessing': 'Finished', 'SAScheduleList': {'SAScheduleTuple': [{'SAScheduleTupleID': 1, 'PMaxSchedule': {'PMaxScheduleID': 1, 'PMaxScheduleEntry': [{'RelativeTimeInterval': {'start': 0, 'duration': 28800}, 'PMax': 32767}]}}]}, 'DC_EVSEChargeParameter': {'DC_EVSEStatus': {'EVSEIsolationStatus': 'Valid', 'EVSEStatusCode': 'EVSE_Ready', 'NotificationMaxDelay': 0, 'EVSENotification': 'None'}, 'EVSEMaximumCurrentLimit': {'Multiplier': 0, 'Value': 180}, 'EVSEMaximumPowerLimit': {'Multiplier': 1, 'Value': 18000}, 'EVSEMaximumVoltageLimit': {'Multiplier': 0, 'Value': 1000}, 'EVSEMinimumCurrentLimit': {'Multiplier': 0, 'Value': 0}, 'EVSEMinimumVoltageLimit': {'Multiplier': 0, 'Value': 200}, 'EVSEPeakCurrentRipple': {'Multiplier': 0, 'Value': 1}}}}}}
INFO 2022-08-04 10:26:13,670 - iso15118.shared.comm_session (371): The data link will Terminate in 2 seconds and the TCP connection will close in 5 seconds.
INFO 2022-08-04 10:26:13,670 - iso15118.shared.comm_session (375): Reason: EXIDecodingError occurred while processing message in state ChargeParameterDiscovery:: Error parsing the decoded EXI into a Pydantic class: 6 validation errors for V2GMessage
Body -> ChargeParameterDiscoveryRes -> DC_EVSEChargeParameter -> EVSEMaximumCurrentLimit -> Unit
field required (type=value_error.missing)
Body -> ChargeParameterDiscoveryRes -> DC_EVSEChargeParameter -> EVSEMaximumPowerLimit -> Unit
field required (type=value_error.missing)
Body -> ChargeParameterDiscoveryRes -> DC_EVSEChargeParameter -> EVSEMaximumVoltageLimit -> Unit
field required (type=value_error.missing)
Body -> ChargeParameterDiscoveryRes -> DC_EVSEChargeParameter -> EVSEMinimumCurrentLimit -> Unit
field required (type=value_error.missing)
Body -> ChargeParameterDiscoveryRes -> DC_EVSEChargeParameter -> EVSEMinimumVoltageLimit -> Unit
field required (type=value_error.missing)
Body -> ChargeParameterDiscoveryRes -> DC_EVSEChargeParameter -> EVSEPeakCurrentRipple -> Unit
field required (type=value_error.missing).

ACEVSEStatus is static in ChargingStatusRes

charging_status_res = ChargingStatusRes(
            response_code=ResponseCode.OK,
            evse_id=await self.comm_session.evse_controller.get_evse_id(
                Protocol.ISO_15118_2
            ),
            sa_schedule_tuple_id=self.comm_session.selected_schedule,
            ac_evse_status=ACEVSEStatus(
                notification_max_delay=0,
                evse_notification=EVSENotification.NONE,
                rcd=False,
            ),
            # TODO Could maybe request an OCPP setting that determines
            #      whether or not a receipt is required and when
            #      (probably only makes sense at the beginning and end of
            #      a charging session). If true, set MeterInfo.
            # meter_info=await self.comm_session.evse_controller.get_meter_info_v2(),
            receipt_required=False,
        )

check_num_e_price_levels - incorrect validation

[iso15118/shared/messages/iso15118_2/datatypes.py]
Validator assumes that NumEPriceLevels is equal to number of SalesTariffEntries which may not always be the case.

As per ISO15118-2:

NumEPriceLevels:
Defines the overall number of distinct price levels used across all provided SalesTariff elements.

EPriceLevel:
Defines the price level of this SalesTariffEntry (referring to NumEPriceLevels). Small values for the EPriceLevel represent a cheaper TariffEntry. Large values for the EPriceLevel represent a more expensive TariffEntry.

SalesTariffEntry:
Encapsulating element describing all relevant details for one time interval of the SalesTariff. The number of SalesTariffEntry elements is
limited by the parameter MaxEntriesSAScheduleTuple (according to [V2G2-261]). The maximum value shall be 1024.

Export of example config for 'not working' sales tariff:
SAScheduleList.txt

Relax verify_certs requirement for root certificate

We may not have the root certificate for a given contract certificate locally. In this case, currently, verification will fail.

This is a common situation in practice, and we can send the contract and sub-CA certificates through to OCPP, where the CSMS can attempt to retrieve the corresponding root certificate. Enable this in the PaymentDetails state.

Most likely, the check for the root certificate path should be capable of returning None, in which case we should not proceed with creating the hash data.

Integration with java, rust or other exi_codecs

As we have an open and not open source solution for the exi codec and since we want to allow the user to decide, as well, to use his/her own exi codec, I propose the following design.

A new file is created containing a stub implementation of the ExiCodec class, let's call it exi_base.py:

from abc import ABCMeta, abstractmethod

class EXIBase(metaclass=ABCMeta):

    @abstractmethod
    def encode(self, message: str, namespace: str):
        pass
    
    @abstractmethod
    def decode(self, stream: bytes, namespace: str):
        pass

A default implementation for the Java EXI codec is provided in exi_java.py:

from iso15118.shared.exi_base import EXIBase

class JavaEXI(EXIBase):

    def __init__(self):
        ....

    def encode(self, message: str, namespace: str):
        ....

    def decode(self, stream: bytes, namespace: str):
        ....

iso15118/secc/init.py is modified to:

import logging
from typing import Optional
from iso15118.shared.logging import _init_logger
from iso15118.shared.exi_base import EXIBase
from iso15118.secc.comm_session_handler import CommunicationSessionHandler
from iso15118.secc.secc_settings import Config

_init_logger()
logger = logging.getLogger(__name__)


class SECCHandler(CommunicationSessionHandler):
    def __init__(self, exi_codec: EXIBase, env_path: Optional[str] = None):
        config = Config()
        config.load_envs(env_path)
        CommunicationSessionHandler.__init__(config, exi_codec)

    async def start(self):
        try:
            await self.start_session_handler()
        except Exception as exc:
            logger.error(f"SECC terminated: {exc}")
            # Re-raise so the process ends with a non-zero exit code and the
            # watchdog can restart the service
            raise

A new file called main.py is created and start_secc is deleted:

import asyncio
import logging
from iso15118.secc import SECCHandler
from iso15118.shared.exi_java import JavaEXI

logger = logging.getLogger(__name__)


async def main():
    """
    Entrypoint function that starts the ISO 15118 code running on
    the SECC (Supply Equipment Communication Controller)
    """
    await SECCHandler(exi_codec=JavaEXI()).start()


def run():
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        logger.debug("SECC program terminated manually")


if __name__ == "__main__":
    run()

With this approach we can do the following in Josev:

  1. Directly import the exi codec class from Rust and pass it to the handler in main.py (https://github.com/SwitchEV/josev/blob/integrate_iso15118_as_module/iso15118_service/iso15118_service/main.py)
import asyncio
import logging
from iso15118.secc import SECCHandler
from exi_codec import EXI

logger = logging.getLogger("iso15118_service")


async def main():
    await SECCHandler(exi_codec=EXI()).start()


def run():
    logger.info("starting...")
    asyncio.run(main())

if __name__ == "__main__":
    run()

Raspberry Pi?

Trying to install this on a Pi4.
Various issues occur, some of which I've gotten past.
First, lots of errors related to openssl. That seems to be fixable by installing libssl-dev
Then we start getting lots of errors around wheels. Oddly, the specific libraries seem to install ok in the base Python environment, but not in the virtual environment that Poetry seems to create.

Note - I've done several installs on "normal" Linux. No problems. WOrks fine. But on a Pi? Am on day 2.5 trying to get it to work.

Any previous experiences??

H

PnC is offered in ISO 15118-20 during a NO_TLS connection

User @GUANMINLIAO reported in here #152 a problem on setting up a -20 session.

EVCC:

EVCC:
(iso15118-py3.10) iso15118@iso15118-LIFEBOOK-SH572:~/ๆกŒ้ข/iso15118-master$ make run-evcc make[1]: ่ฟ›ๅ…ฅ็›ฎๅฝ•โ€œ/home/iso15118/ๆกŒ้ข/iso15118-masterโ€ /home/iso15118/.cache/pypoetry/virtualenvs/iso15118-j4EfOCiL-py3.10/bin/python iso15118/evcc/main.py DEBUG 2022-10-24 16:14:22,782 - asyncio (54): Using selector: EpollSelector INFO 2022-10-24 16:14:24,397 - iso15118.evcc.evcc_settings (93): EVCC settings: INFO 2022-10-24 16:14:24,397 - iso15118.evcc.evcc_settings (95): PKI_PATH : /home/iso15118/ๆกŒ้ข/iso15118-master/iso15118/shared/pki INFO 2022-10-24 16:14:24,397 - iso15118.evcc.evcc_settings (95): MESSAGE_LOG_EXI : False INFO 2022-10-24 16:14:24,397 - iso15118.evcc.evcc_settings (95): V20_SERVICE_CONFIG : /home/iso15118/ๆกŒ้ข/iso15118-master/iso15118/shared/examples/15118_20_evse_service_config.json INFO 2022-10-24 16:14:24,398 - iso15118.evcc.evcc_settings (95): MESSAGE_LOG_JSON : True INFO 2022-10-24 16:14:24,398 - iso15118.evcc.evcc_settings (95): ENABLE_TLS_1_3 : False INFO 2022-10-24 16:14:24,398 - iso15118.evcc.evcc_settings (97): MAX_SUPPORTING_POINTS : 1024 INFO 2022-10-24 16:14:24,399 - iso15118.evcc.evcc_settings (97): NETWORK_INTERFACE : wlp11s0 INFO 2022-10-24 16:14:24,399 - iso15118.evcc.evcc_settings (97): EVCC_ENFORCE_TLS : False INFO 2022-10-24 16:14:24,399 - iso15118.evcc.evcc_settings (97): MAX_CONTRACT_CERTS : 3 INFO 2022-10-24 16:14:24,399 - iso15118.evcc.evcc_settings (97): SDP_RETRY_CYCLES : 1 INFO 2022-10-24 16:14:24,399 - iso15118.evcc.evcc_settings (97): LOG_LEVEL : DEBUG INFO 2022-10-24 16:14:24,399 - iso15118.evcc.evcc_settings (97): EVCC_USE_TLS : False INFO 2022-10-24 16:14:24,401 - iso15118.shared.exi_codec (174): EXI Codec version: 1.55 INFO 2022-10-24 16:14:24,402 - iso15118.evcc (28): Starting 15118 version: 0.12.0 INFO 2022-10-24 16:14:24,402 - iso15118.evcc.comm_session_handler (295): Communication session handler started DEBUG 2022-10-24 16:14:24,402 - iso15118.evcc.comm_session_handler (374): Initiating new SDP cycle, 0 more cycles(s) left INFO 2022-10-24 16:14:24,403 - iso15118.evcc.comm_session_handler (380): Remaining SDP requests: 50 DEBUG 2022-10-24 16:14:24,403 - iso15118.evcc.transport.udp_client (90): UDP client socket ready INFO 2022-10-24 16:14:24,504 - iso15118.evcc.comm_session_handler (317): Sending SDPRequest: [Security: NO_TLS, Protocol: TCP] DEBUG 2022-10-24 16:14:24,504 - iso15118.evcc.transport.udp_client (170): Message sent: [Header = [0x1, 0xfe, 0x9000, 2], Payload = 1000)] INFO 2022-10-24 16:14:24,664 - iso15118.evcc.transport.udp_client (105): Received datagram from UDP server at address ('fe80::c1b5:bb3d:287a:db0f', 15118, 0, 3) INFO 2022-10-24 16:14:24,665 - iso15118.evcc.comm_session_handler (462): SDPResponse received: [ IP address: fe80::c1b5:bb3d:287a:db0f, Port: 60897 , Security: NO_TLS , Transport: TCP ] INFO 2022-10-24 16:14:24,665 - iso15118.evcc.comm_session_handler (398): Starting TCP client, trying to connect to fe80::c1b5:bb3d:287a:db0f at port 60897 ... INFO 2022-10-24 16:14:24,667 - iso15118.evcc.transport.udp_client (105): Received datagram from UDP server at address ('fe80::c1b5:bb3d:287a:db0f', 15118, 0, 3) INFO 2022-10-24 16:14:24,682 - iso15118.evcc.comm_session_handler (405): TCP client connected INFO 2022-10-24 16:14:24,693 - iso15118.shared.comm_session (341): Starting a new communication session INFO 2022-10-24 16:14:24,693 - iso15118.shared.states (137): Entered state SupportedAppProtocol DEBUG 2022-10-24 16:14:24,693 - iso15118.shared.states (141): Waiting for up to 2.0 s INFO 2022-10-24 16:14:24,694 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolReq": {"AppProtocol": [{"ProtocolNamespace": "urn:iso:15118:2:2013:MsgDef", "VersionNumberMajor": 2, "VersionNumberMinor": 0, "SchemaID": 1, "Priority": 1}, {"ProtocolNamespace": "urn:iso:std:iso:15118:-20:AC", "VersionNumberMajor": 1, "VersionNumberMinor": 0, "SchemaID": 2, "Priority": 2}, {"ProtocolNamespace": "urn:din:70121:2012:MsgDef", "VersionNumberMajor": 2, "VersionNumberMinor": 0, "SchemaID": 3, "Priority": 3}]}} INFO 2022-10-24 16:14:24,754 - iso15118.shared.comm_session (415): Sending supportedAppProtocolReq INFO 2022-10-24 16:14:24,960 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolRes":{"ResponseCode":"OK_SuccessfulNegotiation","SchemaID":2}} INFO 2022-10-24 16:14:24,961 - iso15118.shared.comm_session (231): supportedAppProtocolRes received INFO 2022-10-24 16:14:24,961 - iso15118.evcc.states.sap_states (142): Chosen protocol: ISO_15118_20_AC INFO 2022-10-24 16:14:24,962 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"SessionSetupReq": {"Header": {"SessionID": "00", "TimeStamp": 1666599264}, "EVCCID": "WMIV1234567890ABCDEX"}} INFO 2022-10-24 16:14:25,254 - iso15118.shared.comm_session (415): Sending SessionSetupReq INFO 2022-10-24 16:14:25,254 - iso15118.shared.states (137): Entered state SessionSetup DEBUG 2022-10-24 16:14:25,254 - iso15118.shared.states (141): Waiting for up to 20.0 s INFO 2022-10-24 16:14:25,733 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"SessionSetupRes":{"Header":{"SessionID":"3A25C9B9A5FA6D36","TimeStamp":1666599265},"ResponseCode":"OK_NewSessionEstablished","EVSEID":"UK123E1234"}} INFO 2022-10-24 16:14:25,733 - iso15118.shared.comm_session (231): SessionSetupRes received INFO 2022-10-24 16:14:25,734 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"AuthorizationSetupReq": {"Header": {"SessionID": "3A25C9B9A5FA6D36", "TimeStamp": 1666599265}}} INFO 2022-10-24 16:14:25,874 - iso15118.shared.comm_session (415): Sending AuthorizationSetupReq INFO 2022-10-24 16:14:25,874 - iso15118.shared.states (137): Entered state AuthorizationSetup DEBUG 2022-10-24 16:14:25,874 - iso15118.shared.states (141): Waiting for up to 2.0 s INFO 2022-10-24 16:14:26,814 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"AuthorizationSetupRes":{"Header":{"SessionID":"3A25C9B9A5FA6D36","TimeStamp":1666599266},"ResponseCode":"OK","AuthorizationServices":["PnC","EIM"],"CertificateInstallationService":true,"PnC_ASResAuthorizationMode":{"GenChallenge":"xvYFfT3HTlVeXp/Uu+O33A=="}}} INFO 2022-10-24 16:14:26,815 - iso15118.shared.comm_session (231): AuthorizationSetupRes received INFO 2022-10-24 16:14:26,815 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"OEMProvisioningCertificateChain": {"Id": "id1", "Certificate": "MIIB4DCCAYagAwIBAgICMEAwCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNU3ViQ0EyMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMTAxMzA4NTMwMVoXDTI2MTAxMjA4NTMwMVowSTEUMBIGA1UEAwwLT0VNUHJvdkNlcnQxDzANBgNVBAoMBlN3aXRjaDELMAkGA1UEBhMCVUsxEzARBgoJkiaJk/IsZAEZFgNPRU0wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT3olr3o61LlbhF4Wl2r5Z62miu5xaw3xeM4/TM4E4qyPs4QPVOm/htowNQSYFRwWn2nPr4kGo6JSbfsUiGarQeo2AwXjAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIDiDAdBgNVHQ4EFgQU22xt8CJzu3fRRw3NFc+Y0AbuRF4wHwYDVR0jBBgwFoAUCKiN5SlNVdG2nrDtc0gITadmtiAwCgYIKoZIzj0EAwIDSAAwRQIhAJx2iuDNGE++1JaHqLir03sTXzKLRfPwuiiJz1FzBjvAAiB9qNeRPkQyYiWgtBxxTmzpUvsYl+PiFcdlqKhV7sPNZg==", "SubCertificates": {"Certificate": ["MIIB5TCCAYqgAwIBAgICMD8wCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNU3ViQ0ExMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMTAxMzA4NTMwMVoXDTI2MTAxMjA4NTMwMVowRzESMBAGA1UEAwwJT0VNU3ViQ0EyMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+C8ddo1UH82FPI7diX8BySsMU8CJENnCJAMDDPmsWY/Mb8T97AOUdCIohSMkNOVi3+oxqRFlKIUSyb96KEKuZqNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFAiojeUpTVXRtp6w7XNICE2nZrYgMB8GA1UdIwQYMBaAFLSs5N2k5VDWXSab4GJHzGdi8pfBMAoGCCqGSM49BAMCA0kAMEYCIQDJYjp0MOuH2yWuvpig3NrSTefRGS7fIuyA2hps647GbwIhAOWRdpbEltPt2+Y8ArH51k5Ej1+aW74Lus2lmtO50r23", "MIIB5DCCAYqgAwIBAgICMD4wCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNUm9vdENBMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMTAxMzA4NTMwMVoXDTI2MTAxMjA4NTMwMVowRzESMBAGA1UEAwwJT0VNU3ViQ0ExMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5tUxWVfTbIhQqLFqiLjRFsXw06IdKaJywUcW4JJCJ9EXzGOef4vIc0VORg5uEelVrO9KQX0kFMlsHWOdVV8vbKNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFLSs5N2k5VDWXSab4GJHzGdi8pfBMB8GA1UdIwQYMBaAFHhQW7NKojrGsUexuiM95Xa1iLRIMAoGCCqGSM49BAMCA0gAMEUCIH3oRGoXTqdfi4E8dbJiYOmq0UTIJtY0qSWgJAA8IPhXAiEAq9Q2glLK/Qw9DW6WDTociVLX7C9WHBSPf5l1tGl+KNg="]}}} INFO 2022-10-24 16:14:26,923 - iso15118.shared.exi_codec (245): Message to encode (ns=http://www.w3.org/2000/09/xmldsig#): {"SignedInfo": {"CanonicalizationMethod": {"Algorithm": "http://www.w3.org/TR/canonical-exi/"}, "SignatureMethod": {"Algorithm": "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"}, "Reference": [{"Transforms": {"Transform": [{"Algorithm": "http://www.w3.org/TR/canonical-exi/"}]}, "DigestMethod": {"Algorithm": "http://www.w3.org/2001/04/xmlenc#sha256"}, "DigestValue": "S+IM/MK/vfQ9pa5dUApEALMpo8vGpsZdXGrF0w2zMqs=", "URI": "#id1"}]}} INFO 2022-10-24 16:14:27,016 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"CertificateInstallationReq": {"Header": {"SessionID": "3A25C9B9A5FA6D36", "TimeStamp": 1666599267, "Signature": {"SignedInfo": {"CanonicalizationMethod": {"Algorithm": "http://www.w3.org/TR/canonical-exi/"}, "SignatureMethod": {"Algorithm": "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"}, "Reference": [{"Transforms": {"Transform": [{"Algorithm": "http://www.w3.org/TR/canonical-exi/"}]}, "DigestMethod": {"Algorithm": "http://www.w3.org/2001/04/xmlenc#sha256"}, "DigestValue": "S+IM/MK/vfQ9pa5dUApEALMpo8vGpsZdXGrF0w2zMqs=", "URI": "#id1"}]}, "SignatureValue": {"value": "lwcmCrkhmKrenB836rbT4KcTS69wMHf1M3/KH6Ds5bQpSq8EEB9igbTBnGonWsZ66Gl5Fh5lxCpr0IR2m8feiw=="}}}, "OEMProvisioningCertificateChain": {"Id": "id1", "Certificate": "MIIB4DCCAYagAwIBAgICMEAwCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNU3ViQ0EyMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMTAxMzA4NTMwMVoXDTI2MTAxMjA4NTMwMVowSTEUMBIGA1UEAwwLT0VNUHJvdkNlcnQxDzANBgNVBAoMBlN3aXRjaDELMAkGA1UEBhMCVUsxEzARBgoJkiaJk/IsZAEZFgNPRU0wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT3olr3o61LlbhF4Wl2r5Z62miu5xaw3xeM4/TM4E4qyPs4QPVOm/htowNQSYFRwWn2nPr4kGo6JSbfsUiGarQeo2AwXjAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIDiDAdBgNVHQ4EFgQU22xt8CJzu3fRRw3NFc+Y0AbuRF4wHwYDVR0jBBgwFoAUCKiN5SlNVdG2nrDtc0gITadmtiAwCgYIKoZIzj0EAwIDSAAwRQIhAJx2iuDNGE++1JaHqLir03sTXzKLRfPwuiiJz1FzBjvAAiB9qNeRPkQyYiWgtBxxTmzpUvsYl+PiFcdlqKhV7sPNZg==", "SubCertificates": {"Certificate": ["MIIB5TCCAYqgAwIBAgICMD8wCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNU3ViQ0ExMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMTAxMzA4NTMwMVoXDTI2MTAxMjA4NTMwMVowRzESMBAGA1UEAwwJT0VNU3ViQ0EyMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+C8ddo1UH82FPI7diX8BySsMU8CJENnCJAMDDPmsWY/Mb8T97AOUdCIohSMkNOVi3+oxqRFlKIUSyb96KEKuZqNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFAiojeUpTVXRtp6w7XNICE2nZrYgMB8GA1UdIwQYMBaAFLSs5N2k5VDWXSab4GJHzGdi8pfBMAoGCCqGSM49BAMCA0kAMEYCIQDJYjp0MOuH2yWuvpig3NrSTefRGS7fIuyA2hps647GbwIhAOWRdpbEltPt2+Y8ArH51k5Ej1+aW74Lus2lmtO50r23", "MIIB5DCCAYqgAwIBAgICMD4wCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNUm9vdENBMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMTAxMzA4NTMwMVoXDTI2MTAxMjA4NTMwMVowRzESMBAGA1UEAwwJT0VNU3ViQ0ExMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5tUxWVfTbIhQqLFqiLjRFsXw06IdKaJywUcW4JJCJ9EXzGOef4vIc0VORg5uEelVrO9KQX0kFMlsHWOdVV8vbKNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFLSs5N2k5VDWXSab4GJHzGdi8pfBMB8GA1UdIwQYMBaAFHhQW7NKojrGsUexuiM95Xa1iLRIMAoGCCqGSM49BAMCA0gAMEUCIH3oRGoXTqdfi4E8dbJiYOmq0UTIJtY0qSWgJAA8IPhXAiEAq9Q2glLK/Qw9DW6WDTociVLX7C9WHBSPf5l1tGl+KNg="]}}, "ListOfRootCertificateIDs": {"RootCertificateID": [{"X509IssuerName": "<Name(CN=V2GRootCA,O=Switch,C=UK,DC=V2G)>", "X509SerialNumber": 12345}]}, "MaximumContractCertificateChains": 3}} INFO 2022-10-24 16:14:27,110 - iso15118.shared.comm_session (415): Sending CertificateInstallationReq INFO 2022-10-24 16:14:27,110 - iso15118.shared.states (137): Entered state CertificateInstallation DEBUG 2022-10-24 16:14:27,110 - iso15118.shared.states (141): Waiting for up to 5.0 s INFO 2022-10-24 16:14:32,114 - iso15118.shared.comm_session (387): The data link will Terminate in 2 seconds and the TCP connection will close in 5 seconds. INFO 2022-10-24 16:14:32,114 - iso15118.shared.comm_session (391): Reason: TimeoutError occurred. Waited for 5.0 s after sending last message: [Header = [0x1, 0xfe, 0x8001, 1810], Payload = 801c041d12e4dcd2fd369b0e392d99a060a25687474703a2f2f7777772e77332e6f72672f54522f63616e6f6e6963616c2d6578692f435687474703a2f2f7777772e77332e6f72672f323030312f30342f786d6c647369672d6d6f72652365636473612d736861323536440c46d2c86204ad0e8e8e0745e5eeeeeee5cee665cdee4ce5ea8a45ec6c2dcdedcd2c6c2d85acaf0d25e90a5a1d1d1c0e8bcbddddddcb9dcccb9bdc99cbcc8c0c0c4bcc0d0bde1b5b195b98c8dcda184c8d4d90812f8833f30afef7d0f696b97540291002cca68f2f1a9b197571ab174c36cccaac4a04b8393055c90cc556f4e0f9bf55b69f05389a5d7b8183bfa99bfe50fd07672da14a55782080fb140da60ce3513ad633d7434bc8b0f32e21535e8423b4de3ef45a00ad2c8627201984100f0184100c350018100810101182018050304154324671e8201811823988918080301aa82018604a7a2a6a9bab121a099188798068301aa8205060329bbb4ba31b4188598048301aa820309812aa598899808830504c91344c9f91632008c8b01a7a2a6980f0b86991918981899981c1a999818ad0b86991b18981899181c1a999818ad1824988a18090301aa82018605a7a2a6a83937bb21b2b93a188798068301aa8205060329bbb4ba31b4188598048301aa820309812aa598899808830504c91344c9f91632008c8b01a7a2a6982c98098303954324671e81008304154324671e81808381a100027bd12d7bd1d6a5cadc22f0b4bb57cb3d6d3457738b586f8bc671fa66702715647d9c207aa74dfc36d181a824c0a8e0b4fb4e7d7c48351d12936fd8a443355a0f51b0182f18060301aa8e898080ff8201180018070301aa8e878080ff8202018101c4180e8301aa8e87020b020a6db636f81139ddbbe8a386e68ae7cc680377222f180f8301aa8e91820c180b400a045446f294a6aae8db4f5876b9a40426d3b35b1018050304154324671e82018101a40018228110804e3b4570668c27df6a4b43d45c55e9bd89af9945a2f9f85d1444e7a8b9831de001103ed46bc89f22193112d05a0e38a73674a97d8c4bf1f10ae3b2d4542af761e6b303a40cc2080794c208062a800c0804080808c0fcc0281820aa192338f4100c08c11cc448c040180d54100c30253d15354dd5890d04c4c43cc034180d54102830194ddda5d18da0c42cc024180d5410184c09552cc44cc044182826489a264fc8b1900464580d3d1534c0785c34c8c8c4c0c4ccc0e0d4ccc0c5685c34c8d8c4c0c4c8c0e0d4ccc0c568c11cc448c040180d54100c30253d15354dd5890d04c8c43cc034180d54102830194ddda5d18da0c42cc024180d5410184c09552cc44cc044182826489a264fc8b1900464580d3d1534c164c04c181caa192338f408041820aa192338f40c041c0d080013e0bc75da35507f3614f23b7625fc0724ac314f0224436708900c0c33e6b1663f31bf13f7b00e51d088a2148c90d3958b7fa8c6a44594a2144b26fde8a10ab99a8d98c190c048180d54744c0407fc1020c0180407fc080400c038180d54743c0407fc10100c080418c074180d5474381058105022a23794a5355746da7ac3b5cd2021369d9ad880c07c180d54748c1060c05a0052d2b3937693954359749a6f81891f319d8bca5f04c0281820aa192338f4100c080d2400c1180884032588e9d0c3ae1f6c96bafa6283736b49379f4464bb7c8bb2036869b3ae3b19bc0884039645da5b125b4fb76f98f00ac7e75939123d7e696ef82eeb36966b4ee74af6dc3a00cc2080790c208062a800c0804080808c0f8c0281820aa192338f4100c08c11cc448c040180d54100c30253d153549bdbdd10d04c43cc034180d54102830194ddda5d18da0c42cc024180d5410184c09552cc44cc044182826489a264fc8b1900464580d3d1534c0785c34c8c8c4c0c4ccc0e0d4ccc0c5685c34c8d8c4c0c4c8c0e0d4ccc0c568c11cc448c040180d54100c30253d15354dd5890d04c4c43cc034180d54102830194ddda5d18da0c42cc024180d5410184c09552cc44cc044182826489a264fc8b1900464580d3d1534c164c04c181caa192338f408041820aa192338f40c041c0d0800139b54c5655f4db22142a2c5aa22e3445b17c34e8874a689cb051c5b8249089f445f318e79fe2f21cd15391839b847a556b3bd2905f4905325b0758e75557cbdb28d98c190c048180d54744c0407fc1020c0180407fc080404c038180d54743c0407fc10100c080418c074180d54743810581052d2b3937693954359749a6f81891f319d8bca5f04c07c180d54748c1060c05a0051e1416ecd2a88eb1ac51ec6e88cf795dad622d120c0281820aa192338f4100c080d2000c1140881f7a111a85d3a9d7e2e04f1d6c98983a6ab4513209b58d2a496809000f083e15c088402af50da094b2bf430f435ba5834e872254b5fb0bd5870523dfe65d6d1a5f8a36080acf13985b594a10d38f558c91d49bdbdd10d04b13cf54ddda5d18da0b10cf5552cb1110cf558c91ca4f82e58040320)] INFO 2022-10-24 16:14:34,117 - iso15118.shared.comm_session (396): Terminated the data link INFO 2022-10-24 16:14:37,121 - iso15118.shared.comm_session (403): TCP connection closed to peer with address ('fe80::c1b5:bb3d:287a:db0f', 60897, 0, 3) ERROR 2022-10-24 16:14:37,122 - iso15118.evcc.comm_session_handler (544): EVCC tried to initiate a V2GCommunicationSession, but maximum number of SDP retry cycles (1) is now reached. Shutting down high-level communication. Unplug and plug in the cable again if you want to start anew. Traceback (most recent call last): File "/home/iso15118/ๆกŒ้ข/iso15118-master/iso15118/evcc/comm_session_handler.py", line 542, in get_from_rcv_queue await self.restart_sdp(True) File "/home/iso15118/ๆกŒ้ข/iso15118-master/iso15118/evcc/comm_session_handler.py", line 366, in restart_sdp raise SDPFailedError( iso15118.shared.exceptions.SDPFailedError: EVCC tried to initiate a V2GCommunicationSession, but maximum number of SDP retry cycles (1) is now reached. Shutting down high-level communication. Unplug and plug in the cable again if you want to start anew. ^CDEBUG 2022-10-24 16:19:39,708 - __main__ (25): EVCC program terminated manually

SECC:

(iso15118-py3.10) liao@liao-NUC9i9QNX:~/ๆกŒ้ข/iso15118-master$ make run-secc make[1]: ้€ฒๅ…ฅ็›ฎ้Œ„ใ€Œ/home/liao/ๆกŒ้ข/iso15118-masterใ€ /home/liao/.cache/pypoetry/virtualenvs/iso15118-WE_w2UWJ-py3.10/bin/python iso15118/secc/main.py DEBUG 2022-10-24 16:14:15,285 - asyncio (54): Using selector: EpollSelector INFO 2022-10-24 16:14:15,863 - iso15118.secc.secc_settings (117): SECC settings: INFO 2022-10-24 16:14:15,863 - iso15118.secc.secc_settings (119): ENABLE_TLS_1_3 : False INFO 2022-10-24 16:14:15,863 - iso15118.secc.secc_settings (119): MESSAGE_LOG_JSON : True INFO 2022-10-24 16:14:15,863 - iso15118.secc.secc_settings (119): PKI_PATH : /home/liao/ๆกŒ้ข/iso15118-master/iso15118/shared/pki INFO 2022-10-24 16:14:15,863 - iso15118.secc.secc_settings (119): MESSAGE_LOG_EXI : False INFO 2022-10-24 16:14:15,863 - iso15118.secc.secc_settings (119): V20_SERVICE_CONFIG : /home/liao/ๆกŒ้ข/iso15118-master/iso15118/shared/examples/15118_20_evse_service_config.json INFO 2022-10-24 16:14:15,863 - iso15118.secc.secc_settings (121): SECC_ENFORCE_TLS : False INFO 2022-10-24 16:14:15,863 - iso15118.secc.secc_settings (121): FREE_CERT_INSTALL_SERVICE : True INFO 2022-10-24 16:14:15,864 - iso15118.secc.secc_settings (121): ALLOW_CERT_INSTALL_SERVICE : True INFO 2022-10-24 16:14:15,864 - iso15118.secc.secc_settings (121): NETWORK_INTERFACE : wlp3s0 INFO 2022-10-24 16:14:15,864 - iso15118.secc.secc_settings (121): FREE_CHARGING_SERVICE : False INFO 2022-10-24 16:14:15,864 - iso15118.secc.secc_settings (121): STANDBY_ALLOWED : False INFO 2022-10-24 16:14:15,864 - iso15118.secc.secc_settings (121): LOG_LEVEL : DEBUG INFO 2022-10-24 16:14:15,864 - iso15118.secc.secc_settings (121): PROTOCOLS : ['ISO_15118_20_AC'] INFO 2022-10-24 16:14:15,864 - iso15118.secc.secc_settings (121): AUTH_MODES : ['EIM', 'PNC'] INFO 2022-10-24 16:14:15,864 - iso15118.secc.secc_settings (121): USE_CPO_BACKEND : False INFO 2022-10-24 16:14:15,864 - iso15118.shared.exi_codec (174): EXI Codec version: 1.55 INFO 2022-10-24 16:14:15,864 - iso15118.secc (33): Starting 15118 version: 0.12.0 INFO 2022-10-24 16:14:15,864 - iso15118.secc.comm_session_handler (203): Communication session handler started INFO 2022-10-24 16:14:15,868 - iso15118.secc.transport.udp_server (110): UDP server socket ready INFO 2022-10-24 16:14:15,868 - iso15118.secc.transport.udp_server (97): UDP server started at address FF02::1%wlp3s0 and port 15118 INFO 2022-10-24 16:14:15,868 - iso15118.secc.transport.tcp_server (109): TLS server started at address fe80::c1b5:bb3d:287a:db0f%wlp3s0 and port 49874 INFO 2022-10-24 16:14:15,868 - iso15118.secc.transport.tcp_server (109): TCP server started at address fe80::c1b5:bb3d:287a:db0f%wlp3s0 and port 60897 DEBUG 2022-10-24 16:14:24,714 - iso15118.secc.transport.udp_server (125): Message received from ('fe80::b23c:8db8:1c61:f44b', 50762, 0, 4): 01fe9000000000021000 INFO 2022-10-24 16:14:24,714 - iso15118.secc.comm_session_handler (292): SDPRequest received: [Security: NO_TLS, Protocol: TCP] INFO 2022-10-24 16:14:24,714 - iso15118.secc.comm_session_handler (332): Sending SDPResponse: [ IP address: fe80::c1b5:bb3d:287a:db0f, Port: 60897 , Security: NO_TLS , Transport: TCP ] DEBUG 2022-10-24 16:14:24,715 - iso15118.secc.transport.udp_server (125): Message received from ('fe80::b23c:8db8:1c61:f44b', 50762, 0, 4): 01fe9000000000021000 INFO 2022-10-24 16:14:24,715 - iso15118.secc.comm_session_handler (292): SDPRequest received: [Security: NO_TLS, Protocol: TCP] INFO 2022-10-24 16:14:24,715 - iso15118.secc.comm_session_handler (332): Sending SDPResponse: [ IP address: fe80::c1b5:bb3d:287a:db0f, Port: 60897 , Security: NO_TLS , Transport: TCP ] INFO 2022-10-24 16:14:24,762 - iso15118.secc.comm_session_handler (228): TCP client connected, client address is ('fe80::b23c:8db8:1c61:f44b', 60184, 0, 4). INFO 2022-10-24 16:14:24,764 - iso15118.shared.comm_session (341): Starting a new communication session INFO 2022-10-24 16:14:24,764 - iso15118.shared.states (137): Entered state SupportedAppProtocol DEBUG 2022-10-24 16:14:24,764 - iso15118.shared.states (141): Waiting for up to 20.0 s INFO 2022-10-24 16:14:24,891 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolReq":{"AppProtocol":[{"ProtocolNamespace":"urn:iso:15118:2:2013:MsgDef","VersionNumberMajor":2,"VersionNumberMinor":0,"SchemaID":1,"Priority":1},{"ProtocolNamespace":"urn:iso:std:iso:15118:-20:AC","VersionNumberMajor":1,"VersionNumberMinor":0,"SchemaID":2,"Priority":2},{"ProtocolNamespace":"urn:din:70121:2012:MsgDef","VersionNumberMajor":2,"VersionNumberMinor":0,"SchemaID":3,"Priority":3}]}} INFO 2022-10-24 16:14:24,891 - iso15118.shared.comm_session (231): supportedAppProtocolReq received INFO 2022-10-24 16:14:24,891 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolRes": {"ResponseCode": "OK_SuccessfulNegotiation", "SchemaID": 2}} INFO 2022-10-24 16:14:24,910 - iso15118.secc.states.sap_states (146): Chosen protocol: ISO_15118_20_AC INFO 2022-10-24 16:14:24,910 - iso15118.shared.comm_session (415): Sending supportedAppProtocolRes INFO 2022-10-24 16:14:24,910 - iso15118.shared.states (137): Entered state SessionSetup DEBUG 2022-10-24 16:14:24,910 - iso15118.shared.states (141): Waiting for up to 20.0 s INFO 2022-10-24 16:14:25,620 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"SessionSetupReq":{"Header":{"SessionID":"00","TimeStamp":1666599264},"EVCCID":"WMIV1234567890ABCDEX"}} INFO 2022-10-24 16:14:25,621 - iso15118.shared.comm_session (231): SessionSetupReq received INFO 2022-10-24 16:14:25,621 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"SessionSetupRes": {"Header": {"SessionID": "3A25C9B9A5FA6D36", "TimeStamp": 1666599265}, "ResponseCode": "OK_NewSessionEstablished", "EVSEID": "UK123E1234"}} INFO 2022-10-24 16:14:25,663 - iso15118.shared.comm_session (415): Sending SessionSetupRes INFO 2022-10-24 16:14:25,663 - iso15118.shared.states (137): Entered state AuthorizationSetup DEBUG 2022-10-24 16:14:25,663 - iso15118.shared.states (141): Waiting for up to 20.0 s INFO 2022-10-24 16:14:26,717 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"AuthorizationSetupReq":{"Header":{"SessionID":"3A25C9B9A5FA6D36","TimeStamp":1666599265}}} INFO 2022-10-24 16:14:26,717 - iso15118.shared.comm_session (231): AuthorizationSetupReq received INFO 2022-10-24 16:14:26,717 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"AuthorizationSetupRes": {"Header": {"SessionID": "3A25C9B9A5FA6D36", "TimeStamp": 1666599266}, "ResponseCode": "OK", "AuthorizationServices": ["PnC", "EIM"], "CertificateInstallationService": true, "PnC_ASResAuthorizationMode": {"GenChallenge": "xvYFfT3HTlVeXp/Uu+O33A=="}}} INFO 2022-10-24 16:14:26,744 - iso15118.shared.comm_session (415): Sending AuthorizationSetupRes INFO 2022-10-24 16:14:27,291 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:std:iso:15118:-20:CommonMessages): {"CertificateInstallationReq":{"Header":{"SessionID":"3A25C9B9A5FA6D36","TimeStamp":1666599267,"Signature":{"SignedInfo":{"CanonicalizationMethod":{"Algorithm":"http://www.w3.org/TR/canonical-exi/"},"SignatureMethod":{"Algorithm":"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"},"Reference":[{"URI":"#id1","Transforms":{"Transform":[{"Algorithm":"http://www.w3.org/TR/canonical-exi/"}]},"DigestMethod":{"Algorithm":"http://www.w3.org/2001/04/xmlenc#sha256"},"DigestValue":"S+IM/MK/vfQ9pa5dUApEALMpo8vGpsZdXGrF0w2zMqs="}]},"SignatureValue":{"value":"lwcmCrkhmKrenB836rbT4KcTS69wMHf1M3/KH6Ds5bQpSq8EEB9igbTBnGonWsZ66Gl5Fh5lxCpr0IR2m8feiw=="}}},"OEMProvisioningCertificateChain":{"Id":"id1","Certificate":"MIIB4DCCAYagAwIBAgICMEAwCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNU3ViQ0EyMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMTAxMzA4NTMwMVoXDTI2MTAxMjA4NTMwMVowSTEUMBIGA1UEAwwLT0VNUHJvdkNlcnQxDzANBgNVBAoMBlN3aXRjaDELMAkGA1UEBhMCVUsxEzARBgoJkiaJk/IsZAEZFgNPRU0wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT3olr3o61LlbhF4Wl2r5Z62miu5xaw3xeM4/TM4E4qyPs4QPVOm/htowNQSYFRwWn2nPr4kGo6JSbfsUiGarQeo2AwXjAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIDiDAdBgNVHQ4EFgQU22xt8CJzu3fRRw3NFc+Y0AbuRF4wHwYDVR0jBBgwFoAUCKiN5SlNVdG2nrDtc0gITadmtiAwCgYIKoZIzj0EAwIDSAAwRQIhAJx2iuDNGE++1JaHqLir03sTXzKLRfPwuiiJz1FzBjvAAiB9qNeRPkQyYiWgtBxxTmzpUvsYl+PiFcdlqKhV7sPNZg==","SubCertificates":{"Certificate":["MIIB5TCCAYqgAwIBAgICMD8wCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNU3ViQ0ExMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMTAxMzA4NTMwMVoXDTI2MTAxMjA4NTMwMVowRzESMBAGA1UEAwwJT0VNU3ViQ0EyMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+C8ddo1UH82FPI7diX8BySsMU8CJENnCJAMDDPmsWY/Mb8T97AOUdCIohSMkNOVi3+oxqRFlKIUSyb96KEKuZqNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFAiojeUpTVXRtp6w7XNICE2nZrYgMB8GA1UdIwQYMBaAFLSs5N2k5VDWXSab4GJHzGdi8pfBMAoGCCqGSM49BAMCA0kAMEYCIQDJYjp0MOuH2yWuvpig3NrSTefRGS7fIuyA2hps647GbwIhAOWRdpbEltPt2+Y8ArH51k5Ej1+aW74Lus2lmtO50r23","MIIB5DCCAYqgAwIBAgICMD4wCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNUm9vdENBMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMTAxMzA4NTMwMVoXDTI2MTAxMjA4NTMwMVowRzESMBAGA1UEAwwJT0VNU3ViQ0ExMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5tUxWVfTbIhQqLFqiLjRFsXw06IdKaJywUcW4JJCJ9EXzGOef4vIc0VORg5uEelVrO9KQX0kFMlsHWOdVV8vbKNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFLSs5N2k5VDWXSab4GJHzGdi8pfBMB8GA1UdIwQYMBaAFHhQW7NKojrGsUexuiM95Xa1iLRIMAoGCCqGSM49BAMCA0gAMEUCIH3oRGoXTqdfi4E8dbJiYOmq0UTIJtY0qSWgJAA8IPhXAiEAq9Q2glLK/Qw9DW6WDTociVLX7C9WHBSPf5l1tGl+KNg="]}},"ListOfRootCertificateIDs":{"RootCertificateID":[{"X509IssuerName":"<Name(CN=V2GRootCA,O=Switch,C=UK,DC=V2G)>","X509SerialNumber":12345}]},"MaximumContractCertificateChains":3}} INFO 2022-10-24 16:14:27,293 - iso15118.shared.comm_session (231): CertificateInstallationReq received INFO 2022-10-24 16:14:27,294 - iso15118.shared.states (137): Entered state CertificateInstallation DEBUG 2022-10-24 16:14:27,294 - iso15118.shared.states (141): Waiting for up to 20.0 s ERROR 2022-10-24 16:14:27,294 - iso15118.shared.utils (51): CertificateInstallation not yet implemented Traceback (most recent call last): File "/home/liao/ๆกŒ้ข/iso15118-master/iso15118/shared/utils.py", line 49, in wait_for_tasks task.result() File "/home/liao/ๆกŒ้ข/iso15118-master/iso15118/shared/comm_session.py", line 480, in rcv_loop await self.process_message(message) File "/home/liao/ๆกŒ้ข/iso15118-master/iso15118/shared/comm_session.py", line 232, in process_message await self.current_state.process_message(decoded_message, v2gtp_msg.payload) File "/home/liao/ๆกŒ้ข/iso15118-master/iso15118/secc/states/iso15118_20_states.py", line 216, in process_message await CertificateInstallation(self.comm_session).process_message( File "/home/liao/ๆกŒ้ข/iso15118-master/iso15118/secc/states/iso15118_20_states.py", line 296, in process_message raise NotImplementedError("CertificateInstallation not yet implemented") NotImplementedError: CertificateInstallation not yet implemented ^CWARNING 2022-10-24 16:15:10,514 - iso15118.secc.transport.tcp_server (122): Closing TCP server WARNING 2022-10-24 16:15:10,514 - iso15118.secc.transport.tcp_server (122): Closing TCP server DEBUG 2022-10-24 16:15:10,515 - __main__ (26): SECC program terminated manually

After inspecting the trench of logs provided, I concluded that we are offering that after a NO_TLS communication has been established, PnC as an option in the AuthorizationSetupResponse message: {"AuthorizationSetupRes": {"Header": {"SessionID": "3A25C9B9A5FA6D36", "TimeStamp": 1666599266}, "ResponseCode": "OK", "AuthorizationServices": ["PnC", "EIM"],...

This is incorrect and we shall treat it as a bug

SECC requiring the contract leaf key

Why does the SECC require the contract leaf private key? Is this how it supposed to work? As far as I understand, the contract leaf key is a private property of the EVCC, and the SECC shouldn't have it.

Screenshot from 2022-08-30 12-34-24

SECC Simulator: ModuleNotFoundError: No module named 'aiofile'

First of all, thank you for the iso15118 implementation!

I am trying to run the docker environment on a Ubuntu system. However there seems to be an issue with one of the python packages needed by the SECC simulator, namely "aiofile":
secc_1 | Traceback (most recent call last):
secc_1 | File "/venv/bin/iso15118", line 5, in
secc_1 | from iso15118.secc.main import run
secc_1 | File "/venv/lib/python3.10/site-packages/iso15118/secc/main.py", line 5, in
secc_1 | from iso15118.secc.controller.simulator import SimEVSEController
secc_1 | File "/venv/lib/python3.10/site-packages/iso15118/secc/controller/simulator.py", line 12, in
secc_1 | from aiofile import async_open
secc_1 | ModuleNotFoundError: No module named 'aiofile'

I checked the poetry file etc. and the aiofile packages seems to be in there. But it seems that it is not being installed, although another package e.g. "alabaster" is included:
โ€ข Installing attrs (21.4.0)
โ€ข Installing markupsafe (2.1.1)
โ€ข Installing iniconfig (1.1.1)
โ€ข Updating packaging (20.9 -> 21.3)
โ€ข Installing pluggy (1.0.0)
โ€ข Installing py (1.11.0)
โ€ข Installing pytz (2022.1)
โ€ข Installing alabaster (0.7.12)
โ€ข Installing babel (2.10.1)
โ€ข Installing click (8.1.3)
โ€ข Installing coverage (6.3.3)
โ€ข Installing docutils (0.17.1)
โ€ข Installing imagesize (1.3.0)
โ€ข Installing jinja2 (3.1.2)
โ€ข Installing marshmallow (3.15.0)
โ€ข Installing mccabe (0.6.1)
โ€ข Installing pathspec (0.9.0)
โ€ข Installing pycodestyle (2.8.0)
โ€ข Installing pyflakes (2.4.0)
โ€ข Installing pygments (2.12.0)
โ€ข Installing pytest (7.1.2)
โ€ข Installing python-dateutil (2.8.2)
โ€ข Installing python-dotenv (0.20.0)
โ€ข Installing snowballstemmer (2.2.0)
โ€ข Installing sphinxcontrib-applehelp (1.0.2)
โ€ข Installing sphinxcontrib-devhelp (1.0.2)
โ€ข Installing sphinxcontrib-htmlhelp (2.0.0)
โ€ข Installing sphinxcontrib-jsmath (1.0.1)
โ€ข Installing sphinxcontrib-qthelp (1.0.3)
โ€ข Installing sphinxcontrib-serializinghtml (1.1.5)
โ€ข Installing asynctest (0.13.0)
โ€ข Installing black (22.3.0)
โ€ข Updating cryptography (37.0.2 -> 3.4.6)
โ€ข Installing environs (9.5.0)
โ€ข Installing flake8 (4.0.1)
โ€ข Installing freezegun (1.2.1)
โ€ข Installing isort (5.10.1)
โ€ข Installing psutil (5.9.0)
โ€ข Installing py4j (0.10.9.5)
โ€ข Installing pydantic (1.9.1)
โ€ข Installing pytest-asyncio (0.18.3)
โ€ข Installing pytest-cov (3.0.0)
โ€ข Installing sphinx (4.5.0)

Do you have any idea what is going wrong? Thanks in advance

Validation of the Schedule created in ChargeParameterDiscoveryRes

According to requirements:
[V2G2-303] - The sum of the individual time intervals described in the PMaxSchedule (refer to 8.5.2.14) and SalesTariff (see 8.5.2.16) provided in the ChargeParameterDiscoveryRes message shall match the period of time indicated by the EVCC in the message element DepartureTime of the ChargeParameterDiscoveryReq message.

[V2G2-304] - If the EVCC did not provide a DepartureTime Target Setting (refer to subclause 8.4.3.8.2 and 8.5.3.2) in the ChargeParameterDiscoveryReq message, the sum of the individual time intervals described in the PMaxSchedule and SalesTariff provided in the ChargeParameterDiscoveryRes message, shall be greater or equal to 24 hours.

We could validate the schedule returned by get_sa_schedule_list and validate it according with the above requirements.

Slow EXI conversion during CurrentDemandResponse in DIN

According to DIN specification Table 75 CurrentDemandRes should take 25ms. Looking on the log on the EVSE side (DC charging) it looks like it takes ~250ms to respond to CurrentDemandRequest in DIN-based data exchange. i.e.:

DEBUG 2022-11-06 00:56:20,985 - iso15118.shared.exi_codec (282): EXI-encoded message (ns=urn:din:70121:2012:MsgDef): 809a0219ba2bf5b89f4c5ad0d1401200881e0192d8080323e8109463c2019004464b602000
DEBUG 2022-11-06 00:56:21,161 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"66E8AFD6E27D316B"},"Body":{"CurrentDemandReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":72},"EVTargetCurrent":{"Multiplier":-1,"Value":15},"EVMaximumVoltageLimit":{"Multiplier":0,"Value":310},"EVMaximumCurrentLimit":{"Multiplier":0,"Value":125},"EVMaximumPowerLimit":{"Multiplier":1,"Value":3875},"ChargingComplete":false,"RemainingTimeToFullSoC":{"Multiplier":0,"Value":1},"EVTargetVoltage":{"Multiplier":0,"Value":310}}}}}
INFO 2022-11-06 00:56:21,162 - iso15118.shared.comm_session (231): CurrentDemandReq received
INFO 2022-11-06 00:56:21,163 - root (782): Send Charging Command
DEBUG 2022-11-06 00:56:21,167 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "66E8AFD6E27D316B"}, "Body": {"CurrentDemandRes": {"ResponseCode": "OK", "DC_EVSEStatus": {"NotificationMaxDelay": 0, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEPresentVoltage": {"Value": 2857, "Multiplier": -1, "Unit": "V"}, "EVSEPresentCurrent": {"Value": 34, "Multiplier": -1, "Unit": "A"}, "EVSECurrentLimitAchieved": false, "EVSEVoltageLimitAchieved": false, "EVSEPowerLimitAchieved": false}}}}
DEBUG 2022-11-06 00:56:21,403 - iso15118.shared.exi_codec (256): EXI-encoded message: 809a0219ba2bf5b89f4c5ad0e00040800001028548b01018110000c0
INFO 2022-11-06 00:56:21,404 - iso15118.shared.comm_session (415): Sending CurrentDemandRes
DEBUG 2022-11-06 00:56:21,552 - iso15118.shared.exi_codec (282): EXI-encoded message (ns=urn:din:70121:2012:MsgDef): 809a0219ba2bf5b89f4c5ad0d1401200881e0192d8080323e8109463c2019004464b602000

DEBUG 2022-11-06 00:56:21,736 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"66E8AFD6E27D316B"},"Body":{"CurrentDemandReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":72},"EVTargetCurrent":{"Multiplier":-1,"Value":15},"EVMaximumVoltageLimit":{"Multiplier":0,"Value":310},"EVMaximumCurrentLimit":{"Multiplier":0,"Value":125},"EVMaximumPowerLimit":{"Multiplier":1,"Value":3875},"ChargingComplete":false,"RemainingTimeToFullSoC":{"Multiplier":0,"Value":1},"EVTargetVoltage":{"Multiplier":0,"Value":310}}}}}
INFO 2022-11-06 00:56:21,738 - iso15118.shared.comm_session (231): CurrentDemandReq received

Unfortunately, after 5 seconds from the first CurrentDemandReq / Res, the car reports "ReadyToChargeState": false, which causes the charging to stop, even though the charging parameters are met by the power unit during these 5 seconds.
Could the duration of the response be the reason why the EV disconnects?
Is 250ms conversion time okay? It was tested on RPi CM4, clean debian, no additional programs running in the background.

Weird and bad practice of passing a reference of the parent class to a child

The iso15118 code in the comm_session_handler.py for both evcc and secc, passes a reference self of the child class to the parent V2GCommunicationSession

class SECCCommunicationSession(V2GCommunicationSession, EXI):
    """
    The communication session object for the SECC, which holds session-specific
    variables and also implements a pausing mechanism.
    """

    def __init__(
        self,
        transport: Tuple[StreamReader, StreamWriter],
        session_handler_queue: asyncio.Queue,
        config: Config,
        evse_controller: EVSEControllerInterface,
        iexi_codec: IEXICodec,
    ):
        # Need to import here to avoid a circular import error
        # pylint: disable=import-outside-toplevel
        from iso15118.secc.states.sap_states import SupportedAppProtocol

        EXI.__init__(self, iexi_codec)
        V2GCommunicationSession.__init__(
            self, transport, SupportedAppProtocol, session_handler_queue, self
        )

        self.config = config
        # The EVSE controller that implements the interface EVSEControllerInterface
        self.evse_controller = evse_controller
        # The authorization option(s) offered with ServiceDiscoveryRes in
        # ISO 15118-2 and with AuthorizationSetupRes in ISO 15118-20
        self.offered_auth_options: Optional[List[AuthEnum]] = []
        # The value-added services offered with ServiceDiscoveryRes
        self.offered_services: List[ServiceDetails] = []
        # The authorization option (called PaymentOption in ISO 15118-2) the
        # EVCC selected with the PaymentServiceSelectionReq
        self.selected_auth_option: Optional[AuthEnum] = None
        # In ISO 15118-2, the EVCCID is the MAC address, given as bytes.
        # In ISO 15118-20, the EVCCID is like a VIN number, given as str.
        self.evcc_id: Union[bytes, str, None] = None
        # The list of offered charging schedules, sent to the EVCC via the
        # ChargeParameterDiscoveryRes message
        self.offered_schedules: List[SAScheduleTupleEntry] = []
        # Whether or not the SECC received a PowerDeliveryReq with
        # ChargeProgress set to 'Start'
        self.charge_progress_started: bool = False
        # The contract certificate and sub-CA certificate(s) the EVCC sent
        # with the PaymentDetailsReq. Need to store in the session to verify
        # the AuthorizationReq's signature
        # TODO Add support for ISO 15118-20 CertificateChain
        self.contract_cert_chain: Optional[CertificateChainV2] = None
        # Initialise the failed possible responses per request message for a
        # faster lookup later when needed
        self.failed_responses_isov2 = init_failed_responses_iso_v2()
        self.failed_responses_isov20 = init_failed_responses_iso_v20()
        # self.failed_responses_isov20 = init_failed_responses_iso_v20()
        # The MeterInfo value the EVCC send in the ChargingStatusRes or ,
        # CurrentDemandRes. The SECC must send a copy in the MeteringReceiptReq
        # TODO Add support for ISO 15118-20 MeterInfo
        self.sent_meter_info: Optional[MeterInfoV2] = None
        self.is_tls = self._is_tls(transport)

This is done to have access to context info from the session. A better approach is to create a data structure (class), holding the SECC Context data (same for the EVCC) and pass an instance of the class to the V2GCommunicationSession; something like:

class SECCContextData:
    config: Config
    evse_controller: EVSEControllerInterface
    ....

class SECCCommunicationSession(V2GCommunicationSession):
    """
    The communication session object for the SECC, which holds session-specific
    variables and also implements a pausing mechanism.
    """

    def __init__(
        self,
        transport: Tuple[StreamReader, StreamWriter],
        session_handler_queue: asyncio.Queue,
        config: Config,
        evse_controller: EVSEControllerInterface,
        iexi_codec: IEXICodec,
    ):
        self.secc_context = SECCContextData(config, evse_controller, is_tls=self._is_tls(transport), ...)

        # Need to import here to avoid a circular import error
        # pylint: disable=import-outside-toplevel
        from iso15118.secc.states.sap_states import SupportedAppProtocol
        V2GCommunicationSession.__init__(
            self, iexi_codec, transport, SupportedAppProtocol, session_handler_queue, self.secc_context
        )

Also, the EXI class can be created inside the V2GCommunicationSession and within the V2GCommunicationSession methods, we can directly call self.to_exi and self.from_exi.

Exception is raised when the EVCC only supports DIN and sets EVCC_USE_TLS=True

If the EVCC only supports the DIN and the EVCC_USE_TLS=True in the .env, then the EVCC sends this message:

DEBUG    2022-05-11 17:49:20,101 - iso15118.shared.exi_codec (239): Message to encode:
{"supportedAppProtocolReq": {"AppProtocol": []}}
XSD namespace: urn:iso:15118:2:2010:AppProtocol

And the SECC explodes:

DEBUG    2022-05-11 17:49:20,148 - iso15118.shared.exi_codec (306): Decoded message:
{'supportedAppProtocolReq': {}}
 XSD namespace: urn:iso:15118:2:2010:AppProtocol
ERROR    2022-05-11 17:49:20,149 - iso15118.shared.comm_session (202): Error parsing the decoded EXI into a Pydantic class: 1 validation error for SupportedAppProtocolReq
AppProtocol
  field required (type=value_error.missing).

Decoded dict: {'supportedAppProtocolReq': {}}
Traceback (most recent call last):
  File "/Users/andre/Devel/switch_iso15118/iso15118/shared/exi_codec.py", line 312, in from_exi
    return SupportedAppProtocolReq.parse_obj(
  File "pydantic/main.py", line 511, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 331, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for SupportedAppProtocolReq
AppProtocol
  field required (type=value_error.missing)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/andre/Devel/switch_iso15118/iso15118/shared/comm_session.py", line 198, in process_message
    decoded_message = EXI().from_exi(
  File "/Users/andre/Devel/switch_iso15118/iso15118/shared/exi_codec.py", line 382, in from_exi
    raise EXIDecodingError(
iso15118.shared.exceptions.EXIDecodingError: Error parsing the decoded EXI into a Pydantic class: 1 validation error for SupportedAppProtocolReq
AppProtocol
  field required (type=value_error.missing).

Decoded dict: {'supportedAppProtocolReq': {}}
INFO    2022-05-11 17:49:20,149 - iso15118.shared.comm_session (371): The data link will Terminate in 2 seconds and the TCP connection will close in 5 seconds.

I guess the EVCC shouldnt send an empty SupportedAppProtocolReq.
This is happening because we remove the DIN spec out of the supported APP protocols.

    def create_sap(self) -> Union[SupportedAppProtocolReq, None]:
        app_protocols = []
        schema_id = 0
        priority = 0
        supported_protocols = self.config.supported_protocols

        # [V2G-DC-618] For DC charging according to DIN SPEC 70121,
        # an SDP server shall send an SECC Discovery Response message with Transport
        # Protocol equal to โ€œTCPโ€ and Security equal to โ€œNo transport layer securityโ€
        # according to Table 23. Remove it from the supported protocols list if
        # use_tls is enabled
        if self.config.use_tls:
            try:
                supported_protocols.remove(Protocol.DIN_SPEC_70121)
            except ValueError:
                pass

I think we should add the use case that if the DIN is the only protocol supported and TLS is active, then we force TLS to be false or we stop the communication before the SupportedAppProtocolReq is sent with a misconfiguration as a reason.

DC Support

as reference from Haukes email on 25.02.2022

Dear Andrรฉ,
 
IEC 61851-23 has to be certified by the EVSE manufacturer. We know that it is a missing feature on our hardware. Elaborating a safe way to allow safe shutdowns on charging would help other charging station manufacturers. Thatโ€™s why we plan a meeting with our vehicle guys on March, where we figure out by HARA analysis, how our product shall be improved for the future.
 
This experiences will also have effect on the next version of Charge Control C. With this upcoming iteration, I could tell you if the product later, can be extended to support DC charging as well.
For AC charging, wallbox manufacturers handle the safety function with RCD Type B, where CP state detection can be seen as additional safety feature (which we can detect by software right now/ we are also in the timings). For the moment it is as you said, we push the responsibility to comply with the requirements to the EVSE OEM.
 
So for CC C and CC M it is basically the same, that external states are detected within software and not hardware. On the CC M there is an additional processor placed for that reason, which has no other task then watching the state on CP line.
 
I will inform you about the our plans, how to improve the hardware, after that meeting has taken place during March.
 
Regarding your other question: It depends on your choice whether you trigger the emergency shutdown directly, or let another controller direct you to do it. I think this needs just a clear communication inside your documentation.
 
Have a nice weekend!

Support multiple client connections

AB#1524

UDP Server

Seems that is not easy or even possible to join a multicast group for all interfaces for the UDP server. So, this does not work:

interface_idx = 0 # This is the index for all interfaces
join_multicast_group_req = multicast_group_bin + struct.pack(
    "@I", interface_idx
)  # address + interface
sock.setsockopt(
    socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, join_multicast_group_req
)

What can work is setting the socket to listen to multicast packets for the desired interfaces:

interface_idx = socket.if_nametoindex("en0")
join_multicast_group_req = multicast_group_bin + struct.pack(
            "@I", interface_idx
)  # address + interface
sock.setsockopt(
    socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, join_multicast_group_req
)

interface_idx = socket.if_nametoindex("en1")
join_multicast_group_req = multicast_group_bin + struct.pack(
    "@I", interface_idx
)  # address + interface
sock.setsockopt(
    socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, join_multicast_group_req
)

TCP Server

We can bind the server to multiple interfaces ( I tried then to send messages using the loopback interface, but that does not work, so would need a proper setup with 2 devices having IPv6 interfaces and ideally one of them with 2 IPv6 interfaces):
tcp_server.py

# Bind the socket to the IP address and port for receiving
# TCP packets
sock.bind(('', port))

The question is: if the secc/comm_session_handler, needs to get track if there is a client connected to the interfaces and provide in the SDPResponse the Address of the free one OR if we can just provide the address from where the SDPRequest message was received:

secc/comm_session_handler.py

# convert IPv6 address from presentation to numeric format
ipv6_bytes = socket.inet_pton(
    socket.AF_INET6, message.addr[0]
)

Better handling on getting the energy transfer mode

If one wants to test different kind of energy transfers: AC, DC, AC_BPT, DC_BPT... at this point is difficult as the setting is quite static

def get_energy_transfer_mode(self, protocol: Protocol) -> EnergyTransferModeEnum:
        """Overrides EVControllerInterface.get_energy_transfer_mode()."""
        if protocol == Protocol.DIN_SPEC_70121:
            return EnergyTransferModeEnum.DC_EXTENDED
        return EnergyTransferModeEnum.DC_EXTENDED

We require some initial setting to select which energy transfer mode to use. For example, in ISO 15118-2 we can have DC or AC...Obviously it is the job of the SECC to provide the right services supported, based on the connector/interface to which the EVCC was connected to and provide those services through the ChargeService field in the ServiceDiscoveryRes message.

Example:
EV1 -> connects to connector id 1 (this connector is associated with a type 2 plug) -> Services available: AC_single_phase_core, AC_three_phase_core, DC_core (Core pins from the type 2 plug are used), ...
So, in ChargeService the SECC sends those services and the EVCC selects one of those.

EV1 -> connects to connector id 2 (this connector is associated with a CCS-2 plug) -> Services available: DC_extended (extended/dedicated pins are used from a CCS plug), DC_combo_core (Core pins are used from a CCS plug)

Thus, I believe, as a first step, we need to provide the charging services offered by the SECC in service_discovery_res.charge_service to the get_energy_transfer_mode, so that the EV selects the best service that suits it.

ChargeParametersDiscovery checks unnecessarily if the message received is a CableCheck or PowerDelivery

As far as I know, a ChargeParameterDiscoveryReq must always have either the ac_ev_charge_parameter or the dc_ev_charge_parameter present and based on that we know that we need either to transit to PowerDelivery or CableCheck.

Currently, we do the right jump, but at the beginning of the ChargeParameterDiscovery, we continue to check which message have we received, when we know that if we remain in this state we will only receive a ChargeParameterDiscovery message.

class ChargeParameterDiscovery(StateSECC):
    """
    The ISO 15118-2 state in which the SECC processes an
    ChargeParameterDiscoveryReq message from the EVCC.

    The EVCC may send one of the following requests in this state:
    1. a ChargeParameterDiscoveryReq
    2. a PowerDeliveryReq (AC)
    3. a CableCheckreq (DC)

    Upon first initialisation of this state, we expect a
    ChargeParameterDiscoveryReq, but after that, the next possible request could
    be either another ChargeParameterDiscoveryReq (if EVSEProcessing=Ongoing in
    the ChargeParameterDiscoveryRes) or a PowerDeliveryReq. So we remain in this
    state until we know which is the following request from the EVCC and then
    transition to the appropriate state (or terminate if the incoming message
    doesn't fit any of the expected requests).

    As a result, the create_next_message() method might be called with
    next_state = None.
    """

    def __init__(self, comm_session: SECCCommunicationSession):
        super().__init__(comm_session, Timeouts.V2G_SECC_SEQUENCE_TIMEOUT)
        self.expecting_charge_parameter_discovery_req = True

    def process_message(
        self,
        message: Union[
            SupportedAppProtocolReq,
            SupportedAppProtocolRes,
            V2GMessageV2,
            V2GMessageV20,
            V2GMessageDINSPEC,
        ],
    ):
        msg = self.check_msg_v2(
            message,
            [ChargeParameterDiscoveryReq, PowerDeliveryReq, CableCheckReq],
            self.expecting_charge_parameter_discovery_req,
        )
        if not msg:
            return

        if msg.body.power_delivery_req:
            PowerDelivery(self.comm_session).process_message(message)
            return

        if msg.body.cable_check_req:
            CableCheck(self.comm_session).process_message(message)
            return

        charge_params_req: ChargeParameterDiscoveryReq = (
            msg.body.charge_parameter_discovery_req
        )

        if charge_params_req.requested_energy_mode not in (
            self.comm_session.evse_controller.get_supported_energy_transfer_modes(
                Protocol.ISO_15118_2
            )
        ):  # noqa: E501
            self.stop_state_machine(
                f"{charge_params_req.requested_energy_mode} not "
                f"offered as energy transfer mode",
                message,
                ResponseCode.FAILED_WRONG_ENERGY_TRANSFER_MODE,
            )
            return

        self.comm_session.selected_energy_mode = charge_params_req.requested_energy_mode
        self.comm_session.selected_charging_type_is_ac = (
            self.comm_session.selected_energy_mode.value.startswith("AC")
        )

        max_schedule_entries: Optional[
            int
        ] = charge_params_req.max_entries_sa_schedule_tuple

        ac_evse_charge_params: Optional[ACEVSEChargeParameter] = None
        dc_evse_charge_params: Optional[DCEVSEChargeParameter] = None
        if charge_params_req.ac_ev_charge_parameter:
            ac_evse_charge_params = (
                self.comm_session.evse_controller.get_ac_evse_charge_parameter()
            )
            departure_time = charge_params_req.ac_ev_charge_parameter.departure_time
        else:
            dc_evse_charge_params = (
                self.comm_session.evse_controller.get_dc_evse_charge_parameter()
            )
            departure_time = charge_params_req.dc_ev_charge_parameter.departure_time

        if not departure_time:
            departure_time = 0
        sa_schedule_list = self.comm_session.evse_controller.get_sa_schedule_list(
            max_schedule_entries, departure_time
        )

        signature = None
        next_state = None
        if sa_schedule_list:
            self.comm_session.offered_schedules = sa_schedule_list
            if charge_params_req.ac_ev_charge_parameter:
                next_state = PowerDelivery
            else:
                next_state = CableCheck

The cipher ECDH-ECDSA-AES128-SHA256 not support in openssl 1.1.1.

**Has somebody test with this cipher successfully๏ผŸAnd which version of openssl do you install๏ผŸ

I set ssl_context.set_ciphers("ECDH-ECDSA-AES128-SHA256" ) in secc server side. It shows that:**

INFO 2022-09-06 04:57:50,633 - iso15118.secc.transport.tcp_server (110): TCP server started at address fe80::a00:27ff:fe12:a869%eth1 and port 49735
WARNING 2022-09-06 04:57:50,634 - iso15118.secc.transport.tcp_server (123): Closing TCP server
ERROR 2022-09-06 04:57:50,635 - iso15118.shared.utils (51): ('No cipher can be selected.',)
Traceback (most recent call last):
File "/home/pi/projects/pyv2g/iso15118/shared/utils.py", line 49, in wait_for_tasks
task.result()
File "/home/pi/projects/pyv2g/iso15118/secc/transport/tcp_server.py", line 39, in start_tls
await self.server_factory(tls=True)
File "/home/pi/projects/pyv2g/iso15118/secc/transport/tcp_server.py", line 82, in server_factory
ssl_context = get_ssl_context(True)
File "/home/pi/projects/pyv2g/iso15118/shared/security.py", line 181, in get_ssl_context
ssl_context.set_ciphers(
ssl.SSLError: ('No cipher can be selected.',)

Possible issue reported by Designwerk with the TCP server (binding to interface)

According to Lukas, from Designwerk, they experienced issues when starting the SECC side, specifically they reported the bind to the IPv6 IP address would not work and they did the following change in the tcp_server.py:

    async def server_factory(self, tls: bool) -> None:
        port = self.port_no_tls
        ssl_context = None
        server_type = "TCP"
        if tls:
            port = self.port_tls
            ssl_context = get_ssl_context(True)
            server_type = "TLS"
        # Initialise socket for IPv6 TCP packets
        # Address family (determines network layer protocol, here IPv6)
        # Socket type (stream, determines transport layer protocol TCP)
        sock = socket.socket(family=socket.AF_INET6, type=socket.SOCK_STREAM)

        # Allows address to be reused
        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

        self.full_ipv6_address = await get_link_local_full_addr(port, self.iface)
        self.ipv6_address_host = self.full_ipv6_address[0]

        # Bind the socket to the IP address and port for receiving
        # TCP packets
        sock.bind(('', self.full_ipv6_address[1]))

Specifically, sock.bind(self.full_ipv6_address) was changed to sock.bind(('', self.full_ipv6_address[1])).

Until know, was the only case that this issue was reported and running the application in several other systems, didnt trigger this.
Thus, this is likely a specific issue with Designwerk system.
The change to bind to all interfaces should be avoided for security reasons, so at least for now we wont adhere to this change.

Nevertheless, for the support of multiple connections as the interface is bounded to the PLC circuit that connects to a specific connector, we will need to bind the server to all interfaces

No Error handling for getting the service parameter list in iso15118_20_states

If the get_service_parameter_list returns None or an exception, the ServiceDetail state in iso15118_20_states will fail unexpectedly.

We must shield the extraction of these parameter list.

service_detail_req: ServiceDetailReq = msg

        service_parameter_list = (
            self.comm_session.evse_controller.get_service_parameter_list(
                service_detail_req.service_id
            )
        )

Use mypy

In our experience, mypy is very useful to defend against type-related bugs in Python programs. We are using it elsewhere, and it would be a good addition to the iso15118 library.

Unable to start EVCC and SECC

I cloned the repo on a MacOS device and followed the instruction for Docker:

make build
make dev

I see the containers starting but they are throwing errors. This is for the SECC:

iso15118-secc-1 | ERROR 2023-01-20 22:03:44,345 - iso15118.shared.security (152): SSLError, can't load SECC certificate chain for SSL context. Private key (keyfile) probably doesn't match certificate (certfile) or password for private is key invalid. Returning None instead.
iso15118-secc-1 | Traceback (most recent call last):
iso15118-secc-1 | File "/venv/lib/python3.10/site-packages/iso15118/shared/security.py", line 146, in get_ssl_context
iso15118-secc-1 | ssl_context.load_cert_chain(
iso15118-secc-1 | ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:3862)
iso15118-secc-1 | INFO 2023-01-20 22:03:44,346 - iso15118.secc.transport.udp_server (129): UDP server socket ready
iso15118-secc-1 | INFO 2023-01-20 22:03:44,346 - iso15118.secc.transport.udp_server (115): UDP server started at address FF02::1%eth0 and port 15118
iso15118-secc-1 | ERROR 2023-01-20 22:03:44,346 - iso15118.shared.utils (126): [Errno 99] Cannot assign requested address
iso15118-secc-1 | Traceback (most recent call last):
iso15118-secc-1 | File "/venv/lib/python3.10/site-packages/iso15118/shared/utils.py", line 124, in wait_for_tasks
iso15118-secc-1 | task.result()
iso15118-secc-1 | File "/venv/lib/python3.10/site-packages/iso15118/secc/transport/tcp_server.py", line 39, in start_tls
iso15118-secc-1 | await self.server_factory(ready_event, tls=True)
iso15118-secc-1 | File "/venv/lib/python3.10/site-packages/iso15118/secc/transport/tcp_server.py", line 97, in server_factory
iso15118-secc-1 | sock.bind(self.full_ipv6_address)
iso15118-secc-1 | OSError: [Errno 99] Cannot assign requested address
iso15118-secc-1 | ERROR 2023-01-20 22:03:44,346 - iso15118.shared.utils (126): [Errno 99] Cannot assign requested address
iso15118-secc-1 | Traceback (most recent call last):
iso15118-secc-1 | File "/venv/lib/python3.10/site-packages/iso15118/shared/utils.py", line 124, in wait_for_tasks
iso15118-secc-1 | task.result()
iso15118-secc-1 | File "/venv/lib/python3.10/site-packages/iso15118/secc/transport/tcp_server.py", line 45, in start_no_tls
iso15118-secc-1 | await self.server_factory(ready_event, tls=False)
iso15118-secc-1 | File "/venv/lib/python3.10/site-packages/iso15118/secc/transport/tcp_server.py", line 97, in server_factory
iso15118-secc-1 | sock.bind(self.full_ipv6_address)
iso15118-secc-1 | OSError: [Errno 99] Cannot assign requested address

Handle missing responder_url in a better way

Currently, if the responder_url cannot be obtained from a certificate, we just put "https://www.example.com".

This is probably not reasonable since it just pushes the error elsewhere.

Handle this case in a better way, if possible -- it may be that we can also fall back here on the CSMS retrieving the root certificate, or trying a URL of another certificate in the chain (are these sometimes left out inadvertently in practice?)

Docker Build Error

The docker build method described in the repositories throws the following error.
Is there any workaround for this?

I am testing on Ubuntu 22.04. Poetry and all components are installed and working fine.

~/iso15118 (master) ยป sudo make build                                                                                                                                                
cd iso15118/shared/pki; ./create_certs.sh -v iso-2
Password used is: '12345'
read EC key
writing EC key
Signature ok
subject=CN = V2GRootCA, O = Switch, C = UK, DC = V2G
Getting Private key
read EC key
writing EC key
Signature ok
subject=CN = CPOSubCA1, O = Switch, C = UK, DC = V2G
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = CPOSubCA2, O = Switch, C = UK, DC = V2G
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = SECCCert, O = Switch, C = UK, DC = CPO
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = OEMRootCA, O = Switch, C = UK, DC = OEM
Getting Private key
read EC key
writing EC key
Signature ok
subject=CN = OEMSubCA1, O = Switch, C = UK, DC = OEM
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = OEMSubCA2, O = Switch, C = UK, DC = OEM
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = OEMProvCert, O = Switch, C = UK, DC = OEM
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = MORootCA, O = Switch, C = UK, DC = MO
Getting Private key
read EC key
writing EC key
Signature ok
subject=CN = PKI-Ext_CRT_MO_SUB1_VALID, O = Switch, C = UK, DC = MO
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = PKI-Ext_CRT_MO_SUB2_VALID, O = Switch, C = UK, DC = MO
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = UKSWI123456789A, O = Switch, C = UK, DC = MO
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = ProvSubCA1, O = Switch, C = UK, DC = CPS
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = ProvSubCA2, O = Switch, C = UK, DC = CPS
Getting CA Private Key
read EC key
writing EC key
Signature ok
subject=CN = CPS Leaf, O = Switch, C = UK, DC = CPS
Getting CA Private Key
'template.Dockerfile' -> 'iso15118/evcc/Dockerfile'
'template.Dockerfile' -> 'iso15118/secc/Dockerfile'
docker-compose build
redis uses an image, skipping
Building secc
Sending build context to Docker daemon  30.24MB
Step 1/18 : FROM python:3.10.0-buster as build
 ---> b47b4cc944d6
Step 2/18 : WORKDIR /usr/src/app
 ---> Using cache
 ---> c7093a479e83
Step 3/18 : ENV PYTHONFAULTHANDLER=1   PYTHONUNBUFFERED=1   PYTHONHASHSEED=random   PIP_NO_CACHE_DIR=1   PIP_DISABLE_PIP_VERSION_CHECK=1   PIP_DEFAULT_TIMEOUT=100   POETRY_VERSION=1.1.11   VIRTUALENV_PIP=21.2.1   MYPY_VERSION=0.930
 ---> Using cache
 ---> 3052b10cd20c
Step 4/18 : RUN pip install "poetry==$POETRY_VERSION" "mypy==$MYPY_VERSION"
 ---> Using cache
 ---> 2e72d4652c00
Step 5/18 : COPY .coveragerc mypy.ini .flake8 poetry.lock pyproject.toml ./
 ---> Using cache
 ---> 208ea18bbae2
Step 6/18 : RUN sed -i 's/secc/secc/g' pyproject.toml
 ---> Using cache
 ---> f2aa97bba272
Step 7/18 : RUN poetry install --no-interaction --no-ansi
 ---> Running in e002b0470aa8

  RuntimeError

  The Poetry configuration is invalid:
    - Additional properties are not allowed ('group' was unexpected)


  at /usr/local/lib/python3.10/site-packages/poetry/core/factory.py:43 in create_poetry
       39โ”‚             message = ""
       40โ”‚             for error in check_result["errors"]:
       41โ”‚                 message += "  - {}\n".format(error)
       42โ”‚
    โ†’  43โ”‚             raise RuntimeError("The Poetry configuration is invalid:\n" + message)
       44โ”‚
       45โ”‚         # Load package
       46โ”‚         name = local_config["name"]
       47โ”‚         version = local_config["version"]
The command '/bin/sh -c poetry install --no-interaction --no-ansi' returned a non-zero code: 1
ERROR: Service 'secc' failed to build : Build failed
make: *** [Makefile:59: build] Error 1

The "EVSEMaximumPowerLimit" is optional for the DIN70121 ChargeParameterDiscovery message, it is rejected now.

See V2G-DC-353 requirement.
The test now rejects this which is wrong.

See the example log below:

DEBUG 2022-08-17 15:19:53,402 - iso15118.shared.exi_codec (239): Message to encode:
{"V2G_Message": {"Header": {"SessionID": "4242424242424242"}, "Body": {"ChargeParameterDiscoveryReq": {"EVRequestedEnergyTransferType": "DC_extended", "DC_EVChargeParameter": {"DC_EVStatus": {"EVReady": true, "EVErrorCode": "NO_ERROR", "EVRESSSOC": 60}, "EVMaximumCurrentLimit": {"Value": 32000, "Multiplier": -3, "Unit": "A"}, "EVMaximumVoltageLimit": {"Value": 40, "Multiplier": 1, "Unit": "V"}}}}}}
XSD namespace: urn:din:70121:2012:MsgDef
INFO 2022-08-17 15:19:53,431 - iso15118.shared.comm_session (396): Sending ChargeParameterDiscoveryReq
INFO 2022-08-17 15:19:53,432 - iso15118.shared.states (137): Entered state ChargeParameterDiscovery
INFO 2022-08-17 15:19:53,432 - iso15118.shared.states (141): Waiting for up to 2.0 s
DEBUG 2022-08-17 15:19:53,463 - iso15118.shared.exi_codec (306): Decoded message:
{'V2G_Message': {'Header': {'SessionID': '4242424242424242'}, 'Body': {'ChargeParameterDiscoveryRes': {'ResponseCode': 'OK', 'EVSEProcessing': 'Finished', 'SAScheduleList': {'SAScheduleTuple': [{'SAScheduleTupleID': 1, 'PMaxSchedule': {'PMaxScheduleID': 1, 'PMaxScheduleEntry': [{'RelativeTimeInterval': {'start': 0, 'duration': 28800}, 'PMax': 32767}]}}]}, 'DC_EVSEChargeParameter': {'DC_EVSEStatus': {'EVSEIsolationStatus': 'Valid', 'EVSEStatusCode': 'EVSE_Ready', 'NotificationMaxDelay': 0, 'EVSENotification': 'None'}, 'EVSEMaximumCurrentLimit': {'Multiplier': 0, 'Unit': 'A', 'Value': 180}, 'EVSEMaximumVoltageLimit': {'Multiplier': 0, 'Unit': 'V', 'Value': 1000}, 'EVSEMinimumCurrentLimit': {'Multiplier': 0, 'Unit': 'A', 'Value': 0}, 'EVSEMinimumVoltageLimit': {'Multiplier': 0, 'Unit': 'V', 'Value': 200}, 'EVSECurrentRegulationTolerance': {'Multiplier': 0, 'Unit': 'A', 'Value': 1}, 'EVSEPeakCurrentRipple': {'Multiplier': 0, 'Unit': 'A', 'Value': 1}}}}}}
XSD namespace: urn:din:70121:2012:MsgDef
ERROR 2022-08-17 15:19:53,463 - iso15118.shared.comm_session (202): Error parsing the decoded EXI into a Pydantic class: 1 validation error for V2GMessage
Body -> ChargeParameterDiscoveryRes -> DC_EVSEChargeParameter -> EVSEMaximumPowerLimit
field required (type=value_error.missing).

Decoded dict: {'V2G_Message': {'Header': {'SessionID': '4242424242424242'}, 'Body': {'ChargeParameterDiscoveryRes': {'ResponseCode': 'OK', 'EVSEProcessing': 'Finished', 'SAScheduleList': {'SAScheduleTuple': [{'SAScheduleTupleID': 1, 'PMaxSchedule': {'PMaxScheduleID': 1, 'PMaxScheduleEntry': [{'RelativeTimeInterval': {'start': 0, 'duration': 28800}, 'PMax': 32767}]}}]}, 'DC_EVSEChargeParameter': {'DC_EVSEStatus': {'EVSEIsolationStatus': 'Valid', 'EVSEStatusCode': 'EVSE_Ready', 'NotificationMaxDelay': 0, 'EVSENotification': 'None'}, 'EVSEMaximumCurrentLimit': {'Multiplier': 0, 'Unit': 'A', 'Value': 180}, 'EVSEMaximumVoltageLimit': {'Multiplier': 0, 'Unit': 'V', 'Value': 1000}, 'EVSEMinimumCurrentLimit': {'Multiplier': 0, 'Unit': 'A', 'Value': 0}, 'EVSEMinimumVoltageLimit': {'Multiplier': 0, 'Unit': 'V', 'Value': 200}, 'EVSECurrentRegulationTolerance': {'Multiplier': 0, 'Unit': 'A', 'Value': 1}, 'EVSEPeakCurrentRipple': {'Multiplier': 0, 'Unit': 'A', 'Value': 1}}}}}}
Traceback (most recent call last):
File "/home/henri/SwitchEV/iso15118/iso15118/shared/exi_codec.py", line 322, in from_exi
return V2GMessageDINSPEC.parse_obj(decoded_dict["V2G_Message"])
File "pydantic/main.py", line 521, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for V2GMessage
Body -> ChargeParameterDiscoveryRes -> DC_EVSEChargeParameter -> EVSEMaximumPowerLimit
field required (type=value_error.missing)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/henri/SwitchEV/iso15118/iso15118/shared/comm_session.py", line 198, in process_message
decoded_message = EXI().from_exi(
File "/home/henri/SwitchEV/iso15118/iso15118/shared/exi_codec.py", line 382, in from_exi
raise EXIDecodingError(
iso15118.shared.exceptions.EXIDecodingError: Error parsing the decoded EXI into a Pydantic class: 1 validation error for V2GMessage
Body -> ChargeParameterDiscoveryRes -> DC_EVSEChargeParameter -> EVSEMaximumPowerLimit
field required (type=value_error.missing).

Possible to install without Poetry?

Hi

As recently, i did finally get this rather excellent library installed on a Raspberry Pi, though it took quite a while to get Poetry installed. On a BeagleBone Black, that's turning out to be even more difficult. python-poetry/poetry#7108

Is there a way of installing this library without Poetry?

H

ChargeParameterDiscovery signs tariffs even without TLS

This is part of the code in ChargeParameterDiscovery in secc/isp15118_2_states.py

if sa_schedule_list:
    self.comm_session.offered_schedules = sa_schedule_list
    if charge_params_req.ac_ev_charge_parameter:
        next_state = PowerDelivery
    else:
        next_state = CableCheck
    
    # If a SalesTariff is provided, then sign it
    # This signature should actually be provided by the mobility
    # operator (MO), but for testing purposes you can set it here
    # TODO We should probably have a test mode setting
    for schedule in sa_schedule_list:
        if schedule.sales_tariff:
            try:
                element_to_sign = (
                    schedule.sales_tariff.id,
                    EXI().to_exi(
                        schedule.sales_tariff, Namespace.ISO_V2_MSG_DEF
                    ),
                )
                signature_key = load_priv_key(
                    KeyPath.MO_SUB_CA2_PEM, KeyEncoding.PEM
                )
                signature = create_signature([element_to_sign], 

If the schedule.sales_tariff is present but we are not under a TLS connection, then the signature should not happen

The attribute self.comm_session.is_tls can be used to avoid the signature in non tls connections

Bug in PowerDeliveryReq when sending DCEVPowerDeliveryParameter

This bug was in fact raised thanks to the work done by Jรถrn Schumann from the Fraunhofer Institute.

During one of their tests they found out that when receiving a PowerDeliveryReq message containing the optional DCEVPowerDeliveryParameter containing the field BulkChargingComplete the iso15118 raised an error.

Decoded dict: {'V2G_Message': {'Header': {'SessionID': '5D61F57AA6225E84'}, 'Body': {'PowerDeliveryReq': {'ChargeProgress': 'Start', 'SAScheduleTupleID': 1, 'ChargingProfile': {'ProfileEntry': [{'ChargingProfileEntryStart': 0, 'ChargingProfileEntryMaxPower': {'Multiplier': 0, 'Unit': 'W', 'Value': 11000}, 'ChargingProfileEntryMaxNumberOfPhasesInUse': 3}, {'ChargingProfileEntryStart': 3600, 'ChargingProfileEntryMaxPower': {'Multiplier': 0, 'Unit': 'W', 'Value': 7000}, 'ChargingProfileEntryMaxNumberOfPhasesInUse': 3}]}, 'DC_EVPowerDeliveryParameter': {'DC_EVStatus': {'EVReady': True, 'EVErrorCode': 'NO_ERROR', 'EVRESSSOC': 49}, 'BulkChargingComplete': False, 'ChargingComplete': False}}}}}


File "pydantic/main.py", line 521, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for V2GMessage
Body -> PowerDeliveryReq -> DC_EVPowerDeliveryParameter -> BulkChargingComplete extra fields not permitted (type=value_error.extra)

The error is due to a typo in here:
https://github.com/SwitchEV/iso15118/blob/master/iso15118/shared/messages/iso15118_2/datatypes.py#L276

Thus, the fix to fix the typo to alias.

PnC Authorization -> First AuthorizationReq message contains the id and GenChallenge, but not the upcoming ones

Azure ticket: AB#1049

This is the Authorization state class:

class Authorization(StateSECC):
    """
    The ISO 15118-2 state in which the SECC processes an
    AuthorizationReq message from the EVCC.

    At this state, the application will assert if the authorization has been
    concluded by running the method `is_authorised` from the evcc_controller.
    If the method returns `True`, then the authorization step is finished and
    the state machine can move on to the `ChargeParameterDiscovery` state,
    otherwise will stay in this state and answer to the EV with
    `EVSEProcessing=Ongoing`.

    TODO: This method is incomplete, as it wont allow answering with a Failed
          response, for a rejected authorization. `is_authorized` shall return
          one out of three responses: `ongoing`, `accepted` or `rejected`.
          In case of rejected and according to table 112 from ISO 15118-2, the
          errors allowed to be used are: FAILED, FAILED_Challenge_Invalid or
          FAILED_Certificate_Revoked.
          Please check: https://dev.azure.com/switch-ev/Josev/_backlogs/backlog/Josev%20Team/Stories/?workitem=1049  # noqa: E501

    """

    def __init__(self, comm_session: SECCCommunicationSession):
        super().__init__(comm_session, Timeouts.V2G_SECC_SEQUENCE_TIMEOUT)

    def process_message(
        self,
        message: Union[
            SupportedAppProtocolReq,
            SupportedAppProtocolRes,
            V2GMessageV2,
            V2GMessageV20,
        ],
    ):
        msg = self.check_msg_v2(message, [AuthorizationReq])

        if not msg:
            return

        authorization_req: AuthorizationReq = msg.body.authorization_req

        if self.comm_session.selected_auth_option == AuthEnum.PNC_V2:
            if not self.comm_session.contract_cert_chain:
                self.stop_state_machine(
                    "No contract certificate chain available to "
                    "verify AuthorizationReq",
                    message,
                    ResponseCode.FAILED_SIGNATURE_ERROR,
                )
                return

            if not verify_signature(
                msg.header.signature,
                [
                    (
                        authorization_req.id,
                        EXI().to_exi(authorization_req, Namespace.ISO_V2_MSG_DEF),
                    )
                ],
                self.comm_session.contract_cert_chain.certificate,
            ):
                self.stop_state_machine(
                    "Unable to verify signature of AuthorizationReq",
                    message,
                    ResponseCode.FAILED_SIGNATURE_ERROR,
                )
                return

        auth_status: EVSEProcessing = EVSEProcessing.ONGOING
        next_state: Type["State"] = Authorization
        if self.comm_session.evse_controller.is_authorised():
            auth_status = EVSEProcessing.FINISHED
            next_state = ChargeParameterDiscovery

        # TODO Need to distinguish between ONGOING and
        #      ONGOING_WAITING_FOR_CUSTOMER

        authorization_res = AuthorizationRes(
            response_code=ResponseCode.OK, evse_processing=auth_status
        )

        self.create_next_message(
            next_state,
            authorization_res,
            Timeouts.V2G_SECC_SEQUENCE_TIMEOUT,
            Namespace.ISO_V2_MSG_DEF,
        )

According to requirement [V2G2-684], in case of PnC and after the first AuthorizationReq, which has to be signed by the EVCC, is verified, if the SECC has not yet an answer from the CSMS that the EV is authorized or not, then iso15118 can for 60s be in a loop of AuthorizationReq/Res with EVSEProcessing = "Ongoing" and in this case, the subsequent AutorizationReq messages are empty, so the SECC does not need to verify the Signature of those messages.

Inspecting the code, is clear that this is not expected and, as of today, the code would fail, because it would try to verify the signature of the Authorization message when not supposed to.

Solution: Save in a variable that the 1st Authorization was verified, so that the next AuthorizationReq does not need to be verified.

Flesh out AuthorizationTokenType

Currently, our AuthorizationTokenType only contains EMAID and EXTERNAL values. Add a more complete set of values that cover the various use cases.

SSLError thrown while trying to load certificates

Saw the following error thrown during startup.
SSL on my machine: LibreSSL 2.8.3

ERROR    2022-05-17 09:42:51,911 - iso15118.shared.security (127): SSLError, can't load certificate chain for SSL context. Private key (keyfile) probably doesn't match certificate (certfile) or password for private is key invalid. Returning None instead.
Traceback (most recent call last):
  File "/Users/shalinnijel/Desktop/Switch/GitHub/DINSPEC/dinspec_tests/iso15118/venv_din/lib/python3.10/site-packages/iso15118/shared/security.py", line 121, in get_ssl_context
    ssl_context.load_cert_chain(
ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:3862)

change the type name of Certificate to CertificateBytes

Currently, we use Certificate as a type for the iso15118 Certificates fields:
https://github.com/SwitchEV/iso15118/blob/master/iso15118/shared/messages/iso15118_2/datatypes.py#L53

This is confused with the Certificate data type of the cryptography lib:
https://github.com/SwitchEV/iso15118/blob/master/iso15118/shared/security.py#L34

Instead, @danielgordon-switch-ev proposed we change the type used for the iso15118 to
CertificateBytes, avoiding this confusion

Runs fine on Raspberry Pi. Runs but fails on Beaglebone Black

Not sure if this is a bug or an issue or what.

We've managed to install the library on a Raspberry Pi, and it works fine. Car talks to charger and vice versa. All works! Excellent!

But on a BeagleBone Black, the conversation starts up but then fails. A few of us have trawled through the logs, but really have no idea what might be happenning.

I've pasted the logs below....a bit long, but maybe someone can see something.

H

+++++++++++++++++++++++++++++++++++++++++++

ISO 15118 Dialog on BeagleBone

+++++++++++++++++EVSE Side++++++++++++++++++++++

(iso15118-py3.9) debian@BeagleBone:~/iso15118-master$ make run-secc
make[1]: Entering directory '/home/debian/iso15118-master'
/home/debian/.cache/pypoetry/virtualenvs/iso15118-wboF4ZSG-py3.9/bin/python iso15118/secc/main.py
DEBUG 2022-11-30 10:27:00,433 - asyncio (59): Using selector: EpollSelector
INFO 2022-11-30 10:27:00,466 - iso15118.secc.secc_settings (117): SECC settings:
INFO 2022-11-30 10:27:00,468 - iso15118.secc.secc_settings (119): PKI_PATH : /home/debian/iso15118-master/iso15118/shared/pki
INFO 2022-11-30 10:27:00,471 - iso15118.secc.secc_settings (119): ENABLE_TLS_1_3 : False
INFO 2022-11-30 10:27:00,473 - iso15118.secc.secc_settings (119): MESSAGE_LOG_EXI : False
INFO 2022-11-30 10:27:00,475 - iso15118.secc.secc_settings (119): MESSAGE_LOG_JSON : True
INFO 2022-11-30 10:27:00,478 - iso15118.secc.secc_settings (119): V20_SERVICE_CONFIG : /home/debian/iso15118-master/iso15118/shared/examples/15118_20_evse_service_config.json
INFO 2022-11-30 10:27:00,488 - iso15118.secc.secc_settings (121): PROTOCOLS : ['DIN_SPEC_70121', 'ISO_15118_2', 'ISO_15118_20_AC', 'ISO_15118_20_DC']
INFO 2022-11-30 10:27:00,491 - iso15118.secc.secc_settings (121): FREE_CERT_INSTALL_SERVICE : True
INFO 2022-11-30 10:27:00,493 - iso15118.secc.secc_settings (121): STANDBY_ALLOWED : False
INFO 2022-11-30 10:27:00,495 - iso15118.secc.secc_settings (121): USE_CPO_BACKEND : False
INFO 2022-11-30 10:27:00,498 - iso15118.secc.secc_settings (121): ALLOW_CERT_INSTALL_SERVICE : True
INFO 2022-11-30 10:27:00,500 - iso15118.secc.secc_settings (121): LOG_LEVEL : DEBUG
INFO 2022-11-30 10:27:00,503 - iso15118.secc.secc_settings (121): SECC_ENFORCE_TLS : True
INFO 2022-11-30 10:27:00,505 - iso15118.secc.secc_settings (121): AUTH_MODES : ['EIM', 'PNC']
INFO 2022-11-30 10:27:00,507 - iso15118.secc.secc_settings (121): FREE_CHARGING_SERVICE : False
INFO 2022-11-30 10:27:00,510 - iso15118.secc.secc_settings (121): NETWORK_INTERFACE : eth0
DEBUG 2022-11-30 10:27:00,612 - iso15118.secc.controller.simulator (201): New Status: starting
INFO 2022-11-30 10:27:34,474 - iso15118.shared.exi_codec (174): EXI Codec version: 1.55
INFO 2022-11-30 10:27:34,478 - iso15118.secc (31): Starting 15118 version: 0.14.1
INFO 2022-11-30 10:27:34,482 - iso15118.secc.comm_session_handler (217): Communication session handler started
INFO 2022-11-30 10:27:34,517 - iso15118.secc.transport.udp_server (130): UDP server socket ready
INFO 2022-11-30 10:27:34,522 - iso15118.secc.transport.udp_server (116): UDP server started at address FF02::1%eth0 and port 15118
INFO 2022-11-30 10:27:34,527 - iso15118.secc.transport.tcp_server (109): TLS server started at address fe80::3608:e1ff:fed7:84a7%eth0 and port 64787
DEBUG 2022-11-30 10:27:34,533 - iso15118.secc.controller.simulator (201): New Status: ready
DEBUG 2022-11-30 11:01:33,579 - iso15118.secc.transport.udp_server (145): Message received from ('fe80::3608:e1ff:fed7:84a7', 41911, 0, 2): 01fe9000000000020000
INFO 2022-11-30 11:01:33,588 - iso15118.secc.comm_session_handler (328): SDPRequest received: [Security: TLS, Protocol: TCP]
INFO 2022-11-30 11:01:33,594 - iso15118.secc.comm_session_handler (368): Sending SDPResponse: [ IP address: fe80::3608:e1ff:fed7:84a7, Port: 64787 , Security: TLS , Transport: TCP ]
INFO 2022-11-30 11:01:33,681 - iso15118.secc.comm_session_handler (263): TCP client connected, client address is ('fe80::3608:e1ff:fed7:84a7', 39778, 0, 2).
INFO 2022-11-30 11:01:33,840 - iso15118.shared.comm_session (344): Starting a new communication session
INFO 2022-11-30 11:01:33,847 - iso15118.shared.states (137): Entered state SupportedAppProtocol
DEBUG 2022-11-30 11:01:33,850 - iso15118.shared.states (141): Waiting for up to 20.0 s
INFO 2022-11-30 11:01:37,290 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolReq":{"AppProtocol":[{"ProtocolNamespace":"urn:iso:15118:2:2013:MsgDef","VersionNumberMajor":2,"VersionNumberMinor":0,"SchemaID":1,"Priority":1},{"ProtocolNamespace":"urn:iso:std:iso:15118:-20:AC","VersionNumberMajor":1,"VersionNumberMinor":0,"SchemaID":2,"Priority":2}]}}
INFO 2022-11-30 11:01:37,295 - iso15118.shared.comm_session (234): supportedAppProtocolReq received
INFO 2022-11-30 11:01:37,303 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolRes": {"ResponseCode": "OK_SuccessfulNegotiation", "SchemaID": 1}}
INFO 2022-11-30 11:01:37,877 - iso15118.secc.states.sap_states (146): Chosen protocol: ISO_15118_2
INFO 2022-11-30 11:01:37,880 - iso15118.shared.comm_session (420): Sending supportedAppProtocolRes
INFO 2022-11-30 11:01:37,886 - iso15118.shared.states (137): Entered state SessionSetup
DEBUG 2022-11-30 11:01:37,888 - iso15118.shared.states (141): Waiting for up to 20.0 s
INFO 2022-11-30 11:01:41,823 - iso15118.shared.comm_session (390): The data link will terminate in 2 seconds and the TCP connection will close in 5 seconds.
INFO 2022-11-30 11:01:41,831 - iso15118.shared.comm_session (394): Reason: TCP peer closed connection
INFO 2022-11-30 11:01:43,842 - iso15118.shared.comm_session (401): terminated the data link
INFO 2022-11-30 11:01:46,847 - iso15118.shared.comm_session (408): TCP connection closed to peer with address None

_ ++++++++++++EV Side++++++++++++++++++++++++++++++++_

debian@BeagleBone:~/iso15118-master$ make run-evcc
make[1]: Entering directory '/home/debian/iso15118-master'
/home/debian/.cache/pypoetry/virtualenvs/iso15118-wboF4ZSG-py3.9/bin/python iso15118/evcc/main.py
DEBUG 2022-11-30 11:01:01,548 - asyncio (59): Using selector: EpollSelector
INFO 2022-11-30 11:01:33,387 - iso15118.evcc.evcc_settings (93): EVCC settings:
INFO 2022-11-30 11:01:33,391 - iso15118.evcc.evcc_settings (95): PKI_PATH : /home/debian/iso15118-master/iso15118/shared/pki
INFO 2022-11-30 11:01:33,394 - iso15118.evcc.evcc_settings (95): ENABLE_TLS_1_3 : False
INFO 2022-11-30 11:01:33,396 - iso15118.evcc.evcc_settings (95): V20_SERVICE_CONFIG : /home/debian/iso15118-master/iso15118/shared/examples/15118_20_evse_service_config.json
INFO 2022-11-30 11:01:33,398 - iso15118.evcc.evcc_settings (95): MESSAGE_LOG_EXI : False
INFO 2022-11-30 11:01:33,401 - iso15118.evcc.evcc_settings (95): MESSAGE_LOG_JSON : True
INFO 2022-11-30 11:01:33,410 - iso15118.evcc.evcc_settings (97): MAX_CONTRACT_CERTS : 3
INFO 2022-11-30 11:01:33,413 - iso15118.evcc.evcc_settings (97): SDP_RETRY_CYCLES : 1
INFO 2022-11-30 11:01:33,416 - iso15118.evcc.evcc_settings (97): NETWORK_INTERFACE : eth0
INFO 2022-11-30 11:01:33,418 - iso15118.evcc.evcc_settings (97): LOG_LEVEL : DEBUG
INFO 2022-11-30 11:01:33,421 - iso15118.evcc.evcc_settings (97): MAX_SUPPORTING_POINTS : 1024
INFO 2022-11-30 11:01:33,424 - iso15118.evcc.evcc_settings (97): EVCC_USE_TLS : True
INFO 2022-11-30 11:01:33,426 - iso15118.evcc.evcc_settings (97): EVCC_ENFORCE_TLS : True
INFO 2022-11-30 11:01:33,454 - iso15118.shared.exi_codec (174): EXI Codec version: 1.55
INFO 2022-11-30 11:01:33,457 - iso15118.evcc (28): Starting 15118 version: 0.14.1
INFO 2022-11-30 11:01:33,461 - iso15118.evcc.comm_session_handler (295): Communication session handler started
DEBUG 2022-11-30 11:01:33,467 - iso15118.evcc.comm_session_handler (374): Initiating new SDP cycle, 0 more cycles(s) left
INFO 2022-11-30 11:01:33,470 - iso15118.evcc.comm_session_handler (380): Remaining SDP requests: 50
DEBUG 2022-11-30 11:01:33,473 - iso15118.evcc.transport.udp_client (90): UDP client socket ready
INFO 2022-11-30 11:01:33,575 - iso15118.evcc.comm_session_handler (317): Sending SDPRequest: [Security: TLS, Protocol: TCP]
DEBUG 2022-11-30 11:01:33,584 - iso15118.evcc.transport.udp_client (170): Message sent: [Header = [0x1, 0xfe, 0x9000, 2], Payload = 0000)]
INFO 2022-11-30 11:01:33,598 - iso15118.evcc.transport.udp_client (105): Received datagram from UDP server at address ('fe80::3608:e1ff:fed7:84a7', 15118, 0, 2)
INFO 2022-11-30 11:01:33,603 - iso15118.evcc.comm_session_handler (462): SDPResponse received: [ IP address: fe80::3608:e1ff:fed7:84a7, Port: 64787 , Security: TLS , Transport: TCP ]
INFO 2022-11-30 11:01:33,606 - iso15118.evcc.comm_session_handler (398): Starting TLS client, trying to connect to fe80::3608:e1ff:fed7:84a7 at port 64787 ...
INFO 2022-11-30 11:01:33,678 - iso15118.evcc.comm_session_handler (405): TCP client connected
INFO 2022-11-30 11:01:33,844 - iso15118.shared.comm_session (344): Starting a new communication session
INFO 2022-11-30 11:01:33,854 - iso15118.shared.states (137): Entered state SupportedAppProtocol
DEBUG 2022-11-30 11:01:33,861 - iso15118.shared.states (141): Waiting for up to 2.0 s
WARNING 2022-11-30 11:01:33,864 - iso15118.evcc.comm_session_handler (160): Removed DIN_SPEC from the list of supported Protocols as TLS is enabled
INFO 2022-11-30 11:01:33,874 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolReq": {"AppProtocol": [{"ProtocolNamespace": "urn:iso:15118:2:2013:MsgDef", "VersionNumberMajor": 2, "VersionNumberMinor": 0, "SchemaID": 1, "Priority": 1}, {"ProtocolNamespace": "urn:iso:std:iso:15118:-20:AC", "VersionNumberMajor": 1, "VersionNumberMinor": 0, "SchemaID": 2, "Priority": 2}]}}
INFO 2022-11-30 11:01:34,784 - iso15118.shared.comm_session (420): Sending supportedAppProtocolReq
INFO 2022-11-30 11:01:36,799 - iso15118.shared.comm_session (390): The data link will terminate in 2 seconds and the TCP connection will close in 5 seconds.
INFO 2022-11-30 11:01:36,801 - iso15118.shared.comm_session (394): Reason: TimeoutError occurred. Waited for 2.0 s after sending last message: [Header = [0x1, 0xfe, 0x8001, 71], Payload = 8000ebab9371d34b9b79d189a98989c1d191d191818999d26b9b3a232b30020000040001e75726e3a69736f3a7374643a69736f3a31353131383a2d32303a41430020000100880)]
INFO 2022-11-30 11:01:38,812 - iso15118.shared.comm_session (401): terminated the data link
INFO 2022-11-30 11:01:41,829 - iso15118.shared.comm_session (408): TCP connection closed to peer with address None
ERROR 2022-11-30 11:01:41,836 - iso15118.evcc.comm_session_handler (544): EVCC tried to initiate a V2GCommunicationSession, but maximum number of SDP retry cycles (1) is now reached. Shutting down high-level communication. Unplug and plug in the cable again if you want to start anew.
Traceback (most recent call last):
File "/home/debian/iso15118-master/iso15118/evcc/comm_session_handler.py", line 542, in get_from_rcv_queue
await self.restart_sdp(True)
File "/home/debian/iso15118-master/iso15118/evcc/comm_session_handler.py", line 366, in restart_sdp
raise SDPFailedError(
iso15118.shared.exceptions.SDPFailedError: EVCC tried to initiate a V2GCommunicationSession, but maximum number of SDP retry cycles (1) is now reached. Shutting down high-level communication. Unplug and plug in the cable again if you want to start anew.

If MO Root is not found it crashes the application

DEBUG    2022-09-07 09:06:35,655 - mqtt_api (303): Sending {"id":"5bde023e-40a9-41bb-8499-80dcf20a4591","type":"update","name":"iso15118_message","data":{"evse_id":"DE*SWT*E123456789","message_type":"Request","message_name":"PaymentServiceSelectionReq","json_payload":{"V2G_Message":{"Body":{"PaymentServiceSelectionReq":{"SelectedPaymentOption":"Contract","SelectedServiceList":{"SelectedService":[{"ServiceID":1}]}}},"Header":{"SessionID":"D24E49E01843440E"}}},"exi_payload":"809802349392780610d1039130001280"}} to topic Topics.ISO15118_OCPP
ERROR    2022-09-07 09:06:35,669 - iso15118.shared.utils (51): [Errno 2] No such file or directory: <CertPath.MO_ROOT_DER: '/extra/iso15118_2/certs/moRootCACert.der'>
Traceback (most recent call last):
  File "iso15118/shared/utils.py", line 49, in wait_for_tasks
  File "iso15118/shared/comm_session.py", line 467, in rcv_loop
  File "iso15118/shared/comm_session.py", line 222, in process_message
  File "iso15118/secc/states/iso15118_2_states.py", line 499, in process_message
  File "iso15118/secc/states/iso15118_2_states.py", line 879, in process_message
  File "iso15118/shared/security.py", line 333, in load_cert
FileNotFoundError: [Errno 2] No such file or directory: <CertPath.MO_ROOT_DER: '/extra/iso15118_2/certs/moRootCACert.der'>
DEBUG    2022-09-07 09:06:35,741 - mqtt_api (31): Trying to open the path: /extra/iso15118_service/mqtt_api/schemas/Iso15118MessageUpdate.json
DEBUG    2022-09-07 09:06:35,849 - mqtt_api (303): Sending {"id":"cf6eb61a-1272-43b1-a1b2-dfa738634280","type":"update","name":"iso15118_message","data":{"evse_id":"DE*SWT*E123456789","message_type":"Response","message_name":"PaymentServiceSelectionRes","json_payload":{"V2G_Message":{"Body":{"PaymentServiceSelectionRes":{"ResponseCode":"OK"}},"Header":{"SessionID":"D24E49E01843440E"}}},"exi_payload":"809802349392780610d103914000"}} to topic Topics.ISO15118_OCPP

The MO root is not mandatory to be used to verify the certificates as we may not have it, so we should try to get the file, but if is not available, we shall move on and proceed

Windows run SECC error: about set "Network_interface = 3"

make run-secc
make[1]: Entering directory 'C:/Users/49641/Desktop/RISE_V2G/iso15118-master_-20_python'
/c/Users/49641/AppData/Local/pypoetry/Cache/virtualenvs/iso15118-Ao1ooyBI-py3.10/Scripts/python iso15118/secc/main.py
DEBUG 2022-07-09 20:12:48,403 - asyncio (626): Using proactor: IocpProactor
INFO 2022-07-09 20:12:51,827 - iso15118.secc.secc_settings (120): Loaded protocols: ['ISO_15118_2', 'ISO_15118_20_AC', 'DIN_SPEC_70121']
INFO 2022-07-09 20:12:51,828 - iso15118.secc.secc_settings (132): Loaded authentication modes: ['PNC', 'EIM']
INFO 2022-07-09 20:12:51,832 - iso15118.shared.exi_codec (168): EXI Codec version: 1.55
INFO 2022-07-09 20:12:51,833 - iso15118.secc.comm_session_handler (196): Communication session handler started

ERROR 2022-07-09 20:12:51,917 - iso15118.shared.utils (51): no interface with this name
Traceback (most recent call last):
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master_-20_python\iso15118\shared\utils.py", line 49, in wait_for_tasks
task.result()
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master_-20_python\iso15118\secc\transport\udp_server.py", line 93, in start
sock=self.create_socket(self.iface),
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master
-20_python\iso15118\secc\transport\udp_server.py", line 75, in _create_socket
interface_idx = socket.if_nametoindex(iface)

OSError: no interface with this name
ERROR 2022-07-09 20:12:51,918 - iso15118.shared.utils (51): '3'
Traceback (most recent call last):
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master_-20_python\iso15118\shared\utils.py", line 49, in wait_for_tasks
task.result()
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master_-20_python\iso15118\secc\transport\tcp_server.py", line 45, in start_no_tls
await self.server_factory(tls=False)
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master_-20_python\iso15118\secc\transport\tcp_server.py", line 92, in server_factory
self.full_ipv6_address = await get_link_local_full_addr(port, self.iface)
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master_-20_python\iso15118\shared\network.py", line 160, in get_link_local_full_addr
ip_address = get_link_local_addr(nic)
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master
-20_python\iso15118\shared\network.py", line 41, in _get_link_local_addr
nic_addr_list = nics_with_addresses[nic]

KeyError: '3'
ERROR 2022-07-09 20:12:51,921 - iso15118.shared.utils (51): '3'
Traceback (most recent call last):
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master_-20_python\iso15118\shared\utils.py", line 49, in wait_for_tasks
task.result()
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master_-20_python\iso15118\secc\transport\tcp_server.py", line 39, in start_tls
await self.server_factory(tls=True)
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master_-20_python\iso15118\secc\transport\tcp_server.py", line 92, in server_factory
self.full_ipv6_address = await get_link_local_full_addr(port, self.iface)
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master_-20_python\iso15118\shared\network.py", line 160, in get_link_local_full_addr
ip_address = get_link_local_addr(nic)
File "C:\Users\49641\Desktop\RISE_V2G\iso15118-master
-20_python\iso15118\shared\network.py", line 41, in _get_link_local_addr
nic_addr_list = nics_with_addresses[nic]
KeyError: '3'

Exception is raised๏ผšCertificateInstallation not yet implemented

ubuntu
python3.9.12

secc:

make[1]: Entering directory '/home/pjdu/test/secc'
/home/pjdu/.cache/pypoetry/virtualenvs/iso15118-dx6qnLxx-py3.9/bin/python3.9 iso15118/secc/main.py
DEBUG 2022-07-15 17:23:48,143 - asyncio (54): Using selector: EpollSelector
INFO 2022-07-15 17:23:49,001 - iso15118.secc.secc_settings (122): Loaded protocols: ['ISO_15118_20_DC', 'DIN_SPEC_70121', 'ISO_15118_20_AC', 'ISO_15118_2']
INFO 2022-07-15 17:23:49,001 - iso15118.secc.secc_settings (134): Loaded authentication modes: ['EIM', 'PNC']
INFO 2022-07-15 17:23:49,002 - iso15118.shared.exi_codec (168): EXI Codec version: 1.55
INFO 2022-07-15 17:23:49,003 - iso15118.secc.comm_session_handler (196): Communication session handler started
INFO 2022-07-15 17:23:49,008 - iso15118.secc.transport.udp_server (110): UDP server socket ready
INFO 2022-07-15 17:23:49,008 - iso15118.secc.transport.udp_server (97): UDP server started at address FF02::1%ens33 and port 15118
INFO 2022-07-15 17:23:49,008 - iso15118.secc.transport.tcp_server (109): TCP server started at address fe80::8753:fc71:5459:2d24%ens33 and port 58579
INFO 2022-07-15 17:23:49,009 - iso15118.secc.transport.tcp_server (109): TLS server started at address fe80::8753:fc71:5459:2d24%ens33 and port 52289
DEBUG 2022-07-15 17:23:56,203 - iso15118.secc.transport.udp_server (125): Message received from ('fe80::13c8:21ed:fda2:fe5d', 58252, 0, 2): 01fe9000000000021000
DEBUG 2022-07-15 17:23:56,203 - iso15118.secc.comm_session_handler (280): SDPRequest received: [Security: NO_TLS, Protocol: TCP]
DEBUG 2022-07-15 17:23:56,204 - iso15118.secc.comm_session_handler (320): Sending SDPResponse: [ IP address: fe80::8753:fc71:5459:2d24, Port: 58579 , Security: NO_TLS , Transport: TCP ]
DEBUG 2022-07-15 17:23:56,208 - iso15118.secc.comm_session_handler (221): TCP client connected, client address is ('fe80::13c8:21ed:fda2:fe5d', 45292, 0, 2).
INFO 2022-07-15 17:23:56,212 - iso15118.shared.comm_session (325): Starting a new communication session
INFO 2022-07-15 17:23:56,212 - iso15118.shared.states (120): Entered state SupportedAppProtocol
INFO 2022-07-15 17:23:56,212 - iso15118.shared.states (124): Waiting for up to 20.0 s
DEBUG 2022-07-15 17:23:56,324 - iso15118.shared.exi_codec (306): Decoded message:
{'supportedAppProtocolReq': {'AppProtocol': [{'ProtocolNamespace': 'urn:iso:std:iso:15118:-20:AC', 'VersionNumberMajor': 1, 'VersionNumberMinor': 0, 'SchemaID': 1, 'Priority': 1}, {'ProtocolNamespace': 'urn:iso:15118:2:2013:MsgDef', 'VersionNumberMajor': 2, 'VersionNumberMinor': 0, 'SchemaID': 2, 'Priority': 2}, {'ProtocolNamespace': 'urn:din:70121:2012:MsgDef', 'VersionNumberMajor': 2, 'VersionNumberMinor': 0, 'SchemaID': 3, 'Priority': 3}]}}
XSD namespace: urn:iso:15118:2:2010:AppProtocol
INFO 2022-07-15 17:23:56,325 - iso15118.shared.comm_session (215): supportedAppProtocolReq received
DEBUG 2022-07-15 17:23:56,325 - iso15118.shared.exi_codec (239): Message to encode:
{"supportedAppProtocolRes": {"ResponseCode": "OK_SuccessfulNegotiation", "SchemaID": 1}}
XSD namespace: urn:iso:15118:2:2010:AppProtocol
DEBUG 2022-07-15 17:23:56,348 - iso15118.secc.states.sap_states (145): Chosen protocol: ISO_15118_20_AC
INFO 2022-07-15 17:23:56,349 - iso15118.shared.comm_session (396): Sending supportedAppProtocolRes
INFO 2022-07-15 17:23:56,349 - iso15118.shared.states (120): Entered state SessionSetup
INFO 2022-07-15 17:23:56,349 - iso15118.shared.states (124): Waiting for up to 20.0 s
DEBUG 2022-07-15 17:23:56,658 - iso15118.shared.exi_codec (306): Decoded message:
{'SessionSetupReq': {'Header': {'SessionID': '00', 'TimeStamp': 1657877036}, 'EVCCID': 'WMIV1234567890ABCDEX'}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
INFO 2022-07-15 17:23:56,658 - iso15118.shared.comm_session (215): SessionSetupReq received
DEBUG 2022-07-15 17:23:56,659 - iso15118.shared.exi_codec (239): Message to encode:
{"SessionSetupRes": {"Header": {"SessionID": "4D6A2E6329622887", "TimeStamp": 1657877036}, "ResponseCode": "OK_NewSessionEstablished", "EVSEID": "UK123E1234"}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
INFO 2022-07-15 17:23:56,715 - iso15118.shared.comm_session (396): Sending SessionSetupRes
INFO 2022-07-15 17:23:56,715 - iso15118.shared.states (120): Entered state AuthorizationSetup
INFO 2022-07-15 17:23:56,715 - iso15118.shared.states (124): Waiting for up to 20.0 s
DEBUG 2022-07-15 17:23:56,862 - iso15118.shared.exi_codec (306): Decoded message:
{'AuthorizationSetupReq': {'Header': {'SessionID': '4D6A2E6329622887', 'TimeStamp': 1657877036}}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
INFO 2022-07-15 17:23:56,862 - iso15118.shared.comm_session (215): AuthorizationSetupReq received
DEBUG 2022-07-15 17:23:56,863 - iso15118.shared.exi_codec (239): Message to encode:
{"AuthorizationSetupRes": {"Header": {"SessionID": "4D6A2E6329622887", "TimeStamp": 1657877036}, "ResponseCode": "OK", "AuthorizationServices": ["PnC", "EIM"], "CertificateInstallationService": true, "PnC_ASResAuthorizationMode": {"GenChallenge": "3TirrI7jQe/KZOnrFyiEIg=="}}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
INFO 2022-07-15 17:23:56,905 - iso15118.shared.comm_session (396): Sending AuthorizationSetupRes
DEBUG 2022-07-15 17:23:57,131 - iso15118.shared.exi_codec (306): Decoded message:
{'CertificateInstallationReq': {'Header': {'SessionID': '4D6A2E6329622887', 'TimeStamp': 1657877036, 'Signature': {'SignedInfo': {'CanonicalizationMethod': {'Algorithm': 'http://www.w3.org/TR/canonical-exi/'}, 'SignatureMethod': {'Algorithm': 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256'}, 'Reference': [{'URI': '#id1', 'Transforms': {'Transform': [{'Algorithm': 'http://www.w3.org/TR/canonical-exi/'}]}, 'DigestMethod': {'Algorithm': 'http://www.w3.org/2001/04/xmlenc#sha256'}, 'DigestValue': b'%\x1dVh\xef}P\x98\x8a\xde\xac\xb7\x1f%\x1c\x13{R\x96:L\xad{Uw\x07\x1a\xa8\xaf\xc3\xa9\x9a'}]}, 'SignatureValue': {'value': b'\xc6!\x95\x81\xe3Lvk*\x0b\x15%W5\xd0Q\xf0<\xa2-\xe39X\x0b\x12\x07w6\xce-\x19\x05\x84\x80\x17o:\xac\xc6\xceh\xd2S\xdf\xf9s2\xd8\xd5\xcc\xf5\x19c\xfak\xd4D\xf0D\x1a\xedJ\x9b\xb7'}}}, 'OEMProvisioningCertificateChain': {'Id': 'id1', 'Certificate': b"0\x82\x01\xbe0\x82\x01e\xa0\x03\x02\x01\x02\x02\x020@0\n\x06\x08*\x86H\xce=\x04\x03\x020G1\x120\x10\x06\x03U\x04\x03\x0c\tOEMSubCA21\x0f0\r\x06\x03U\x04\n\x0c\x06Switch1\x0b0\t\x06\x03U\x04\x06\x13\x02UK1\x130\x11\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x03OEM0\x1e\x17\r220715085748Z\x17\r260714085748Z0I1\x140\x12\x06\x03U\x04\x03\x0c\x0bOEMProvCert1\x0f0\r\x06\x03U\x04\n\x0c\x06Switch1\x0b0\t\x06\x03U\x04\x06\x13\x02UK1\x130\x11\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x03OEM0Y0\x13\x06\x07*\x86H\xce=\x02\x01\x06\x08*\x86H\xce=\x03\x01\x07\x03B\x00\x04[o\xe7\xde\xf9kH\xa2[\xeeu_:J\x06j9w\x0b \xec\xe1\xb5\x85\xcb7\xb2\xc9\xf3\x87\xbcY\x1b\x96\xef\xd1r=R\xe3\xa0\x87\xc31\x8d\x81\xea\xfd\xad\xbf\x10\xa2\x1d\xd6)\x84&\x04\xa7\xe6\t\x90\xa3?0=0\x0c\x06\x03U\x1d\x13\x01\x01\xff\x04\x020\x000\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x03\x880\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14ex\xef\x92\xad\xaa\x1au\x95\xe2\xd4\x06[Cg\x12u\xe97\x1d0\n\x06\x08*\x86H\xce=\x04\x03\x02\x03G\x000D\x02 P\xed%\x12\x12U\xb3\xfd2H\xb4%:\xe5\xd0%\x7f\x1b\x1cA\x00\x9c\xa6\xbd;]\x8e~\xb2\x19M\xb6\x02 \x1a'&#\xd8\xb8E\x7f\xc7\xa2\x1f\x8a\x9d\x8c\x02S\x04\xd0M\xbb\xf9\xcd\x0c&\x11\x85\xf8&\x91\xc3\xc53", 'SubCertificates': {'Certificate': [b"0\x82\x01\xc30\x82\x01i\xa0\x03\x02\x01\x02\x02\x020?0\n\x06\x08*\x86H\xce=\x04\x03\x020G1\x120\x10\x06\x03U\x04\x03\x0c\tOEMSubCA11\x0f0\r\x06\x03U\x04\n\x0c\x06Switch1\x0b0\t\x06\x03U\x04\x06\x13\x02UK1\x130\x11\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x03OEM0\x1e\x17\r220715085748Z\x17\r260714085748Z0G1\x120\x10\x06\x03U\x04\x03\x0c\tOEMSubCA21\x0f0\r\x06\x03U\x04\n\x0c\x06Switch1\x0b0\t\x06\x03U\x04\x06\x13\x02UK1\x130\x11\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x03OEM0Y0\x13\x06\x07*\x86H\xce=\x02\x01\x06\x08*\x86H\xce=\x03\x01\x07\x03B\x00\x04\xa2\xca>I\xb68\t\x06K\x8f2\xaf\xdd\x1eo|\xdf\x0c\xb5\xbc\xe3\xb72\xcc\x1b_\x1f+6\x07\xd0\x17*\x96\xf4\xc3uV\xf7\xb4p\xa5}\xd2\xdaO\xea\xf5\xf4o\x91W!\x16\xcd\x1b\xf8#\xdb\xe2zz\xec\xa3E0C0\x12\x06\x03U\x1d\x13\x01\x01\xff\x04\x080\x06\x01\x01\xff\x02\x01\x000\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\x060\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xe0\x06\n\x12i\xdc\t]\x93H\xed\xc2>>\x0e\x86'\xbcc\xba0\n\x06\x08*\x86H\xce=\x04\x03\x02\x03H\x000E\x02!\x00\xb7\x02R\xd8\xa5/\xc9h\xc86\t*\x1b\x1e\x10\x82\xdd\xe9h\x08'4\x7f\xb7IDwT\x8d\xfe\xa4y\x02 \x17\x95.\xb4\xca\x16\x85\xf8\xd7J1\xee\xd6\xbe\x89\xe1\xd1\xe9\xd2\xf8(7\xb0\xef\x10\xb2\xfbd\x92B\xfb\xd5", b'0\x82\x01\xc20\x82\x01i\xa0\x03\x02\x01\x02\x02\x020>0\n\x06\x08*\x86H\xce=\x04\x03\x020G1\x120\x10\x06\x03U\x04\x03\x0c\tOEMRootCA1\x0f0\r\x06\x03U\x04\n\x0c\x06Switch1\x0b0\t\x06\x03U\x04\x06\x13\x02UK1\x130\x11\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x03OEM0\x1e\x17\r220715085748Z\x17\r260714085748Z0G1\x120\x10\x06\x03U\x04\x03\x0c\tOEMSubCA11\x0f0\r\x06\x03U\x04\n\x0c\x06Switch1\x0b0\t\x06\x03U\x04\x06\x13\x02UK1\x130\x11\x06\n\t\x92&\x89\x93\xf2,d\x01\x19\x16\x03OEM0Y0\x13\x06\x07*\x86H\xce=\x02\x01\x06\x08*\x86H\xce=\x03\x01\x07\x03B\x00\x04\x1d\xf2\xf7\\x08\x0b\xea[b\x86?+\x08\x9am\xc4\xc6\xbe\x8bet\x85\xa5\xba5\x86l%=\xdd/O\xb7\xf8\xfa\x1e\x96\xb1\xdaC\x9d\x8f)\x16\xb5u\xc6]\xf6\xae\xf5\xd1.\xb1\x82\xb9xx\xea\x9a\xc7\xbf\x1d\xa3E0C0\x12\x06\x03U\x1d\x13\x01\x01\xff\x04\x080\x06\x01\x01\xff\x02\x01\x010\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x01\x060\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xeb\xee\xf4\x16\x95s,\x91\x18\xcd,\x89\xc9wY\n.aO\x050\n\x06\x08*\x86H\xce=\x04\x03\x02\x03G\x000D\x02 [%,g\xf2\x82@\xbd\xcd\x9c\x06\xa5\x11haqU\xc0\xd4\xd4\x80\x19\x11*\xa2\x8d\xfd\xb3\xda\xe4\xa9\xd3\x02 r\x8d\xfau?\xa8\x10\xdb\x01\xdb\xe36%\xd5\xae\x1c]\xf7\xf1\x9a\xfe\xf6\x13\x12\r\xba33\x122I]']}}, 'ListOfRootCertificateIDs': {'RootCertificateID': [{'X509IssuerName': '<Name(CN=V2GRootCA,O=Switch,C=UK,DC=V2G)>', 'X509SerialNumber': 12345}]}, 'MaximumContractCertificateChains': 3}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
INFO 2022-07-15 17:23:57,135 - iso15118.shared.comm_session (215): CertificateInstallationReq received
INFO 2022-07-15 17:23:57,135 - iso15118.shared.states (120): Entered state CertificateInstallation
INFO 2022-07-15 17:23:57,135 - iso15118.shared.states (124): Waiting for up to 20.0 s
ERROR 2022-07-15 17:23:57,135 - iso15118.shared.utils (51): CertificateInstallation not yet implemented
Traceback (most recent call last):
File "/home/pjdu/test/secc/iso15118/shared/utils.py", line 49, in wait_for_tasks
task.result()
File "/home/pjdu/test/secc/iso15118/shared/comm_session.py", line 461, in rcv_loop
await self.process_message(message)
File "/home/pjdu/test/secc/iso15118/shared/comm_session.py", line 216, in process_message
await self.current_state.process_message(decoded_message)
File "/home/pjdu/test/secc/iso15118/secc/states/iso15118_20_states.py", line 215, in process_message
await CertificateInstallation(self.comm_session).process_message(message)
File "/home/pjdu/test/secc/iso15118/secc/states/iso15118_20_states.py", line 292, in process_message
raise NotImplementedError("CertificateInstallation not yet implemented")
NotImplementedError: CertificateInstallation not yet implemented

evcc:
make[1]: Entering directory '/home/pjdu/test/iso15118'
/home/pjdu/.cache/pypoetry/virtualenvs/iso15118-3bv2eSiN-py3.9/bin/python3.9 iso15118/evcc/main.py
DEBUG 2022-07-15 02:23:55,173 - asyncio (54): Using selector: EpollSelector
INFO 2022-07-15 02:23:56,021 - iso15118.shared.exi_codec (168): EXI Codec version: 1.55
INFO 2022-07-15 02:23:56,021 - iso15118.evcc.comm_session_handler (295): Communication session handler started
DEBUG 2022-07-15 02:23:56,021 - iso15118.evcc.comm_session_handler (374): Initiating new SDP cycle, 0 more cycles(s) left
DEBUG 2022-07-15 02:23:56,021 - iso15118.evcc.comm_session_handler (380): Remaining SDP requests: 50
DEBUG 2022-07-15 02:23:56,021 - iso15118.evcc.transport.udp_client (90): UDP client socket ready
DEBUG 2022-07-15 02:23:56,122 - iso15118.evcc.comm_session_handler (317): Sending SDPRequest: [Security: NO_TLS, Protocol: TCP]
DEBUG 2022-07-15 02:23:56,122 - iso15118.evcc.transport.udp_client (170): Message sent: [Header = [0x1, 0xfe, 0x9000, 2], Payload = 1000)]
INFO 2022-07-15 02:23:56,124 - iso15118.evcc.transport.udp_client (105): Received datagram from UDP server at address ('fe80::8753:fc71:5459:2d24', 15118, 0, 2)
DEBUG 2022-07-15 02:23:56,125 - iso15118.evcc.comm_session_handler (462): SDPResponse received: [ IP address: fe80::8753:fc71:5459:2d24, Port: 58579 , Security: NO_TLS , Transport: TCP ]
DEBUG 2022-07-15 02:23:56,125 - iso15118.evcc.comm_session_handler (398): Starting TCP client, trying to connect to fe80::8753:fc71:5459:2d24 at port 58579 ...
DEBUG 2022-07-15 02:23:56,127 - iso15118.evcc.comm_session_handler (405): TCP client connected
INFO 2022-07-15 02:23:56,146 - iso15118.shared.comm_session (325): Starting a new communication session
INFO 2022-07-15 02:23:56,146 - iso15118.shared.states (120): Entered state SupportedAppProtocol
INFO 2022-07-15 02:23:56,146 - iso15118.shared.states (124): Waiting for up to 2.0 s
DEBUG 2022-07-15 02:23:56,147 - iso15118.shared.exi_codec (239): Message to encode:
{"supportedAppProtocolReq": {"AppProtocol": [{"ProtocolNamespace": "urn:iso:std:iso:15118:-20:AC", "VersionNumberMajor": 1, "VersionNumberMinor": 0, "SchemaID": 1, "Priority": 1}, {"ProtocolNamespace": "urn:iso:15118:2:2013:MsgDef", "VersionNumberMajor": 2, "VersionNumberMinor": 0, "SchemaID": 2, "Priority": 2}, {"ProtocolNamespace": "urn:din:70121:2012:MsgDef", "VersionNumberMajor": 2, "VersionNumberMinor": 0, "SchemaID": 3, "Priority": 3}]}}
XSD namespace: urn:iso:15118:2:2010:AppProtocol
INFO 2022-07-15 02:23:56,181 - iso15118.shared.comm_session (396): Sending supportedAppProtocolReq
DEBUG 2022-07-15 02:23:56,324 - iso15118.shared.exi_codec (306): Decoded message:
{'supportedAppProtocolRes': {'ResponseCode': 'OK_SuccessfulNegotiation', 'SchemaID': 1}}
XSD namespace: urn:iso:15118:2:2010:AppProtocol
INFO 2022-07-15 02:23:56,324 - iso15118.shared.comm_session (215): supportedAppProtocolRes received
DEBUG 2022-07-15 02:23:56,324 - iso15118.evcc.states.sap_states (141): Chosen protocol: ISO_15118_20_AC
DEBUG 2022-07-15 02:23:56,325 - iso15118.shared.exi_codec (239): Message to encode:
{"SessionSetupReq": {"Header": {"SessionID": "00", "TimeStamp": 1657877036}, "EVCCID": "WMIV1234567890ABCDEX"}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
INFO 2022-07-15 02:23:56,457 - iso15118.shared.comm_session (396): Sending SessionSetupReq
INFO 2022-07-15 02:23:56,457 - iso15118.shared.states (120): Entered state SessionSetup
INFO 2022-07-15 02:23:56,457 - iso15118.shared.states (124): Waiting for up to 20.0 s
DEBUG 2022-07-15 02:23:56,690 - iso15118.shared.exi_codec (306): Decoded message:
{'SessionSetupRes': {'Header': {'SessionID': '4D6A2E6329622887', 'TimeStamp': 1657877036}, 'ResponseCode': 'OK_NewSessionEstablished', 'EVSEID': 'UK123E1234'}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
INFO 2022-07-15 02:23:56,690 - iso15118.shared.comm_session (215): SessionSetupRes received
DEBUG 2022-07-15 02:23:56,690 - iso15118.shared.exi_codec (239): Message to encode:
{"AuthorizationSetupReq": {"Header": {"SessionID": "4D6A2E6329622887", "TimeStamp": 1657877036}}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
INFO 2022-07-15 02:23:56,735 - iso15118.shared.comm_session (396): Sending AuthorizationSetupReq
INFO 2022-07-15 02:23:56,735 - iso15118.shared.states (120): Entered state AuthorizationSetup
INFO 2022-07-15 02:23:56,735 - iso15118.shared.states (124): Waiting for up to 2.0 s
DEBUG 2022-07-15 02:23:56,869 - iso15118.shared.exi_codec (306): Decoded message:
{'AuthorizationSetupRes': {'Header': {'SessionID': '4D6A2E6329622887', 'TimeStamp': 1657877036}, 'ResponseCode': 'OK', 'AuthorizationServices': ['PnC', 'EIM'], 'CertificateInstallationService': True, 'PnC_ASResAuthorizationMode': {'GenChallenge': b'\xdd8\xab\xac\x8e\xe3A\xef\xcad\xe9\xeb\x17(\x84"'}}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
INFO 2022-07-15 02:23:56,870 - iso15118.shared.comm_session (215): AuthorizationSetupRes received
DEBUG 2022-07-15 02:23:56,871 - iso15118.shared.exi_codec (239): Message to encode:
{"OEMProvisioningCertificateChain": {"Id": "id1", "Certificate": "MIIBvjCCAWWgAwIBAgICMEAwCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNU3ViQ0EyMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMDcxNTA4NTc0OFoXDTI2MDcxNDA4NTc0OFowSTEUMBIGA1UEAwwLT0VNUHJvdkNlcnQxDzANBgNVBAoMBlN3aXRjaDELMAkGA1UEBhMCVUsxEzARBgoJkiaJk/IsZAEZFgNPRU0wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARbb+fe+WtIolvudV86SgZqOXcLIOzhtYXLN7LJ84e8WRuW79FyPX5S46CHwzGNgepg/a2/EKId1imEJgSn5gmQoz8wPTAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIDiDAdBgNVHQ4EFgQUZXjvkq2qGnWV4tQGW0NnEnXpNx0wCgYIKoZIzj0EAwIDRwAwRAIgUO0lEhJVs/0ySLQlOuXQJX8bHEEAnKa9O12OfrIZTbYCIBonJiPYuEV/x6Ifip2MAlME0E27+c0MJhGF+CaRw8Uz", "SubCertificates": {"Certificate": ["MIIBwzCCAWmgAwIBAgICMD8wCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNU3ViQ0ExMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMDcxNTA4NTc0OFoXDTI2MDcxNDA4NTc0OFowRzESMBAGA1UEAwwJT0VNU3ViQ0EyMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoso+SbY4CQZLjzKv3R5vfN8MtbzjtzLMG18fKzYH0BcqlvTDdVb3tHClfdLaT+r19G+RVyEWzWAb+CPb4np67KNFMEMwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFOAGChJp3Aldk0jtwj4+DoYnvGO6MAoGCCqGSM49BAMCA0gAMEUCIQC3AlLYpS/JaMg2CSobHhCC3eloCCc0f7dJRHdUjf6keQIgF5UutMoWhfjXSjHu1r6J4dHp0vgoN7DvELL7ZJJC+9U=", "MIIBwjCCAWmgAwIBAgICMD4wCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNUm9vdENBMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMDcxNTA4NTc0OFoXDTI2MDcxNDA4NTc0OFowRzESMBAGA1UEAwwJT0VNU3ViQ0ExMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHfL3XAgL6ltihj8rCJptxMa+i2V0haW6NYZsJT3dL0+3+PoelrHaQ52PKRa1dcZd9q710S6xgrl4eOqax78dfqNFMEMwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFOvu9BaVcyyRGM0sicl3WQouYU8FMAoGCCqGSM49BAMCA0cAMEQCIFslLGfygkC9zZwGpRFoYXFVwNTUgBkRKqKN/bPa5KnTAiByjfp1P6gQ2wHb4zYl1a4cXffxmv72ExINujMzEjJJXQ=="]}}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
DEBUG 2022-07-15 02:23:56,916 - iso15118.shared.exi_codec (239): Message to encode:
{"SignedInfo": {"CanonicalizationMethod": {"Algorithm": "http://www.w3.org/TR/canonical-exi/"}, "SignatureMethod": {"Algorithm": "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"}, "Reference": [{"Transforms": {"Transform": [{"Algorithm": "http://www.w3.org/TR/canonical-exi/"}]}, "DigestMethod": {"Algorithm": "http://www.w3.org/2001/04/xmlenc#sha256"}, "DigestValue": "JR1WaO99UJiK3qy3HyUcE3tSljpMrXtVdwcaqK/DqZo=", "URI": "#id1"}]}}
XSD namespace: http://www.w3.org/2000/09/xmldsig#
DEBUG 2022-07-15 02:23:56,959 - iso15118.shared.exi_codec (239): Message to encode:
{"CertificateInstallationReq": {"Header": {"SessionID": "4D6A2E6329622887", "TimeStamp": 1657877036, "Signature": {"SignedInfo": {"CanonicalizationMethod": {"Algorithm": "http://www.w3.org/TR/canonical-exi/"}, "SignatureMethod": {"Algorithm": "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"}, "Reference": [{"Transforms": {"Transform": [{"Algorithm": "http://www.w3.org/TR/canonical-exi/"}]}, "DigestMethod": {"Algorithm": "http://www.w3.org/2001/04/xmlenc#sha256"}, "DigestValue": "JR1WaO99UJiK3qy3HyUcE3tSljpMrXtVdwcaqK/DqZo=", "URI": "#id1"}]}, "SignatureValue": {"value": "xiGVgeNMdmsqCxUlVzXQUfA8oi3jOVgLEgd3Ns4tGQWEgBdvOqzGzmjSU9/5czLY1cz1GWP6a9RE8EQa7Uqbtw=="}}}, "OEMProvisioningCertificateChain": {"Id": "id1", "Certificate": "MIIBvjCCAWWgAwIBAgICMEAwCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNU3ViQ0EyMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMDcxNTA4NTc0OFoXDTI2MDcxNDA4NTc0OFowSTEUMBIGA1UEAwwLT0VNUHJvdkNlcnQxDzANBgNVBAoMBlN3aXRjaDELMAkGA1UEBhMCVUsxEzARBgoJkiaJk/IsZAEZFgNPRU0wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARbb+fe+WtIolvudV86SgZqOXcLIOzhtYXLN7LJ84e8WRuW79FyPX5S46CHwzGNgepg/a2/EKId1imEJgSn5gmQoz8wPTAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIDiDAdBgNVHQ4EFgQUZXjvkq2qGnWV4tQGW0NnEnXpNx0wCgYIKoZIzj0EAwIDRwAwRAIgUO0lEhJVs/0ySLQlOuXQJX8bHEEAnKa9O12OfrIZTbYCIBonJiPYuEV/x6Ifip2MAlME0E27+c0MJhGF+CaRw8Uz", "SubCertificates": {"Certificate": ["MIIBwzCCAWmgAwIBAgICMD8wCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNU3ViQ0ExMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMDcxNTA4NTc0OFoXDTI2MDcxNDA4NTc0OFowRzESMBAGA1UEAwwJT0VNU3ViQ0EyMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoso+SbY4CQZLjzKv3R5vfN8MtbzjtzLMG18fKzYH0BcqlvTDdVb3tHClfdLaT+r19G+RVyEWzWAb+CPb4np67KNFMEMwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFOAGChJp3Aldk0jtwj4+DoYnvGO6MAoGCCqGSM49BAMCA0gAMEUCIQC3AlLYpS/JaMg2CSobHhCC3eloCCc0f7dJRHdUjf6keQIgF5UutMoWhfjXSjHu1r6J4dHp0vgoN7DvELL7ZJJC+9U=", "MIIBwjCCAWmgAwIBAgICMD4wCgYIKoZIzj0EAwIwRzESMBAGA1UEAwwJT0VNUm9vdENBMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMB4XDTIyMDcxNTA4NTc0OFoXDTI2MDcxNDA4NTc0OFowRzESMBAGA1UEAwwJT0VNU3ViQ0ExMQ8wDQYDVQQKDAZTd2l0Y2gxCzAJBgNVBAYTAlVLMRMwEQYKCZImiZPyLGQBGRYDT0VNMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHfL3XAgL6ltihj8rCJptxMa+i2V0haW6NYZsJT3dL0+3+PoelrHaQ52PKRa1dcZd9q710S6xgrl4eOqax78dfqNFMEMwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFOvu9BaVcyyRGM0sicl3WQouYU8FMAoGCCqGSM49BAMCA0cAMEQCIFslLGfygkC9zZwGpRFoYXFVwNTUgBkRKqKN/bPa5KnTAiByjfp1P6gQ2wHb4zYl1a4cXffxmv72ExINujMzEjJJXQ=="]}}, "ListOfRootCertificateIDs": {"RootCertificateID": [{"X509IssuerName": "<Name(CN=V2GRootCA,O=Switch,C=UK,DC=V2G)>", "X509SerialNumber": 12345}]}, "MaximumContractCertificateChains": 3}}
XSD namespace: urn:iso:std:iso:15118:-20:CommonMessages
INFO 2022-07-15 02:23:57,005 - iso15118.shared.comm_session (396): Sending CertificateInstallationReq
INFO 2022-07-15 02:23:57,005 - iso15118.shared.states (120): Entered state CertificateInstallation
INFO 2022-07-15 02:23:57,005 - iso15118.shared.states (124): Waiting for up to 5.0 s
INFO 2022-07-15 02:24:02,011 - iso15118.shared.comm_session (371): The data link will Terminate in 2 seconds and the TCP connection will close in 5 seconds.
INFO 2022-07-15 02:24:02,012 - iso15118.shared.comm_session (375): Reason: TimeoutError occurred. Waited for 5.0 s after sending last message: [Header = [0x1, 0xfe, 0x8001, 1708], Payload = 801c0426b5173194b114438ace4c496060a25687474703a2f2f7777772e77332e6f72672f54522f63616e6f6e6963616c2d6578692f435687474703a2f2f7777772e77332e6f72672f323030312f30342f786d6c647369672d6d6f72652365636473612d736861323536440c46d2c86204ad0e8e8e0745e5eeeeeee5cee665cdee4ce5ea8a45ec6c2dcdedcd2c6c2d85acaf0d25e90a5a1d1d1c0e8bcbddddddcb9dcccb9bdc99cbcc8c0c0c4bcc0d0bde1b5b195b98c8dcda184c8d4d9080947559a3bdf542622b7ab2dc7c94704ded4a58e932b5ed55dc1c6aa2bf0ea6684a06310cac0f1a63b3595058a92ab9ae828f81e5116f19cac058903bb9b67168c82c2400bb79d566367346929effcb9996c6ae67a8cb1fd35ea2278220d76a54ddba00ad2c8626101984100df184100b2d0018100810101182018050304154324671e8201811823988918080301aa82018604a7a2a6a9bab121a099188798068301aa8205060329bbb4ba31b4188598048301aa820309812aa598899808830504c91344c9f91632008c8b01a7a2a6980f0b869919181b989a981c1a9b9a1c2d0b86991b181b989a181c1a9b9a1c2d1824988a18090301aa82018605a7a2a6a83937bb21b2b93a188798068301aa8205060329bbb4ba31b4188598048301aa820309812aa598899808830504c91344c9f91632008c8b01a7a2a6982c98098303954324671e81008304154324671e81808381a100022db7f3ef7cb5a4512df73aaf9d2503351cbb85907670dac2e59bd964f9c3de2c8dcb77e8b91ebf2971d043e198c6c0f5307ed6df88510eeb14c2130253f304c8519f981e98060301aa8e898080ff8201180018070301aa8e878080ff8202018101c4180e8301aa8e87020b020a32bc77c956d50d3acaf16a032da1b3893af49b8e98050304154324671e82018101a3801822011028769289092ad9fe99245a129d72e812bf8d8e20804e535e9daec73f590ca6db01100d139311ec5c22bfe3d10fc54ec60129826826ddfce6861308c2fc1348e1e299831c0cc208070cc20805a6800c0804080808c0fcc0281820aa192338f4100c08c11cc448c040180d54100c30253d15354dd5890d04c4c43cc034180d54102830194ddda5d18da0c42cc024180d5410184c09552cc44cc044182826489a264fc8b1900464580d3d1534c0785c34c8c8c0dcc4d4c0e0d4dcd0e1685c34c8d8c0dcc4d0c0e0d4dcd0e168c11cc448c040180d54100c30253d15354dd5890d04c8c43cc034180d54102830194ddda5d18da0c42cc024180d5410184c09552cc44cc044182826489a264fc8b1900464580d3d1534c164c04c181caa192338f408041820aa192338f40c041c0d0800128b28f926d8e024192e3ccabf7479bdf37c32d6f38edccb306d7c7cacd81f405caa5bd30dd55bded1c295f74b693fabd7d1be455c845b35806fe08f6f89e9ebb28d14c10cc048180d54744c0407fc1020c0180407fc080400c038180d54743c0407fc10100c080418c074180d5474381058105380182849a77025764d23b708f8f83a189ef18ee8c0281820aa192338f4100c080d2000c114088402dc094b6294bf25a320d824a86c78420b77a5a0209cd1fedd2511dd5237fa91e408805e54bad3285a17e35d28c7bb5afa278747a74be0a0dec3bc42cbed92490bef543180cc2080708c20805a6800c0804080808c0f8c0281820aa192338f4100c08c11cc448c040180d54100c30253d153549bdbdd10d04c43cc034180d54102830194ddda5d18da0c42cc024180d5410184c09552cc44cc044182826489a264fc8b1900464580d3d1534c0785c34c8c8c0dcc4d4c0e0d4dcd0e1685c34c8d8c0dcc4d0c0e0d4dcd0e168c11cc448c040180d54100c30253d15354dd5890d04c4c43cc034180d54102830194ddda5d18da0c42cc024180d5410184c09552cc44cc044182826489a264fc8b1900464580d3d1534c164c04c181caa192338f408041820aa192338f40c041c0d08001077cbdd70202fa96d8a18fcac2269b7131afa2d95d21696e8d619b094f774bd3edfe3e87a5ac7690e763ca45ad5d71977dabbd744bac60ae5e1e3aa6b1efc75fa8d14c10cc048180d54744c0407fc1020c0180407fc080404c038180d54743c0407fc10100c080418c074180d54743810581053afbbd05a55ccb2446334b22725dd6428b9853c14c0281820aa192338f4100c080d1c00c11008816c94b19fca0902f736701a9445a185c557035352006444aa8a37f6cf6b92a74c0881ca37e9d4fea0436c076f8cd89756b87177dfc66bfbd84c4836e8cccc48c9257480acf13985b594a10d38f558c91d49bdbdd10d04b13cf54ddda5d18da0b10cf5552cb1110cf558c91ca4f82e58040320)]
INFO 2022-07-15 02:24:04,014 - iso15118.shared.comm_session (380): Terminated the data link
INFO 2022-07-15 02:24:07,018 - iso15118.shared.comm_session (384): TCP connection closed to peer with address ('fe80::8753:fc71:5459:2d24', 58579, 0, 2)
ERROR 2022-07-15 02:24:07,018 - iso15118.evcc.comm_session_handler (544): EVCC tried to initiate a V2GCommunicationSession, but maximum number of SDP retry cycles (1) is now reached. Shutting down high-level communication. Unplug and plug in the cable again if you want to start anew.
Traceback (most recent call last):
File "/home/pjdu/test/iso15118/iso15118/evcc/comm_session_handler.py", line 542, in get_from_rcv_queue
await self.restart_sdp(True)
File "/home/pjdu/test/iso15118/iso15118/evcc/comm_session_handler.py", line 366, in restart_sdp
raise SDPFailedError(
iso15118.shared.exceptions.SDPFailedError: EVCC tried to initiate a V2GCommunicationSession, but maximum number of SDP retry cycles (1) is now reached. Shutting down high-level communication. Unplug and plug in the cable again if you want to start anew.

EVCC AC charge

Hi,
I'm testing iso15118 EVCC but it seems that it only works in DC mode.
I cannot find documentation explaining how to set the EVCC to work in AC mode.
If I setup the SECC to work only in AC mode then the EVCC stops in early phases.
If I setup the SECC to work in both AC/DC mode then the EVCC simulator goes on in DC mode.

Can you help please?
Thanks
Lucio

SesionStop Request after CableCheckState

Hi
I tried the code with 2 different cars. I got stuck in many places and overcame them by reasoning and making small value changes in code. One of the vehicles is the Peugeot e2008 and the other is the Seres 3.

I was able to reach the Precharge request and response sections with the Peugeot tool. Since I don't have a power source to provide the 395 V 2A the car requires for pre-charge, the request-response cycle continues at this stage and this is very normal.

The problem is that Seres3 sends session stop request instead of Precharge request after wire check status. I have tried changing many values in the simulation.py file but the result is always the same.

Below are the logs I got from the terminal screen. Peugeot switches to Precharge phase even if the charging parameters are incorrect. I could not understand why the Seres3 model vehicle terminated the session. Normally, the vehicle can be charged at DC charging stations without any problems.

Logs from Peugeot e2008 session:

INFO    2022-12-09 15:06:10,537 - iso15118.secc.comm_session_handler (328): SDPRequest received: [Security: NO_TLS, Protocol: TCP]
INFO    2022-12-09 15:06:10,538 - iso15118.secc.comm_session_handler (368): Sending SDPResponse: [ IP address: fe80::7e5d:5d24:76d4:ad5, Port: 55096 , Security: NO_TLS , Transport: TCP ]
INFO    2022-12-09 15:06:10,639 - iso15118.secc.comm_session_handler (263): TCP client connected, client address is ('fe80::218:87ff:fe02:e807', 49154, 0, 2).
INFO    2022-12-09 15:06:10,639 - iso15118.shared.comm_session (344): Starting a new communication session
INFO    2022-12-09 15:06:10,639 - iso15118.shared.states (137): Entered state SupportedAppProtocol
INFO    2022-12-09 15:06:10,657 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolReq":{"AppProtocol":[{"ProtocolNamespace":"urn:din:70121:2012:MsgDef","VersionNumberMajor":2,"VersionNumberMinor":0,"SchemaID":1,"Priority":1}]}}
INFO    2022-12-09 15:06:10,658 - iso15118.shared.comm_session (234): supportedAppProtocolReq received
INFO    2022-12-09 15:06:10,659 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolRes": {"ResponseCode": "OK_SuccessfulNegotiation", "SchemaID": 1}}
INFO    2022-12-09 15:06:10,664 - iso15118.secc.states.sap_states (146): Chosen protocol: DIN_SPEC_70121
INFO    2022-12-09 15:06:10,664 - iso15118.shared.comm_session (420): Sending supportedAppProtocolRes
INFO    2022-12-09 15:06:10,665 - iso15118.shared.states (137): Entered state SessionSetup
INFO    2022-12-09 15:06:10,822 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"00"},"Body":{"SessionSetupReq":{"EVCCID":"00188702E807"}}}}
INFO    2022-12-09 15:06:10,823 - iso15118.shared.comm_session (234): SessionSetupReq received
INFO    2022-12-09 15:06:10,824 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"SessionSetupRes": {"ResponseCode": "OK_NewSessionEstablished", "EVSEID": "49A89A6360", "DateTimeNow": 1670587570}}}}
INFO    2022-12-09 15:06:10,938 - iso15118.shared.comm_session (420): Sending SessionSetupRes
INFO    2022-12-09 15:06:10,939 - iso15118.shared.states (137): Entered state ServiceDiscovery
INFO    2022-12-09 15:06:11,166 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"ServiceDiscoveryReq":{"ServiceCategory":"EVCharging"}}}}
INFO    2022-12-09 15:06:11,167 - iso15118.shared.comm_session (234): ServiceDiscoveryReq received
INFO    2022-12-09 15:06:11,170 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"ServiceDiscoveryRes": {"ResponseCode": "OK", "PaymentOptions": {"PaymentOption": ["ExternalPayment"]}, "ChargeService": {"ServiceTag": {"ServiceID": 1, "ServiceCategory": "EVCharging"}, "FreeService": false, "EnergyTransferType": "DC_extended"}}}}}
INFO    2022-12-09 15:06:11,377 - iso15118.shared.comm_session (420): Sending ServiceDiscoveryRes
INFO    2022-12-09 15:06:11,378 - iso15118.shared.states (137): Entered state ServicePaymentSelection
INFO    2022-12-09 15:06:11,585 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"ServicePaymentSelectionReq":{"SelectedPaymentOption":"ExternalPayment","SelectedServiceList":{"SelectedService":[{"ServiceID":1}]}}}}}
INFO    2022-12-09 15:06:11,586 - iso15118.shared.comm_session (234): ServicePaymentSelectionReq received
INFO    2022-12-09 15:06:11,588 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"ServicePaymentSelectionRes": {"ResponseCode": "OK"}}}}
INFO    2022-12-09 15:06:11,778 - iso15118.shared.comm_session (420): Sending ServicePaymentSelectionRes
INFO    2022-12-09 15:06:11,779 - iso15118.shared.states (137): Entered state ContractAuthentication
INFO    2022-12-09 15:06:12,007 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"ContractAuthenticationReq":{}}}}
INFO    2022-12-09 15:06:12,008 - iso15118.shared.comm_session (234): ContractAuthenticationReq received
INFO    2022-12-09 15:06:12,010 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"ContractAuthenticationRes": {"ResponseCode": "OK", "EVSEProcessing": "Finished"}}}}
INFO    2022-12-09 15:06:12,161 - iso15118.shared.comm_session (420): Sending ContractAuthenticationRes
INFO    2022-12-09 15:06:12,161 - iso15118.shared.states (137): Entered state ChargeParameterDiscovery
INFO    2022-12-09 15:06:12,370 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"ChargeParameterDiscoveryReq":{"EVRequestedEnergyTransferType":"DC_extended","DC_EVChargeParameter":{"DC_EVStatus":{"EVReady":false,"EVErrorCode":"NO_ERROR","EVRESSSOC":45},"EVMaximumCurrentLimit":{"Multiplier":0,"Unit":"A","Value":250},"EVMaximumPowerLimit":{"Multiplier":1,"Unit":"W","Value":10000},"EVMaximumVoltageLimit":{"Multiplier":0,"Unit":"V","Value":480},"EVEnergyCapacity":{"Multiplier":1,"Unit":"Wh","Value":5000},"EVEnergyRequest":{"Multiplier":0,"Unit":"Wh","Value":27200},"FullSOC":100,"BulkSOC":80}}}}}
INFO    2022-12-09 15:06:12,372 - iso15118.shared.comm_session (234): ChargeParameterDiscoveryReq received
INFO    2022-12-09 15:06:12,380 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"ChargeParameterDiscoveryRes": {"ResponseCode": "OK", "EVSEProcessing": "Finished", "SAScheduleList": {"SAScheduleTuple": [{"SAScheduleTupleID": 1, "PMaxSchedule": {"PMaxScheduleID": 0, "PMaxScheduleEntry": [{"PMax": 200, "RelativeTimeInterval": {"start": 0, "duration": 3600}}]}}]}, "DC_EVSEChargeParameter": {"DC_EVSEStatus": {"NotificationMaxDelay": 100, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEMaximumCurrentLimit": {"Value": 4, "Multiplier": 1, "Unit": "A"}, "EVSEMaximumPowerLimit": {"Value": 230, "Multiplier": 1, "Unit": "W"}, "EVSEMaximumVoltageLimit": {"Value": 4, "Multiplier": 1, "Unit": "V"}, "EVSEMinimumCurrentLimit": {"Value": 2, "Multiplier": 1, "Unit": "A"}, "EVSEMinimumVoltageLimit": {"Value": 4, "Multiplier": 1, "Unit": "V"}, "EVSEPeakCurrentRipple": {"Value": 4, "Multiplier": 1, "Unit": "A"}}}}}}
INFO    2022-12-09 15:06:12,567 - iso15118.shared.comm_session (420): Sending ChargeParameterDiscoveryRes
INFO    2022-12-09 15:06:12,567 - iso15118.shared.states (137): Entered state CableCheck
INFO    2022-12-09 15:06:13,358 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"CableCheckReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":45}}}}}
INFO    2022-12-09 15:06:13,358 - iso15118.shared.comm_session (234): CableCheckReq received
INFO    2022-12-09 15:06:13,360 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"CableCheckRes": {"ResponseCode": "OK", "DC_EVSEStatus": {"NotificationMaxDelay": 0, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEProcessing": "Finished"}}}}
INFO    2022-12-09 15:06:13,453 - iso15118.shared.comm_session (420): Sending CableCheckRes
INFO    2022-12-09 15:06:13,453 - iso15118.shared.states (137): Entered state PreCharge
INFO    2022-12-09 15:06:13,650 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"PreChargeReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":45},"EVTargetVoltage":{"Multiplier":0,"Unit":"V","Value":395},"EVTargetCurrent":{"Multiplier":0,"Unit":"A","Value":2}}}}}
INFO    2022-12-09 15:06:13,651 - iso15118.shared.comm_session (234): PreChargeReq received
INFO    2022-12-09 15:06:13,654 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"PreChargeRes": {"ResponseCode": "OK", "DC_EVSEStatus": {"NotificationMaxDelay": 0, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEPresentVoltage": {"Value": 230, "Multiplier": 0, "Unit": "V"}}}}}
INFO    2022-12-09 15:06:13,811 - iso15118.shared.comm_session (420): Sending PreChargeRes
INFO    2022-12-09 15:06:14,058 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"PreChargeReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":45},"EVTargetVoltage":{"Multiplier":0,"Unit":"V","Value":395},"EVTargetCurrent":{"Multiplier":0,"Unit":"A","Value":2}}}}}
INFO    2022-12-09 15:06:14,060 - iso15118.shared.comm_session (234): PreChargeReq received
INFO    2022-12-09 15:06:14,063 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"PreChargeRes": {"ResponseCode": "OK", "DC_EVSEStatus": {"NotificationMaxDelay": 0, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEPresentVoltage": {"Value": 230, "Multiplier": 0, "Unit": "V"}}}}}
INFO    2022-12-09 15:06:14,249 - iso15118.shared.comm_session (420): Sending PreChargeRes
INFO    2022-12-09 15:06:14,487 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"PreChargeReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":45},"EVTargetVoltage":{"Multiplier":0,"Unit":"V","Value":395},"EVTargetCurrent":{"Multiplier":0,"Unit":"A","Value":2}}}}}
INFO    2022-12-09 15:06:14,488 - iso15118.shared.comm_session (234): PreChargeReq received
INFO    2022-12-09 15:06:14,490 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"PreChargeRes": {"ResponseCode": "OK", "DC_EVSEStatus": {"NotificationMaxDelay": 0, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEPresentVoltage": {"Value": 230, "Multiplier": 0, "Unit": "V"}}}}}
INFO    2022-12-09 15:06:14,648 - iso15118.shared.comm_session (420): Sending PreChargeRes
INFO    2022-12-09 15:06:14,880 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"PreChargeReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":45},"EVTargetVoltage":{"Multiplier":0,"Unit":"V","Value":395},"EVTargetCurrent":{"Multiplier":0,"Unit":"A","Value":2}}}}}
INFO    2022-12-09 15:06:14,883 - iso15118.shared.comm_session (234): PreChargeReq received
INFO    2022-12-09 15:06:14,889 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"PreChargeRes": {"ResponseCode": "OK", "DC_EVSEStatus": {"NotificationMaxDelay": 0, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEPresentVoltage": {"Value": 230, "Multiplier": 0, "Unit": "V"}}}}}
INFO    2022-12-09 15:06:15,027 - iso15118.shared.comm_session (420): Sending PreChargeRes
INFO    2022-12-09 15:06:15,194 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"PreChargeReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":45},"EVTargetVoltage":{"Multiplier":0,"Unit":"V","Value":395},"EVTargetCurrent":{"Multiplier":0,"Unit":"A","Value":2}}}}}
INFO    2022-12-09 15:06:15,195 - iso15118.shared.comm_session (234): PreChargeReq received
INFO    2022-12-09 15:06:15,197 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "52B0D9AAD0B49832"}, "Body": {"PreChargeRes": {"ResponseCode": "OK", "DC_EVSEStatus": {"NotificationMaxDelay": 0, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEPresentVoltage": {"Value": 230, "Multiplier": 0, "Unit": "V"}}}}}
INFO    2022-12-09 15:06:15,286 - iso15118.shared.comm_session (420): Sending PreChargeRes
INFO    2022-12-09 15:06:15,479 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"52B0D9AAD0B49832"},"Body":{"PreChargeReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":45},"EVTargetVoltage":{"Multiplier":0,"Unit":"V","Value":395},"EVTargetCurrent":{"Multiplier":0,"Unit":"A","Value":2}}}}}
INFO    2022-12-09 15:06:15,481 - iso15118.shared.comm_session (234): PreChargeReq received

Logs From Seres3 Session

INFO    2022-12-17 10:25:57,761 - iso15118.secc.comm_session_handler (328): SDPRequest received: [Security: NO_TLS, Protocol: TCP]
INFO    2022-12-17 10:25:57,762 - iso15118.secc.comm_session_handler (368): Sending SDPResponse: [ IP address: fe80::7e5d:5d24:76d4:ad5, Port: 63949 , Security: NO_TLS , Transport: TCP ]
INFO    2022-12-17 10:25:57,855 - iso15118.secc.comm_session_handler (263): TCP client connected, client address is ('fe80::161f:baff:fe10:6f4', 49153, 0, 2).
INFO    2022-12-17 10:25:57,855 - iso15118.shared.comm_session (344): Starting a new communication session
INFO    2022-12-17 10:25:57,856 - iso15118.shared.states (137): Entered state SupportedAppProtocol
INFO    2022-12-17 10:25:58,882 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolReq":{"AppProtocol":[{"ProtocolNamespace":"urn:din:70121:2012:MsgDef","VersionNumberMajor":2,"VersionNumberMinor":0,"SchemaID":10,"Priority":1},{"ProtocolNamespace":"urn:iso:15118:2:2013:MsgDef","VersionNumberMajor":2,"VersionNumberMinor":0,"SchemaID":20,"Priority":2}]}}
INFO    2022-12-17 10:25:58,883 - iso15118.shared.comm_session (234): supportedAppProtocolReq received
INFO    2022-12-17 10:25:58,885 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolRes": {"ResponseCode": "OK_SuccessfulNegotiation", "SchemaID": 10}}
INFO    2022-12-17 10:25:58,894 - iso15118.secc.states.sap_states (146): Chosen protocol: DIN_SPEC_70121
INFO    2022-12-17 10:25:58,895 - iso15118.shared.comm_session (420): Sending supportedAppProtocolRes
INFO    2022-12-17 10:25:58,896 - iso15118.shared.states (137): Entered state SessionSetup
INFO    2022-12-17 10:25:59,432 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"000000000000"},"Body":{"SessionSetupReq":{"EVCCID":"141FBA1006F4"}}}}
INFO    2022-12-17 10:25:59,433 - iso15118.shared.comm_session (234): SessionSetupReq received
WARNING    2022-12-17 10:25:59,434 - iso15118.secc.states.din_spec_states (114): EVCC's session ID 000000000000 does not match . New session ID 279A1651041805DB assigned
INFO    2022-12-17 10:25:59,437 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "279A1651041805DB"}, "Body": {"SessionSetupRes": {"ResponseCode": "OK_NewSessionEstablished", "EVSEID": "49A89A6360", "DateTimeNow": 1671261959}}}}
INFO    2022-12-17 10:25:59,755 - iso15118.shared.comm_session (420): Sending SessionSetupRes
INFO    2022-12-17 10:25:59,756 - iso15118.shared.states (137): Entered state ServiceDiscovery
INFO    2022-12-17 10:26:00,277 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"279A1651041805DB"},"Body":{"ServiceDiscoveryReq":{"ServiceCategory":"EVCharging"}}}}
INFO    2022-12-17 10:26:00,278 - iso15118.shared.comm_session (234): ServiceDiscoveryReq received
INFO    2022-12-17 10:26:00,284 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "279A1651041805DB"}, "Body": {"ServiceDiscoveryRes": {"ResponseCode": "OK", "PaymentOptions": {"PaymentOption": ["ExternalPayment"]}, "ChargeService": {"ServiceTag": {"ServiceID": 1, "ServiceCategory": "EVCharging"}, "FreeService": false, "EnergyTransferType": "DC_extended"}}}}}
INFO    2022-12-17 10:26:00,564 - iso15118.shared.comm_session (420): Sending ServiceDiscoveryRes
INFO    2022-12-17 10:26:00,565 - iso15118.shared.states (137): Entered state ServicePaymentSelection
INFO    2022-12-17 10:26:01,149 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"279A1651041805DB"},"Body":{"ServicePaymentSelectionReq":{"SelectedPaymentOption":"ExternalPayment","SelectedServiceList":{"SelectedService":[{"ServiceID":1}]}}}}}
INFO    2022-12-17 10:26:01,151 - iso15118.shared.comm_session (234): ServicePaymentSelectionReq received
INFO    2022-12-17 10:26:01,153 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "279A1651041805DB"}, "Body": {"ServicePaymentSelectionRes": {"ResponseCode": "OK"}}}}
INFO    2022-12-17 10:26:01,488 - iso15118.shared.comm_session (420): Sending ServicePaymentSelectionRes
INFO    2022-12-17 10:26:01,489 - iso15118.shared.states (137): Entered state ContractAuthentication
INFO    2022-12-17 10:26:02,007 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"279A1651041805DB"},"Body":{"ContractAuthenticationReq":{}}}}
INFO    2022-12-17 10:26:02,009 - iso15118.shared.comm_session (234): ContractAuthenticationReq received
INFO    2022-12-17 10:26:02,011 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "279A1651041805DB"}, "Body": {"ContractAuthenticationRes": {"ResponseCode": "OK", "EVSEProcessing": "Finished"}}}}
INFO    2022-12-17 10:26:02,302 - iso15118.shared.comm_session (420): Sending ContractAuthenticationRes
INFO    2022-12-17 10:26:02,304 - iso15118.shared.states (137): Entered state ChargeParameterDiscovery
INFO    2022-12-17 10:26:02,853 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"279A1651041805DB"},"Body":{"ChargeParameterDiscoveryReq":{"EVRequestedEnergyTransferType":"DC_extended","DC_EVChargeParameter":{"DC_EVStatus":{"EVReady":false,"EVErrorCode":"NO_ERROR","EVRESSSOC":0},"EVMaximumCurrentLimit":{"Multiplier":-1,"Unit":"A","Value":1200},"EVMaximumVoltageLimit":{"Multiplier":-1,"Unit":"V","Value":4120},"FullSOC":99,"BulkSOC":80}}}}}
INFO    2022-12-17 10:26:02,856 - iso15118.shared.comm_session (234): ChargeParameterDiscoveryReq received
INFO    2022-12-17 10:26:02,867 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "279A1651041805DB"}, "Body": {"ChargeParameterDiscoveryRes": {"ResponseCode": "OK", "EVSEProcessing": "Finished", "SAScheduleList": SAScheduleTuple": [{"SAScheduleTupleID": 1, "PMaxSchedule": {"PMaxScheduleID": 0, "PMaxScheduleEntry": [{"PMax": 200, "RelativeTimeInterval": {"start": 0, "duration": 3600}}]}}]}, "DC_EVSEChargeParameter": {"DC_EVSEStatus": {"NotificationMaxDelay": 100, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEMaximumCurrentLimit": {"Value": 150, "Multiplier": 0, "Unit": "A"}, "EVSEMaximumPowerLimit": {"Value": 2000, "Multiplier": 1, "Unit": "W"}, "EVSEMaximumVoltageLimit": {"Value": 550, "Multiplier": 0, "Unit": "V"}, "EVSEMinimumCurrentLimit": {"Value": 0, "Multiplier": 0, "Unit": "A"}, "EVSEMinimumVoltageLimit": {"Value": 150, "Multiplier": 0, "Unit": "V"}, "EVSEPeakCurrentRipple": {"Value": 200, "Multiplier": 0, "Unit": "A"}}}}}}
INFO    2022-12-17 10:26:03,184 - iso15118.shared.comm_session (420): Sending ChargeParameterDiscoveryRes
INFO    2022-12-17 10:26:03,185 - iso15118.shared.states (137): Entered state CableCheck
INFO    2022-12-17 10:26:13,316 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"279A1651041805DB"},"Body":{"CableCheckReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":0}}}}}
INFO    2022-12-17 10:26:13,317 - iso15118.shared.comm_session (234): CableCheckReq received
INFO    2022-12-17 10:26:13,319 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "279A1651041805DB"}, "Body": {"CableCheckRes": {"ResponseCode": "OK", "DC_EVSEStatus": {"NotificationMaxDelay": 0, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEProcessing": "Finished"}}}}
INFO    2022-12-17 10:26:13,541 - iso15118.shared.comm_session (420): Sending CableCheckRes
INFO    2022-12-17 10:26:13,542 - iso15118.shared.states (137): Entered state PreCharge
INFO    2022-12-17 10:26:18,986 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"279A1651041805DB"},"Body":{"SessionStopReq":{}}}}
INFO    2022-12-17 10:26:18,987 - iso15118.shared.comm_session (234): SessionStopReq received
INFO    2022-12-17 10:26:18,989 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "279A1651041805DB", "Notification": {"FaultCode": "ParsingError", "FaultMsg": "SessionStopReq' not accepted in state PreCharge"}}, "Body": {"SessionStopRes": {"ResponseCode": "FAILED_SequenceError"}}}}
INFO    2022-12-17 10:26:19,261 - iso15118.shared.comm_session (420): Sending SessionStopRes
INFO    2022-12-17 10:26:19,262 - iso15118.shared.comm_session (390): The data link will terminate in 2 seconds and the TCP connection will close in 5 seconds. 
INFO    2022-12-17 10:26:19,262 - iso15118.shared.comm_session (394): Reason: SessionStopReq' not accepted in state PreCharge
INFO    2022-12-17 10:26:21,266 - iso15118.shared.comm_session (401): terminated the data link
INFO    2022-12-17 10:26:24,270 - iso15118.shared.comm_session (408): TCP connection closed to peer with address ('fe80::161f:baff:fe10:6f4', 49153, 0, 2)
INFO    2022-12-17 10:26:24,272 - iso15118.secc.comm_session_handler (308): Existing session with ('fe80::161f:baff:fe10:6f4', 49153, 0, 2) ended.

Search for correct root certificate in EVSE method

Since we may have multiple MO or V2G root certificates on a given charging station, include logic to determine which is the correct one for a given certificate chain, if any.

This may include searching based on the issuer of the sub-CA 1 certificate.

This may be best implemented in the EVSE controller, so that implementations that have access to online APIs for retrieving certificates can use those.

Handle rejection of authorization in 15118-2

Correctly handle the case where the AuthorizationReq is rejected, in the PaymentDetails and Authorization states. This should also include handling the case where the authorization is Ongoing (returns early to comply with ISO 15118 timeouts, but is continuing to be processed, and will be requested again).

Per @shalinnijel2 :

If Authorization is rejected we need to call:

        self.stop_state_machine(
            "Authorization was rejected",
            message,
            ResponseCode.FAILED,
        )

'message' above is the incoming AuthorizationReq message. stop_state_machine() would build the appropriate response message - in this case AuthorizationRes message with ResponseCode set to ResponseCode.FAILED and also set the next_state to Terminate.
One thing to keep in mind here is the failed response code in AuthorizationRes could be FAILED or as per V2G2-475, be FAILED_ChallengeInvalid - but I think that will be better handled under a separate ticket

Per @tropxy :

in case of Ongoing or Accepted we go to the Authorization state.
in case of rejected then we can answer with an Error code.

we also need to save the state of the authorization in the session here, I believe, because if the auth is successful in the PaymentDetailsReq, then we wont need to request it in the Authorization state and we can move forward. Unless, the ocpp client holds the authorization response and answers immediately if we do another request for the same eMAID.

if the answer "accepted" was not yet received, then we will keep requesting until the timeout (60s)

Setting EVSENotification.RE_NEGOTIATION does not trigger renegotiation with Tesla EV

We are testing renegotiation with a Tesla model 3.
We are no table to start the renegotiation by sending a CurrentDemandRes with the following information:

return DCEVSEStatus(
    evse_notification=EVSENotification.RE_NEGOTIATION,
    notification_max_delay=100,
    evse_isolation_status=isolation_level,
    evse_status_code=DCEVSEStatusCode.EVSE_READY,
)

What are we missing?

UDP sockets [Operation not permitted]

Getting a new issue on a new install.

Everything installs fine, and the EVCC code runs fine. But when I try to run the SECC code, I get this error.

WARNING 2022-12-15 09:37:47,536 - iso15118.secc.transport.tcp_server (124): Closing TCP server
WARNING 2022-12-15 09:37:47,538 - iso15118.secc.transport.tcp_server (124): Closing TCP server
ERROR 2022-12-15 09:37:47,540 - iso15118.shared.utils (51): [Errno 1] Operation not permitted
Traceback (most recent call last):
File "/home/rock/iso15118-master/iso15118/shared/utils.py", line 49, in wait_for_tasks
task.result()
File "/home/rock/iso15118-master/iso15118/secc/transport/udp_server.py", line 112, in start
sock=await self._create_socket(self.iface),
File "/home/rock/iso15118-master/iso15118/secc/transport/udp_server.py", line 75, in _create_socket
sock.setsockopt(
PermissionError: [Errno 1] Operation not permitted

From what I can read, this is an issue with UDP ports not being open. So not an issue with this library as such. Just putting this here as info. As and when I find a solution i'll post here and close.

H

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.