lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
277 stars 126 forks source link

Unhandled/error validation for `TransactionEventRequest` eventType:`Started` with idToken/IdTokenType (type:`NoAuthorization` and empty `idtoken` value) #223

Closed dwibudut closed 1 year ago

dwibudut commented 1 year ago

Unhandled validation for TransactionEventRequest eventType:Started with idToken/IdTokenType (type:NoAuthorization and empty idtoken value)

Sample Request to CSMS:

[2,"e0436301-35d8-42a1-800d-bff6992e135e","TransactionEvent",{"eventType":"Started","evse":{"connectorId":1,"id":1},"idToken":{"idToken":"","type":"NoAuthorization"},"meterValue":[{"sampledValue":[{"context":"Transaction.Begin","measurand":"Energy.Active.Import.Register","unitOfMeasure":{"multiplier":0,"unit":"kWh"},"value":1.46}],"timestamp":"2023-09-11T02:55:05Z"}],"seqNo":0,"timestamp":"2023-09-11T02:55:05.407Z","transactionInfo":{"chargingState":"EVConnected","transactionId":"318a67d6-a3ab-4429-ae26-f3c7b61cf760"},"triggerReason":"CablePluggedIn"}]
ocpp message (e38b849f-063f-4f36-8a67-4842dfba820e): OccurrenceConstraintViolation - Field Call.Payload.IDToken.IdToken required but not found for feature TransactionEvent

Note:

This is for charging station with authorization using a start button

Reference:

in OCPP 2.0.1 Edition 2: Part 2 - Specification image

image

To fix this, is to just remove required on IdToken.IdToken value? Is there any impact on other handles?

image

cc: @lorenzodonini