Log in right tenant
MODIFY
src/client/ocpp/json/JsonChargingStationClient.ts
src/client/ocpp/json/JsonChargingStationClient.ts
@@ -2,7 +2,6 @@ import { OCPPChangeAvailabilityCommandParam, OCPPChangeAvailabilityCommandResult
import ChargingStationClient from '../../ocpp/ChargingStationClient';
import { Command } from '../../../types/ChargingStation';
-import Constants from '../../../utils/Constants';
import JsonWSConnection from '../../../server/ocpp/json/JsonWSConnection';
import Logging from '../../../utils/Logging';
import { MessageType } from '../../../types/WebSocket';

MODIFY
src/client/ocpp/json/JsonRestChargingStationClient.ts
src/client/ocpp/json/JsonRestChargingStationClient.ts
@@ -162,8 +162,6 @@ export default class JsonRestChargingStationClient extends ChargingStationClient
const messageJson = JSON.parse(message.data);
// Check if this corresponds to a request
if (this.requests[messageJson[1]]) {
- // Log
- Logging.logReceivedAction(MODULE_NAME, this.tenantID, this.chargingStation.id, this.requests[messageJson[1]].command, messageJson);
// Check message type
if (messageJson[0] === MessageType.ERROR_MESSAGE) {
// Error message

MODIFY
src/server/ocpp/json/JsonWSConnection.ts
src/server/ocpp/json/JsonWSConnection.ts
@@ -30,7 +30,7 @@ export default class JsonWSConnection extends WSConnection {
// OCPP 1.6?
case 'ocpp1.6':
// Create the Json Client
- this.chargingStationClient = new JsonChargingStationClient(this, this.getTenantID(), this.getChargingStationID());
+ this.chargingStationClient = new JsonChargingStationClient(this, this.tenantID, this.chargingStationID);
// Create the Json Server Service
this.chargingStationService = new JsonChargingStationService(chargingStationConfig);
break;

MODIFY
src/server/ocpp/json/WSConnection.ts
src/server/ocpp/json/WSConnection.ts
@@ -24,15 +24,15 @@ export default class WSConnection {
protected initialized: boolean;
protected wsServer: JsonCentralSystemServer;
protected readonly serverIP: string;
+ protected readonly chargingStationID: string;
+ protected readonly tenantID: string;
+ private readonly token: string;
private readonly url: string;
private readonly clientIP: string;
private readonly wsConnection: WebSocket;
private req: http.IncomingMessage;
private requests: any = {};
private tenantIsValid: boolean;
- private readonly chargingStationID: string;
- private readonly tenantID: string;
- private readonly token: string;
constructor(wsConnection: WebSocket, req: http.IncomingMessage, wsServer: JsonCentralSystemServer) {
// Init
@@ -97,7 +97,6 @@ export default class WSConnection {
try {
// Check Tenant?
await Utils.checkTenant(this.tenantID);
- // Ok
this.tenantIsValid = true;
// Cloud Foundry?
if (Configuration.isCloudFoundry()) {

Log in right tenant