enableStatistics: false,
remoteAuthorization: true,
currentOutType: CurrentType.AC,
+ mainVoltageMeterValues: true,
+ phaseLineToLineVoltageMeterValues: false,
+ customValueLimitationMeterValues: true,
ocppStrictCompliance: true,
outOfOrderEndMeterValues: false,
beginEndMeterValues: false,
meteringPerTransaction: true,
transactionDataMeterValues: false,
- mainVoltageMeterValues: true,
- phaseLineToLineVoltageMeterValues: false,
- customValueLimitationMeterValues: true,
supervisionUrlOcppConfiguration: false,
supervisionUrlOcppKey: VendorParametersKey.ConnectionUrl,
ocppVersion: OCPPVersion.VERSION_16,
public setSupervisionUrl(url: string): void {
if (
- this.stationInfo?.supervisionUrlOcppConfiguration &&
+ this.stationInfo?.supervisionUrlOcppConfiguration === true &&
isNotEmptyString(this.stationInfo?.supervisionUrlOcppKey)
) {
setConfigurationKeyValue(this, this.stationInfo.supervisionUrlOcppKey!, url);
stationInfo.chargingStationId = getChargingStationId(this.index, stationTemplate);
stationInfo.ocppVersion = stationTemplate?.ocppVersion ?? OCPPVersion.VERSION_16;
createSerialNumber(stationTemplate, stationInfo);
+ stationInfo.voltageOut = this.getVoltageOut(stationInfo);
if (isNotEmptyArray(stationTemplate?.power)) {
stationTemplate.power = stationTemplate.power as number[];
const powerArrayRandomIndex = Math.floor(secureRandom() * stationTemplate.power.length);
}
}
- private handleUnsupportedVersion(version: OCPPVersion) {
+ private handleUnsupportedVersion(version: OCPPVersion | undefined) {
const errorMsg = `Unsupported protocol version '${version}' configured in template file ${this.templateFile}`;
logger.error(`${this.logPrefix()} ${errorMsg}`);
throw new BaseError(errorMsg);
this.ocppConfiguration = this.getOcppConfiguration();
this.initializeOcppConfiguration();
this.initializeOcppServices();
+ this.once(ChargingStationEvents.accepted, () => {
+ this.startMessageSequence().catch((error) => {
+ logger.error(`${this.logPrefix()} Error while starting the message sequence:`, error);
+ });
+ });
if (this.stationInfo?.autoRegister === true) {
this.bootNotificationResponse = {
currentTime: new Date(),
logger.info(
`${this.logPrefix()} Connection to OCPP server through ${this.wsConnectionUrl.toString()} succeeded`,
);
+ let registrationRetryCount = 0;
if (this.isRegistered() === false) {
// Send BootNotification
- let registrationRetryCount = 0;
do {
this.bootNotificationResponse = await this.ocppRequestService.requestHandler<
BootNotificationRequest,
this.emit(ChargingStationEvents.registered);
if (this.inAcceptedState() === true) {
this.emit(ChargingStationEvents.accepted);
- await this.startMessageSequence();
}
} else {
logger.error(
- `${this.logPrefix()} Registration failure: max retries reached or retry disabled (${this
+ `${this.logPrefix()} Registration failure: maximum retries reached (${registrationRetryCount}) or retry disabled (${this
.stationInfo?.registrationMaxRetries})`,
);
}
private getPowerDivider(): number {
let powerDivider = this.hasEvses ? this.getNumberOfEvses() : this.getNumberOfConnectors();
- if (this.stationInfo?.powerSharedByConnectors) {
+ if (this.stationInfo?.powerSharedByConnectors === true) {
powerDivider = this.getNumberOfRunningTransactions();
}
return powerDivider;
this.stopWebSocketPing();
// Stop heartbeat
this.stopHeartbeat();
- // Stop ongoing transactions
- stopTransactions && (await this.stopRunningTransactions(reason));
// Stop the ATG
if (this.automaticTransactionGenerator?.started === true) {
this.stopAutomaticTransactionGenerator();
}
+ // Stop ongoing transactions
+ stopTransactions && (await this.stopRunningTransactions(reason));
if (this.hasEvses) {
for (const [evseId, evseStatus] of this.evses) {
if (evseId > 0) {