SwitchEV / RISE-V2G

The only fully-featured reference implementation of the Vehicle-2-Grid communication interface ISO 15118
MIT License
219 stars 92 forks source link

SECC replies FAILED_ChargingProfileInvalid in PowerDeliveryRes when there are no ChargingProfile in the request #27

Closed AxelVoitier closed 5 years ago

AxelVoitier commented 5 years ago

Hi Marc,

Another issue I found by integrating rise-v2g in my unit test suite ;). This time it is in the direction where rise-v2g is a SECC, and the EVCC is my own. Still in TCP, EIM and DC mode.

So, for my EVCC that sends a PowerDeliveryReq with ChargeProgress == 'Start' and no ChargingProfile, the SECC replies FAILED_ChargingProfileInvalid, despite ChargingProfile being optional.

This seems to come either from https://github.com/V2GClarity/RISE-V2G/blob/25f3207f36416d9c1726efd254cce6371756b4c6/RISE-V2G-SECC/src/main/java/com/v2gclarity/risev2g/secc/states/WaitForPowerDeliveryReq.java#L136-L137 or https://github.com/V2GClarity/RISE-V2G/blob/25f3207f36416d9c1726efd254cce6371756b4c6/RISE-V2G-SECC/src/main/java/com/v2gclarity/risev2g/secc/states/WaitForPowerDeliveryReq.java#L221.

Cheers, Axel

MarcMueltin commented 5 years ago

Hi @AxelVoitier,

This is a controversial topic. You are right that the standard leaves this field optional, but that is one of the problems that arises when we reuse messages for different purposes and that ends up confusing implementers.

The PowerDeliveryReq message is used once before entering the charging process, thereby setting the field ChargeProgress to 'Start'. Here, the SAScheduleTupleID is set to identify the charging schedule offered by the charging station. The EV should also set the ChargingProfile here, before starting the power flow, so that the charging station knows what charging behavior to expect.

The second time a PowerDeliveryReq message is sent is when the EV intends to stop the charging session, e.g. because the battery is fully charged. Here, the field ChargeProgress is set to 'Stop' and the field ChargingProfile needs to be empty because it does not make sense to send a charging profile when the EV wants to stop charging anyway. Following the same rationale, the field SAScheduleTupleID should also be optional, but it is not due to inconsistency.

There is simply a requirement missing that states WHEN the ChargingProfile is to be set and when it can be left empty. We will fix this for the second edition of ISO 15118-2, adding this missing requirement.

Having said this, I don't want to encourage implementers to leave the ChargingProfile empty as it's not the intention of ISO 15118 to leave it blank when entering the charging loop. So in that specific case, RISE V2G would not be completely standard-compliant, but I risk that for the benefit of making people aware of this fact.

I hope that clears things up for you.

AxelVoitier commented 5 years ago

Hi @MarcMueltin,

Thanks for the explanation, good to know it is actually required.

See you in Arnhem ;).

Axel