EcoG-io / iso15118

Implementation of the ISO 15118 Communication Protocol (-2, -20, -8)
Apache License 2.0
156 stars 87 forks source link

SesionStop Request after CableCheckState #184

Open alperkan opened 1 year ago

alperkan commented 1 year ago

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.
gh4emb commented 1 year ago

Hello @alperkan,

Thanks much for posting the logs. I may be missing the documentation or examples elsewhere, but how did you adapt the iso15118 library to communicate with/control a Power Line Communications chip (e.g. the Qualcomm QCA700x)?

Cheers, Hal

alperkan commented 1 year ago

Hello @alperkan,

Thanks much for posting the logs. I may be missing the documentation or examples elsewhere, but how did you adapt the iso15118 library to communicate with/control a Power Line Communications chip (e.g. the Qualcomm QCA700x)?

Cheers, Hal

Hi, @gh4emb, I made my own microcontroller circuit for CP signal and detecting car states. I modified a QCA7420 bassed TP-Link PLC adapter for PLC and raspberry pi 4. On raspi I used open plc tools for SLAC and this library for UDP/TCP communication. WhatsApp Görsel 2022-12-31 saat 10 49 18

shalinnijel2 commented 1 year ago

Hi @alperkan , Thank you for sharing these logs. I think the following entries are of interest in the logs above:

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

There seems to be ~5.4 seconds between CableCheckRes being sent and SessionStopReq being received. As the timeout for CableCheckRes at the EV end is 1.5 seconds, perhaps the message was received at the EV end after the timeout and hence the SessionStopReq? Was this behaviour consistent between tests with Seres3 though? If you still have access to the EV, would it be possible to get a pcap file to see the exact time the message was sent from the SECC end?

alperkan commented 1 year ago

hi, @shalinnijel2 Thanks for your reply, Seres 3 is my own vehicle. I have no problem with access. Now I made a new try. I listened to the network with Wireshark. Below you can find the terminal logs and pkapng file of the new experiment.

As you said, EV does not detect the cableCheckres message we send after the cableCheckreq saying I am ready.

I tried different changes by changing NotificationMaxDelay to 0, 100, 200 and 500. When I did 500, there was no response from EV for a while, then the EVSE code gave a timeout error. When I tried the others, nothing different from the first case happened.

terminal logs:

INFO    2023-01-06 11:35:56,468 - iso15118.secc.secc_settings (117): SECC settings:
INFO    2023-01-06 11:35:56,469 - iso15118.secc.secc_settings (119): MESSAGE_LOG_EXI               : False
INFO    2023-01-06 11:35:56,469 - iso15118.secc.secc_settings (119): MESSAGE_LOG_JSON              : True
INFO    2023-01-06 11:35:56,469 - iso15118.secc.secc_settings (119): V20_SERVICE_CONFIG            : /home/filsarj-ev/iso15118-master/iso15118/shared/examples/15118_20_evse_service_config.json
INFO    2023-01-06 11:35:56,469 - iso15118.secc.secc_settings (119): ENABLE_TLS_1_3                : False
INFO    2023-01-06 11:35:56,470 - iso15118.secc.secc_settings (119): PKI_PATH                      : /home/filsarj-ev/iso15118-master/iso15118/shared/pki
INFO    2023-01-06 11:35:56,472 - iso15118.secc.secc_settings (121): USE_CPO_BACKEND               : False
INFO    2023-01-06 11:35:56,472 - iso15118.secc.secc_settings (121): SECC_ENFORCE_TLS              : False
INFO    2023-01-06 11:35:56,472 - iso15118.secc.secc_settings (121): FREE_CERT_INSTALL_SERVICE     : True
INFO    2023-01-06 11:35:56,472 - iso15118.secc.secc_settings (121): NETWORK_INTERFACE             : eth0
INFO    2023-01-06 11:35:56,472 - iso15118.secc.secc_settings (121): PROTOCOLS                     : ['DIN_SPEC_70121', 'ISO_15118_2', 'ISO_15118_20_AC', 'ISO_15118_20_DC']
INFO    2023-01-06 11:35:56,473 - iso15118.secc.secc_settings (121): LOG_LEVEL                     : INFO
INFO    2023-01-06 11:35:56,473 - iso15118.secc.secc_settings (121): STANDBY_ALLOWED               : False
INFO    2023-01-06 11:35:56,473 - iso15118.secc.secc_settings (121): AUTH_MODES                    : ['EIM', 'PNC']
INFO    2023-01-06 11:35:56,473 - iso15118.secc.secc_settings (121): ALLOW_CERT_INSTALL_SERVICE    : True
INFO    2023-01-06 11:35:56,473 - iso15118.secc.secc_settings (121): FREE_CHARGING_SERVICE         : False
INFO    2023-01-06 11:36:02,336 - iso15118.shared.exi_codec (174): EXI Codec version: 1.55
INFO    2023-01-06 11:36:02,337 - iso15118.secc (31): Starting 15118 version: 0.14.2
INFO    2023-01-06 11:36:02,338 - iso15118.secc.comm_session_handler (217): Communication session handler started
INFO    2023-01-06 11:36:02,359 - iso15118.secc.transport.udp_server (130): UDP server socket ready
INFO    2023-01-06 11:36:02,360 - iso15118.secc.transport.udp_server (116): UDP server started at address FF02::1%eth0 and port 15118
INFO    2023-01-06 11:36:02,362 - iso15118.secc.transport.tcp_server (109): TLS server started at address fe80::7e5d:5d24:76d4:ad5%eth0 and port 52065
INFO    2023-01-06 11:36:02,362 - iso15118.secc.transport.tcp_server (109): TCP server started at address fe80::7e5d:5d24:76d4:ad5%eth0 and port 49621
INFO    2023-01-06 11:37:18,186 - iso15118.secc.comm_session_handler (328): SDPRequest received: [Security: NO_TLS, Protocol: TCP]
INFO    2023-01-06 11:37:18,187 - iso15118.secc.comm_session_handler (368): Sending SDPResponse: [ IP address: fe80::7e5d:5d24:76d4:ad5, Port: 49621 , Security: NO_TLS , Transport: TCP ]
INFO    2023-01-06 11:37:18,267 - iso15118.secc.comm_session_handler (263): TCP client connected, client address is ('fe80::161f:baff:fe10:6f4', 49153, 0, 2).
INFO    2023-01-06 11:37:18,306 - iso15118.shared.comm_session (344): Starting a new communication session
INFO    2023-01-06 11:37:18,307 - iso15118.shared.states (137): Entered state SupportedAppProtocol
INFO    2023-01-06 11:37:19,872 - 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    2023-01-06 11:37:19,873 - iso15118.shared.comm_session (234): supportedAppProtocolReq received
INFO    2023-01-06 11:37:19,881 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolRes": {"ResponseCode": "OK_SuccessfulNegotiation", "SchemaID": 10}}
INFO    2023-01-06 11:37:20,032 - iso15118.secc.states.sap_states (146): Chosen protocol: DIN_SPEC_70121
INFO    2023-01-06 11:37:20,032 - iso15118.shared.comm_session (420): Sending supportedAppProtocolRes
INFO    2023-01-06 11:37:20,032 - iso15118.shared.states (137): Entered state SessionSetup
INFO    2023-01-06 11:37:21,224 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"000000000000"},"Body":{"SessionSetupReq":{"EVCCID":"141FBA1006F4"}}}}
INFO    2023-01-06 11:37:21,225 - iso15118.shared.comm_session (234): SessionSetupReq received
WARNING    2023-01-06 11:37:21,226 - iso15118.secc.states.din_spec_states (114): EVCC's session ID 000000000000 does not match . New session ID 1BCEFFA9967ADCAF assigned
INFO    2023-01-06 11:37:21,227 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "1BCEFFA9967ADCAF"}, "Body": {"SessionSetupRes": {"ResponseCode": "OK_NewSessionEstablished", "EVSEID": "49A89A6360", "DateTimeNow": 1672994241}}}}
INFO    2023-01-06 11:37:21,601 - iso15118.shared.comm_session (420): Sending SessionSetupRes
INFO    2023-01-06 11:37:21,602 - iso15118.shared.states (137): Entered state ServiceDiscovery
INFO    2023-01-06 11:37:22,272 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"1BCEFFA9967ADCAF"},"Body":{"ServiceDiscoveryReq":{"ServiceCategory":"EVCharging"}}}}
INFO    2023-01-06 11:37:22,273 - iso15118.shared.comm_session (234): ServiceDiscoveryReq received
INFO    2023-01-06 11:37:22,275 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "1BCEFFA9967ADCAF"}, "Body": {"ServiceDiscoveryRes": {"ResponseCode": "OK", "PaymentOptions": {"PaymentOption": ["ExternalPayment"]}, "ChargeService": {"ServiceTag": {"ServiceID": 1, "ServiceCategory": "EVCharging"}, "FreeService": false, "EnergyTransferType": "DC_extended"}}}}}
INFO    2023-01-06 11:37:22,671 - iso15118.shared.comm_session (420): Sending ServiceDiscoveryRes
INFO    2023-01-06 11:37:22,671 - iso15118.shared.states (137): Entered state ServicePaymentSelection
INFO    2023-01-06 11:37:23,312 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"1BCEFFA9967ADCAF"},"Body":{"ServicePaymentSelectionReq":{"SelectedPaymentOption":"ExternalPayment","SelectedServiceList":{"SelectedService":[{"ServiceID":1}]}}}}}
INFO    2023-01-06 11:37:23,314 - iso15118.shared.comm_session (234): ServicePaymentSelectionReq received
INFO    2023-01-06 11:37:23,315 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "1BCEFFA9967ADCAF"}, "Body": {"ServicePaymentSelectionRes": {"ResponseCode": "OK"}}}}
INFO    2023-01-06 11:37:23,588 - iso15118.shared.comm_session (420): Sending ServicePaymentSelectionRes
INFO    2023-01-06 11:37:23,591 - iso15118.shared.states (137): Entered state ContractAuthentication
INFO    2023-01-06 11:37:24,117 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"1BCEFFA9967ADCAF"},"Body":{"ContractAuthenticationReq":{}}}}
INFO    2023-01-06 11:37:24,118 - iso15118.shared.comm_session (234): ContractAuthenticationReq received
INFO    2023-01-06 11:37:24,121 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "1BCEFFA9967ADCAF"}, "Body": {"ContractAuthenticationRes": {"ResponseCode": "OK", "EVSEProcessing": "Finished"}}}}
INFO    2023-01-06 11:37:24,399 - iso15118.shared.comm_session (420): Sending ContractAuthenticationRes
INFO    2023-01-06 11:37:24,400 - iso15118.shared.states (137): Entered state ChargeParameterDiscovery
INFO    2023-01-06 11:37:25,019 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"1BCEFFA9967ADCAF"},"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    2023-01-06 11:37:25,021 - iso15118.shared.comm_session (234): ChargeParameterDiscoveryReq received
INFO    2023-01-06 11:37:25,029 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "1BCEFFA9967ADCAF"}, "Body": {"ChargeParameterDiscoveryRes": {"ResponseCode": "OK", "EVSEProcessing": "Finished", "SAScheduleList": {"SAScheduleTuple": [{"SAScheduleTupleID": 1, "PMaxSchedule": {"PMaxScheduleID": 0, "PMaxScheduleEntry": [{"PMax": 20000, "RelativeTimeInterval": {"start": 0, "duration": 7200}}]}}]}, "DC_EVSEChargeParameter": {"DC_EVSEStatus": {"NotificationMaxDelay": 0, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEMaximumCurrentLimit": {"Value": 1200, "Multiplier": -1, "Unit": "A"}, "EVSEMaximumPowerLimit": {"Value": 2000, "Multiplier": 1, "Unit": "W"}, "EVSEMaximumVoltageLimit": {"Value": 4120, "Multiplier": -1, "Unit": "V"}, "EVSEMinimumCurrentLimit": {"Value": 0, "Multiplier": 0, "Unit": "A"}, "EVSEMinimumVoltageLimit": {"Value": 150, "Multiplier": 0, "Unit": "V"}, "EVSEPeakCurrentRipple": {"Value": 200, "Multiplier": 0, "Unit": "A"}}}}}}
INFO    2023-01-06 11:37:25,338 - iso15118.shared.comm_session (420): Sending ChargeParameterDiscoveryRes
INFO    2023-01-06 11:37:25,339 - iso15118.shared.states (137): Entered state CableCheck
INFO    2023-01-06 11:37:29,249 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"1BCEFFA9967ADCAF"},"Body":{"CableCheckReq":{"DC_EVStatus":{"EVReady":true,"EVErrorCode":"NO_ERROR","EVRESSSOC":0}}}}}
INFO    2023-01-06 11:37:29,250 - iso15118.shared.comm_session (234): CableCheckReq received
INFO    2023-01-06 11:37:29,252 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "1BCEFFA9967ADCAF"}, "Body": {"CableCheckRes": {"ResponseCode": "OK", "DC_EVSEStatus": {"NotificationMaxDelay": 0, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEProcessing": "Finished"}}}}
INFO    2023-01-06 11:37:29,517 - iso15118.shared.comm_session (420): Sending CableCheckRes
INFO    2023-01-06 11:37:29,518 - iso15118.shared.states (137): Entered state PreCharge
INFO    2023-01-06 11:37:34,958 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:din:70121:2012:MsgDef): {"V2G_Message":{"Header":{"SessionID":"1BCEFFA9967ADCAF"},"Body":{"SessionStopReq":{}}}}
INFO    2023-01-06 11:37:34,959 - iso15118.shared.comm_session (234): SessionStopReq received
INFO    2023-01-06 11:37:34,961 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:din:70121:2012:MsgDef): {"V2G_Message": {"Header": {"SessionID": "1BCEFFA9967ADCAF", "Notification": {"FaultCode": "ParsingError", "FaultMsg": "SessionStopReq' not accepted in state PreCharge"}}, "Body": {"SessionStopRes": {"ResponseCode": "FAILED_SequenceError"}}}}
INFO    2023-01-06 11:37:35,217 - iso15118.shared.comm_session (420): Sending SessionStopRes
INFO    2023-01-06 11:37:35,218 - iso15118.shared.comm_session (390): The data link will terminate in 2 seconds and the TCP connection will close in 5 seconds. 
INFO    2023-01-06 11:37:35,218 - iso15118.shared.comm_session (394): Reason: SessionStopReq' not accepted in state PreCharge
INFO    2023-01-06 11:37:37,221 - iso15118.shared.comm_session (401): terminated the data link
INFO    2023-01-06 11:37:40,225 - iso15118.shared.comm_session (408): TCP connection closed to peer with address ('fe80::161f:baff:fe10:6f4', 49153, 0, 2)
INFO    2023-01-06 11:37:40,226 - iso15118.secc.comm_session_handler (308): Existing session with ('fe80::161f:baff:fe10:6f4', 49153, 0, 2) ended.
^CWARNING    2023-01-06 11:37:46,103 - iso15118.secc.transport.tcp_server (124): Closing TCP server
WARNING    2023-01-06 11:37:46,104 - iso15118.secc.transport.tcp_server (124): Closing TCP server

seresDen8WS.zip

shalinnijel2 commented 1 year ago

Hi @alperkan Thank you for the pcap files and the logs. EVRESSSOC (state of charge) is being reported as 0 in CableCheckReq and ChargeParameterDiscoveryReq. Is that true?

As your EV supports 15118-2 as well, could we try that too, please? And we could perhaps compare behaviour? From the supportedAppProtocolReq messsage, the EV prefers DINSPEC over 15118-2. So we will have to force SECC to offer only 15118-2 - this could be done by setting the following variable in the .env file and restarting the service.

PROTOCOLS=ISO_15118_2

If set correctly, this would be reflected in the env settings logged when SECC comes up.

Kind regards, Shalin.

alperkan commented 1 year ago

Hi @shalinnijel2 Yes you are right, EV sends SOC as 0, I hope it will fix it with precharge.req. The EV also supports the 15118-2 as you said. I made the change you mentioned in the .env file, but it was still connected via DIN70121. I also made a change to the secc_settings python file.

    default_protocols = [
        "DIN_SPEC_70121",
        "ISO_15118_2",
        "ISO_15118_20_AC",
        "ISO_15118_20_DC",
    ]

I removed all but ISO_15118_2 in this section and managed to communicate with the 15118-2 protocol. The result is that the CableCheck.req request is no longer coming. :) You can find the new logs and pcap file below.

15118-2 LOGS

INFO    2023-01-13 18:27:49,021 - iso15118.secc.secc_settings (114): SECC settings:
INFO    2023-01-13 18:27:49,021 - iso15118.secc.secc_settings (116): V20_SERVICE_CONFIG            : /home/filsarj-ev/iso15118-master/iso15118/shared/examples/15118_20_evse_service_config.json
INFO    2023-01-13 18:27:49,022 - iso15118.secc.secc_settings (116): MESSAGE_LOG_EXI               : False
INFO    2023-01-13 18:27:49,022 - iso15118.secc.secc_settings (116): PKI_PATH                      : /home/filsarj-ev/iso15118-master/iso15118/shared/pki
INFO    2023-01-13 18:27:49,022 - iso15118.secc.secc_settings (116): MESSAGE_LOG_JSON              : True
INFO    2023-01-13 18:27:49,022 - iso15118.secc.secc_settings (116): ENABLE_TLS_1_3                : False
INFO    2023-01-13 18:27:49,024 - iso15118.secc.secc_settings (118): STANDBY_ALLOWED               : False
INFO    2023-01-13 18:27:49,024 - iso15118.secc.secc_settings (118): LOG_LEVEL                     : INFO
INFO    2023-01-13 18:27:49,024 - iso15118.secc.secc_settings (118): FREE_CERT_INSTALL_SERVICE     : True
INFO    2023-01-13 18:27:49,024 - iso15118.secc.secc_settings (118): FREE_CHARGING_SERVICE         : False
INFO    2023-01-13 18:27:49,024 - iso15118.secc.secc_settings (118): ALLOW_CERT_INSTALL_SERVICE    : True
INFO    2023-01-13 18:27:49,025 - iso15118.secc.secc_settings (118): SECC_ENFORCE_TLS              : False
INFO    2023-01-13 18:27:49,025 - iso15118.secc.secc_settings (118): PROTOCOLS                     : ['ISO_15118_2']
INFO    2023-01-13 18:27:49,025 - iso15118.secc.secc_settings (118): AUTH_MODES                    : ['EIM', 'PNC']
INFO    2023-01-13 18:27:49,025 - iso15118.secc.secc_settings (118): NETWORK_INTERFACE             : eth0
INFO    2023-01-13 18:27:49,025 - iso15118.secc.secc_settings (118): USE_CPO_BACKEND               : False
INFO    2023-01-13 18:27:53,989 - iso15118.shared.exi_codec (174): EXI Codec version: 1.55
INFO    2023-01-13 18:27:53,990 - iso15118.secc (31): Starting 15118 version: 0.14.2
INFO    2023-01-13 18:27:53,991 - iso15118.secc.comm_session_handler (217): Communication session handler started
INFO    2023-01-13 18:27:54,003 - iso15118.secc.transport.udp_server (130): UDP server socket ready
INFO    2023-01-13 18:27:54,004 - iso15118.secc.transport.udp_server (116): UDP server started at address FF02::1%eth0 and port 15118
INFO    2023-01-13 18:27:54,005 - iso15118.secc.transport.tcp_server (109): TLS server started at address fe80::7e5d:5d24:76d4:ad5%eth0 and port 60173
INFO    2023-01-13 18:27:54,005 - iso15118.secc.transport.tcp_server (109): TCP server started at address fe80::7e5d:5d24:76d4:ad5%eth0 and port 60743
INFO    2023-01-13 18:28:15,146 - iso15118.secc.comm_session_handler (328): SDPRequest received: [Security: NO_TLS, Protocol: TCP]
INFO    2023-01-13 18:28:15,147 - iso15118.secc.comm_session_handler (368): Sending SDPResponse: [ IP address: fe80::7e5d:5d24:76d4:ad5, Port: 60743 , Security: NO_TLS , Transport: TCP ]
INFO    2023-01-13 18:28:15,227 - iso15118.secc.comm_session_handler (263): TCP client connected, client address is ('fe80::161f:baff:fe10:6f4', 49153, 0, 2).
INFO    2023-01-13 18:28:15,257 - iso15118.shared.comm_session (344): Starting a new communication session
INFO    2023-01-13 18:28:15,258 - iso15118.shared.states (137): Entered state SupportedAppProtocol
INFO    2023-01-13 18:28:16,710 - 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    2023-01-13 18:28:16,711 - iso15118.shared.comm_session (234): supportedAppProtocolReq received
INFO    2023-01-13 18:28:16,718 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2010:AppProtocol): {"supportedAppProtocolRes": {"ResponseCode": "OK_SuccessfulNegotiation", "SchemaID": 20}}
INFO    2023-01-13 18:28:16,837 - iso15118.secc.states.sap_states (146): Chosen protocol: ISO_15118_2
INFO    2023-01-13 18:28:16,838 - iso15118.shared.comm_session (420): Sending supportedAppProtocolRes
INFO    2023-01-13 18:28:16,838 - iso15118.shared.states (137): Entered state SessionSetup
INFO    2023-01-13 18:28:18,108 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message":{"Header":{"SessionID":"000000000000"},"Body":{"SessionSetupReq":{"EVCCID":"141FBA1006F4"}}}}
INFO    2023-01-13 18:28:18,109 - iso15118.shared.comm_session (234): SessionSetupReq received
WARNING    2023-01-13 18:28:18,109 - iso15118.secc.states.iso15118_2_states (176): EVCC's session ID 000000000000 does not match . New session ID 60E49F6CA67555EA assigned
INFO    2023-01-13 18:28:18,111 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message": {"Header": {"SessionID": "60E49F6CA67555EA"}, "Body": {"SessionSetupRes": {"ResponseCode": "OK_NewSessionEstablished", "EVSEID": "UK123E1234", "EVSETimeStamp": 1673623698}}}}
INFO    2023-01-13 18:28:18,850 - iso15118.shared.comm_session (420): Sending SessionSetupRes
INFO    2023-01-13 18:28:18,851 - iso15118.shared.states (137): Entered state ServiceDiscovery
INFO    2023-01-13 18:28:19,641 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message":{"Header":{"SessionID":"60E49F6CA67555EA"},"Body":{"ServiceDiscoveryReq":{"ServiceCategory":"EVCharging"}}}}
INFO    2023-01-13 18:28:19,642 - iso15118.shared.comm_session (234): ServiceDiscoveryReq received
INFO    2023-01-13 18:28:19,647 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message": {"Header": {"SessionID": "60E49F6CA67555EA"}, "Body": {"ServiceDiscoveryRes": {"ResponseCode": "OK", "PaymentOptionList": {"PaymentOption": ["ExternalPayment"]}, "ChargeService": {"ServiceID": 1, "ServiceName": "AC_DC_Charging", "ServiceCategory": "EVCharging", "FreeService": false, "SupportedEnergyTransferMode": {"EnergyTransferMode": ["DC_extended", "AC_three_phase_core"]}}}}}}
INFO    2023-01-13 18:28:20,110 - iso15118.shared.comm_session (420): Sending ServiceDiscoveryRes
INFO    2023-01-13 18:28:20,947 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message":{"Header":{"SessionID":"60E49F6CA67555EA"},"Body":{"PaymentServiceSelectionReq":{"SelectedPaymentOption":"ExternalPayment","SelectedServiceList":{"SelectedService":[{"ServiceID":1}]}}}}}
INFO    2023-01-13 18:28:20,948 - iso15118.shared.comm_session (234): PaymentServiceSelectionReq received
INFO    2023-01-13 18:28:20,949 - iso15118.shared.states (137): Entered state PaymentServiceSelection
INFO    2023-01-13 18:28:20,952 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message": {"Header": {"SessionID": "60E49F6CA67555EA"}, "Body": {"PaymentServiceSelectionRes": {"ResponseCode": "OK"}}}}
INFO    2023-01-13 18:28:21,304 - iso15118.shared.comm_session (420): Sending PaymentServiceSelectionRes
INFO    2023-01-13 18:28:21,790 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message":{"Header":{"SessionID":"60E49F6CA67555EA"},"Body":{"AuthorizationReq":{}}}}
INFO    2023-01-13 18:28:21,792 - iso15118.shared.comm_session (234): AuthorizationReq received
INFO    2023-01-13 18:28:21,793 - iso15118.shared.states (137): Entered state Authorization
INFO    2023-01-13 18:28:21,795 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message": {"Header": {"SessionID": "60E49F6CA67555EA"}, "Body": {"AuthorizationRes": {"ResponseCode": "OK", "EVSEProcessing": "Finished"}}}}
INFO    2023-01-13 18:28:22,128 - iso15118.shared.comm_session (420): Sending AuthorizationRes
INFO    2023-01-13 18:28:22,129 - iso15118.shared.states (137): Entered state ChargeParameterDiscovery
INFO    2023-01-13 18:28:22,814 - iso15118.shared.exi_codec (299): Decoded message (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message":{"Header":{"SessionID":"60E49F6CA67555EA"},"Body":{"ChargeParameterDiscoveryReq":{"RequestedEnergyTransferMode":"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    2023-01-13 18:28:22,816 - iso15118.shared.comm_session (234): ChargeParameterDiscoveryReq received
INFO    2023-01-13 18:28:22,820 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2013:MsgDef): {"SalesTariff": {"Id": "id1", "SalesTariffID": 10, "NumEPriceLevels": 2, "SalesTariffEntry": [{"EPriceLevel": 1, "RelativeTimeInterval": {"start": 0}}, {"EPriceLevel": 2, "RelativeTimeInterval": {"start": 43200, "duration": 43200}}]}}
INFO    2023-01-13 18:28:23,212 - 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": "th2+taX+QFi3UjpBiJDP0WVBLQ2T3tHyeNfTB3gocmg=", "URI": "#id1"}]}}
INFO    2023-01-13 18:28:23,589 - iso15118.shared.exi_codec (245): Message to encode (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message": {"Header": {"SessionID": "60E49F6CA67555EA", "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": "th2+taX+QFi3UjpBiJDP0WVBLQ2T3tHyeNfTB3gocmg=", "URI": "#id1"}]}, "SignatureValue": {"value": "I2zLdFLEyqjEK0E4St4yYi2XSVz/0qNuw4KtP9xXk+R8VFq8xA5ygLN0VofSLTBYI5rdbL3vuc8jFySblpBWfw=="}}}, "Body": {"ChargeParameterDiscoveryRes": {"ResponseCode": "OK", "EVSEProcessing": "Finished", "SAScheduleList": {"SAScheduleTuple": [{"SAScheduleTupleID": 1, "PMaxSchedule": {"PMaxScheduleEntry": [{"PMax": {"Value": 11000, "Multiplier": 0, "Unit": "W"}, "RelativeTimeInterval": {"start": 0}}, {"PMax": {"Value": 7000, "Multiplier": 0, "Unit": "W"}, "RelativeTimeInterval": {"start": 43200, "duration": 43200}}]}, "SalesTariff": {"Id": "id1", "SalesTariffID": 10, "NumEPriceLevels": 2, "SalesTariffEntry": [{"EPriceLevel": 1, "RelativeTimeInterval": {"start": 0}}, {"EPriceLevel": 2, "RelativeTimeInterval": {"start": 43200, "duration": 43200}}]}}]}, "DC_EVSEChargeParameter": {"DC_EVSEStatus": {"NotificationMaxDelay": 100, "EVSENotification": "None", "EVSEIsolationStatus": "Valid", "EVSEStatusCode": "EVSE_Ready"}, "EVSEMaximumCurrentLimit": {"Value": 1200, "Multiplier": -1, "Unit": "A"}, "EVSEMaximumPowerLimit": {"Value": 2000, "Multiplier": 1, "Unit": "W"}, "EVSEMaximumVoltageLimit": {"Value": 4120, "Multiplier": -1, "Unit": "V"}, "EVSEMinimumCurrentLimit": {"Value": 0, "Multiplier": 0, "Unit": "A"}, "EVSEMinimumVoltageLimit": {"Value": 150, "Multiplier": 0, "Unit": "V"}, "EVSEPeakCurrentRipple": {"Value": 200, "Multiplier": 0, "Unit": "A"}}}}}}
INFO    2023-01-13 18:28:23,941 - iso15118.shared.comm_session (420): Sending ChargeParameterDiscoveryRes
INFO    2023-01-13 18:28:23,942 - iso15118.shared.states (137): Entered state CableCheck
INFO    2023-01-13 18:29:23,990 - iso15118.shared.comm_session (390): The data link will terminate in 2 seconds and the TCP connection will close in 5 seconds. 
INFO    2023-01-13 18:29:23,990 - iso15118.shared.comm_session (394): Reason: TimeoutError occurred. Waited for 60.0 s after sending last message: [Header = [0x1, 0xfe, 0x8001, 358], Payload = 809802183927db299d557a8a895a1d1d1c0e8bcbddddddcb9dcccb9bdc99cbd5148bd8d85b9bdb9a58d85b0b595e1a4bd0d5a1d1d1c0e8bcbddddddcb9dcccb9bdc99cbcc8c0c0c4bcc0d0bde1b5b191cda59cb5b5bdc9948d958d91cd84b5cda184c8d4d910311b4b218812b43a3a381d1797bbbbbb973b999737b93397aa2917b1b0b737b734b1b0b616b2bc3497a429687474703a2f2f7777772e77332e6f72672f323030312f30342f786d6c656e6323736861323536420b61dbeb5a5fe4058b7523a418890cfd165412d0d93ded1f278d7d30778287268128046d996e8a58995518856827095bc64c45b2e92b9ffa546dd87055a7fb8af27c8f8a8b579881ce50166e8ad0fa45a60b04735bad97bdf739e462e49372d20acfe8280000000000218a1f0aa00c0d1020c0d1020314360d8200ad2c8620490100004009030344083034408004528640010204185804820a1a01e04204c10018600006204b0088c30c801100)]
INFO    2023-01-13 18:29:25,993 - iso15118.shared.comm_session (401): terminated the data link
INFO    2023-01-13 18:29:28,997 - iso15118.shared.comm_session (408): TCP connection closed to peer with address ('fe80::161f:baff:fe10:6f4', 49153, 0, 2)
INFO    2023-01-13 18:29:28,998 - iso15118.secc.comm_session_handler (308): Existing session with ('fe80::161f:baff:fe10:6f4', 49153, 0, 2) ended.

seres15118-2den1.zip