Log the timeout of WS
MODIFY
src/server/ocpp/json/WSConnection.ts
src/server/ocpp/json/WSConnection.ts
@@ -143,8 +143,8 @@ export default abstract class WSConnection {
} else {
// Trigger timeout
requestTimeout = setTimeout(() => {
- rejectCallback(`Timeout for Message ID '${messageID}' with content '${messageToSend} (${this.tenantSubdomain})`);
- }, Constants.OCPP_SOCKET_TIMEOUT);
+ rejectCallback(`Timeout after ${Constants.OCPP_SOCKET_TIMEOUT_MILLIS / 1000} secs for Message ID '${messageID}' with content '${messageToSend} (${this.tenantSubdomain})`);
+ }, Constants.OCPP_SOCKET_TIMEOUT_MILLIS);
}
});
}

MODIFY
src/utils/Constants.ts
src/utils/Constants.ts
@@ -293,7 +293,7 @@ export default class Constants {
'([0-9a-f]{24})\\/',
'(?:\\S+)$'].join(''), 'ig');
- public static readonly OCPP_SOCKET_TIMEOUT = 10 * 1000;
+ public static readonly OCPP_SOCKET_TIMEOUT_MILLIS = 10 * 1000;
public static readonly OCPP_HEARTBEAT_KEYS = Object.freeze(['HeartbeatInterval', 'HeartBeatInterval']);
public static readonly MAX_DATE = new Date('9999-12-31Z23:59:59:999');

Log the timeout of WS