Log error at faulty profile sent
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 3 Oct 2022 18:38:49 +0000 (20:38 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 3 Oct 2022 18:38:49 +0000 (20:38 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts

index 959b6c2c506d471829c3e018bca5deb4f9c714ef..77a49cbb8fd6d369e82d1783e1ac594c6fccf7a0 100644 (file)
@@ -1843,9 +1843,7 @@ export default class ChargingStation {
     if (webSocketPingInterval > 0 && !this.webSocketPingSetInterval) {
       this.webSocketPingSetInterval = setInterval(() => {
         if (this.isWebSocketConnectionOpened() === true) {
-          this.wsConnection.ping((): void => {
-            /* This is intentional */
-          });
+          this.wsConnection.ping();
         }
       }, webSocketPingInterval * 1000);
       logger.info(
index ae37c7b2e02707e49df9f18181300ecf4447dd38..f7e4489a212a2331b57e7c8cb6385e23b0075af5 100644 (file)
@@ -575,6 +575,11 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
         chargingStation.getConnectorStatus(commandPayload.connectorId)?.transactionStarted ===
           false)
     ) {
+      logger.error(
+        `${chargingStation.logPrefix()} Trying to set transaction charging profile(s) on connector ${
+          commandPayload.connectorId
+        } without a started transaction`
+      );
       return Constants.OCPP_SET_CHARGING_PROFILE_RESPONSE_REJECTED;
     }
     OCPP16ServiceUtils.setChargingProfile(