Added OCPPJ target port
MODIFY
src/client/ocpp/json/JsonRestChargingStationClient.ts
src/client/ocpp/json/JsonRestChargingStationClient.ts
@@ -20,15 +20,15 @@ export default class JsonRestChargingStationClient extends ChargingStationClient
private wsConnection: WSClient;
private tenantID: string;
- constructor(tenantID: string, chargingStation: ChargingStation) {
+ public constructor(tenantID: string, chargingStation: ChargingStation) {
super();
this.tenantID = tenantID;
// Get URL
let jsonServerURL: string;
// Check K8s
- if (process.env.POD_NAME && chargingStation.cloudHostIP) {
+ if (process.env.K8S && process.env.OCPPJ_TARGET_PORT && chargingStation.cloudHostIP) {
// Use K8s internal IP, always in ws
- jsonServerURL = `ws://${chargingStation.cloudHostIP}`;
+ jsonServerURL = `ws://${chargingStation.cloudHostIP}:${process.env.OCPPJ_TARGET_PORT}`;
} else {
jsonServerURL = chargingStation.chargingStationURL;
if (!jsonServerURL) {

MODIFY
src/server/ocpp/json/JsonRestWSConnection.ts
src/server/ocpp/json/JsonRestWSConnection.ts
@@ -9,7 +9,7 @@ import global from '../../../types/GlobalType';
const MODULE_NAME = 'JsonRestWSConnection';
export default class JsonRestWSConnection extends WSConnection {
- constructor(ws: WSWrapper) {
+ public constructor(ws: WSWrapper) {
super(ws);
}

Added OCPPJ target port