From: Jérôme Benoit Date: Mon, 16 Mar 2026 14:58:06 +0000 (+0100) Subject: fix(ocpp20): send TransactionEvent(Started) on RequestStartTransaction (E02.FR.01) X-Git-Tag: ocpp-server@v3.1.1~18 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=52054291e5525a2ac7ba738e268a9a067f74b3ac;p=e-mobility-charging-stations-simulator.git fix(ocpp20): send TransactionEvent(Started) on RequestStartTransaction (E02.FR.01) The handler accepted remote start transactions without notifying the CSMS via TransactionEvent. Per E02.FR.01, the CS SHALL send TransactionEvent with eventType=Started when a transaction begins. Also starts meter values interval for the new transaction. --- diff --git a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts index 3ddaef2d..41281ec2 100644 --- a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts +++ b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts @@ -98,8 +98,10 @@ import { type OCPP20SetVariablesResponse, type OCPP20StatusNotificationRequest, type OCPP20StatusNotificationResponse, + OCPP20TransactionEventEnumType, type OCPP20TriggerMessageRequest, type OCPP20TriggerMessageResponse, + OCPP20TriggerReasonEnumType, type OCPP20UnlockConnectorRequest, type OCPP20UnlockConnectorResponse, type OCPP20UpdateFirmwareRequest, @@ -2417,6 +2419,18 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { evseId ) + // E02.FR.01: Send TransactionEvent(Started) to CSMS + await OCPP20ServiceUtils.sendTransactionEvent( + chargingStation, + OCPP20TransactionEventEnumType.Started, + OCPP20TriggerReasonEnumType.RemoteStart, + connectorId, + transactionId + ) + + const txUpdatedInterval = this.getTxUpdatedInterval(chargingStation) + chargingStation.startTxUpdatedInterval(connectorId, txUpdatedInterval) + if (chargingProfile != null) { connectorStatus.chargingProfiles ??= [] connectorStatus.chargingProfiles.push(chargingProfile)