EcoG-io/iso15118

No timeout for DC_PreCharger

Opened this issue · 1 comments

Right now in the simulation we pass PreCharge by returning True in simulator.py:

    async def is_precharged(
        self, present_voltage_evse: Union[PVEVSEPresentVoltage, RationalNumber]
    ) -> bool:
        return True

As a result, we get "EVProcessing":"Finished"

When I change it to return False we are stuck in "EVProcessing":"Ongoing" for at least 70s. ISO 15118-20 defines timeout as 60s (Table 215)

Extract from the log below:

...
INFO    2023-07-27 06:17:30,203 - iso15118.shared.states (139): Entered state DCPreCharge
INFO    2023-07-27 06:17:30,213 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:std:iso:15118:-20:DC): {"DC_PreChargeReq":{"EVPresentVoltage":{"Exponent":3,"Value":20},"EVProcessing":"Ongoing","EVTargetVoltage":{"Exponent":3,"Value":20},"Header":{"SessionID":"6F52A252B6742BF1","TimeStamp":1690438650}}}
INFO    2023-07-27 06:17:30,217 - iso15118.shared.comm_session (235): DC_PreChargeReq received
INFO    2023-07-27 06:17:30,222 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:std:iso:15118:-20:DC): {"DC_PreChargeRes": {"Header": {"SessionID": "6F52A252B6742BF1", "TimeStamp": 1690438650}, "ResponseCode": "OK", "EVSEPresentVoltage": {"Exponent": 0, "Value": 230}}}
INFO    2023-07-27 06:17:30,225 - iso15118.shared.comm_session (428): Sent DC_PreChargeRes
...
INFO    2023-07-27 06:18:40,043 - iso15118.shared.comm_session (428): Sent DC_PreChargeRes
INFO    2023-07-27 06:18:40,069 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:std:iso:15118:-20:DC): {"DC_PreChargeReq":{"EVPresentVoltage":{"Exponent":3,"Value":20},"EVProcessing":"Ongoing","EVTargetVoltage":{"Exponent":3,"Value":20},"Header":{"SessionID":"6F52A252B6742BF1","TimeStamp":1690438720}}}
INFO    2023-07-27 06:18:40,073 - iso15118.shared.comm_session (235): DC_PreChargeReq received
INFO    2023-07-27 06:18:40,077 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:std:iso:15118:-20:DC): {"DC_PreChargeRes": {"Header": {"SessionID": "6F52A252B6742BF1", "TimeStamp": 1690438720}, "ResponseCode": "OK", "EVSEPresentVoltage": {"Exponent": 0, "Value": 230}}}
...