this.stopConnector(connectorId);
break;
}
- if (!this.chargingStation.isRegistered()) {
- logger.error(this.logPrefix(connectorId) + ' entered in transaction loop while the charging station is not registered');
+ if (!this.chargingStation.isInAcceptedState()) {
+ logger.error(this.logPrefix(connectorId) + ' entered in transaction loop while the charging station is in accepted state');
this.stopConnector(connectorId);
break;
}
return this?.wsConnection?.readyState === OPEN;
}
- public isRegistered(): boolean {
+ public isInPendingState(): boolean {
+ return this?.bootNotificationResponse?.status === RegistrationStatus.PENDING;
+ }
+
+ public isInAcceptedState(): boolean {
return this?.bootNotificationResponse?.status === RegistrationStatus.ACCEPTED;
}
+ public isInRejectedState(): boolean {
+ return this?.bootNotificationResponse?.status === RegistrationStatus.REJECTED;
+ }
+
+ public isRegistered(): boolean {
+ return this.isInAcceptedState() || this.isInPendingState();
+ }
+
public isChargingStationAvailable(): boolean {
return this.getConnectorStatus(0).availability === AvailabilityType.OPERATIVE;
}
await this.ocppRequestService.sendBootNotification(this.bootNotificationRequest.chargePointModel,
this.bootNotificationRequest.chargePointVendor, this.bootNotificationRequest.chargeBoxSerialNumber, this.bootNotificationRequest.firmwareVersion);
}
- if (this.isRegistered()) {
+ if (this.isInAcceptedState()) {
await this.startMessageSequence();
this.stopped && (this.stopped = false);
if (this.wsConnectionRestarted && this.isWebSocketConnectionOpened()) {
this.flushMessageBuffer();
}
+ } else if (this.isInPendingState()) {
+ // The central server shall issue a triggerMessage to the charging station for the boot notification at the end of its configuration process
+ while (!this.isInAcceptedState()) {
+ await this.startMessageSequence();
+ this.stopped && (this.stopped = false);
+ if (this.wsConnectionRestarted && this.isWebSocketConnectionOpened()) {
+ this.flushMessageBuffer();
+ }
+ await Utils.sleep(Constants.CHARGING_STATION_DEFAULT_START_SEQUENCE_DELAY);
+ }
} else {
logger.error(`${this.logPrefix()} Registration failure: max retries reached (${this.getRegistrationMaxRetries()}) or retry disabled (${this.getRegistrationMaxRetries()})`);
}
public async handleRequest(messageId: string, commandName: OCPP16IncomingRequestCommand, commandPayload: Record<string, unknown>): Promise<void> {
let result: Record<string, unknown>;
- if (this.chargingStation.isRegistered()) {
+ if (this.chargingStation.isRegistered() &&
+ !(this.chargingStation.isInPendingState
+ && (commandName === OCPP16IncomingRequestCommand.REMOTE_START_TRANSACTION || commandName === OCPP16IncomingRequestCommand.REMOTE_STOP_TRANSACTION))) {
if (this.incomingRequestHandlers.has(commandName)) {
try {
// Call the method to build the result
if (this.chargingStation.getAuthorizeRemoteTxRequests()) {
let authorized = false;
if (this.chargingStation.getLocalAuthListEnabled() && this.chargingStation.hasAuthorizedTags()
- && this.chargingStation.authorizedTags.find((value) => value === commandPayload.idTag)) {
+ && this.chargingStation.authorizedTags.find((value) => value === commandPayload.idTag)) {
this.chargingStation.getConnectorStatus(transactionConnectorId).localAuthorizeIdTag = commandPayload.idTag;
this.chargingStation.getConnectorStatus(transactionConnectorId).idTagLocalAuthorized = true;
authorized = true;
static readonly OCPP_WEBSOCKET_TIMEOUT = 60000; // Ms
static readonly OCPP_TRIGGER_MESSAGE_DELAY = 2000; // Ms
+ static readonly CHARGING_STATION_DEFAULT_START_SEQUENCE_DELAY = 60000; // Ms
static readonly CHARGING_STATION_DEFAULT_RESET_TIME = 60000; // Ms
static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME = 1000; // Ms
static readonly CHARGING_STATION_ATG_DEFAULT_STOP_AFTER_HOURS = 0.25; // Hours