SAFE-eV / OCMF-Open-Charge-Metering-Format

24 stars 13 forks source link

example? #8

Open bvdberg opened 3 years ago

bvdberg commented 3 years ago

It is unclear how to pack this into a JSON OCPP message for me. Is the idea to hex-encode the 2 json fragments with the pipe symbols? Do have have an example showing for example the StopTransaction json message?

FrankHitman commented 3 years ago

I have the same question. The OCPP version:1.6 is different from OCPP version:2.0.1. how to intergrate OCMF into them all?

Naheel-Azawy commented 5 months ago

I don't think the idea is to pack the json as is into OCPP, even though this would've been great. Considering the OCPP 2.0.1 specifications, if you check the SignedMeterValueType, it has the following fields:

Which I suppose can be extracted from the OCMF json. I agree a clear example would be very good. And maybe seamless integration into OCPP could be considered for future revisions. I hope authors would be interested.

ahzf commented 5 months ago

Well... the problem here is, that OCMF is not really about signed meter values. It is a container format for signed meter values with meta data and the most important missmatch: The OCMF signature is over the container, not over the signed meter values itself.

OCPP and all ev roaming protocols nevertheless expect 2 or more signed meter values, while within an OCMF container it is very legal to have unsigned start and stop meter values protected by the signature over the container. The common workaround is to send the OCMF having both meter values as "stop meter value" within those ev roaming protocols.

Perhaps we can get this "right" for OCPP v2.1.

On the other hand it is much more secure to send a signed start meter value and later a signed stop meter value (maybe again including the start meter value, but just for reference), as it reduces the possibilities for fraud, when most OCMF information is already at the EV driver before the CPO or an attacker knows who to manipulate the meter values. But this would require, that the signed start meter value really reaches the ev driver asap... which is even 5 years after "Eichrecht as a law" not realistic :-/