ocppj - typo + lastSeen check changed
MODIFY
src/client/ocpp/json/JsonRestChargingStationClient.ts
src/client/ocpp/json/JsonRestChargingStationClient.ts
@@ -263,8 +263,8 @@ export default class JsonRestChargingStationClient extends ChargingStationClient
}
private async sendMessage(request: OCPPOutgoingRequest): Promise<any> {
- // Return a promise
- if (Date.now() - this.chargingStation.lastSeen.getTime() > Configuration.getChargingStationConfig().pingIntervalOCPPJSecs * 1000) {
+ // Check for the lastSeen
+ if (Date.now() - this.chargingStation.lastSeen.getTime() > Configuration.getChargingStationConfig().pingIntervalOCPPJSecs * 1000 * 2) {
// Charging station is not connected to the server - let's abort the current operation
throw new Error(`Charging station is not connected to the server - request '${request[2]}' has been aborted`);
}

MODIFY
src/server/ocpp/json/JsonOCPPServer.ts
src/server/ocpp/json/JsonOCPPServer.ts
@@ -410,7 +410,7 @@ export default class JsonOCPPServer extends OCPPServer {
const wsConnection = wsWrapper.wsConnection;
if (wsWrapper.closed) {
// Current message is from a charger which should not reach us!
- // e.g.: Websocket has been closed during the onOpen because the tenant does not exists
+ // e.g.: Websocket has been closed during the onOpen because the tenant does not exist
throw new Error('Websocket is already closed');
}
// Get WS Connection from cache

ocppj - typo + lastSeen check changed