this.getHeartbeatInterval() > 0 &&
!this.heartbeatSetInterval
) {
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
- this.heartbeatSetInterval = setInterval(async (): Promise<void> => {
- await this.ocppRequestService.requestHandler<HeartbeatRequest, HeartbeatResponse>(
- this,
- RequestCommand.HEARTBEAT
- );
+ this.heartbeatSetInterval = setInterval(() => {
+ this.ocppRequestService
+ .requestHandler<HeartbeatRequest, HeartbeatResponse>(this, RequestCommand.HEARTBEAT)
+ .catch((error) => {
+ logger.error(
+ `${this.logPrefix()} Error while sending '${RequestCommand.HEARTBEAT}':`,
+ error
+ );
+ });
}, this.getHeartbeatInterval());
logger.info(
this.logPrefix() +
return;
}
if (interval > 0) {
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
- this.getConnectorStatus(connectorId).transactionSetInterval = setInterval(
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
- async (): Promise<void> => {
- // FIXME: Implement OCPP version agnostic helpers
- const meterValue: MeterValue = OCPP16ServiceUtils.buildMeterValue(
- this,
- connectorId,
- this.getConnectorStatus(connectorId).transactionId,
- interval
- );
- await this.ocppRequestService.requestHandler<MeterValuesRequest, MeterValuesResponse>(
+ this.getConnectorStatus(connectorId).transactionSetInterval = setInterval(() => {
+ // FIXME: Implement OCPP version agnostic helpers
+ const meterValue: MeterValue = OCPP16ServiceUtils.buildMeterValue(
+ this,
+ connectorId,
+ this.getConnectorStatus(connectorId).transactionId,
+ interval
+ );
+ this.ocppRequestService
+ .requestHandler<MeterValuesRequest, MeterValuesResponse>(
this,
RequestCommand.METER_VALUES,
{
transactionId: this.getConnectorStatus(connectorId).transactionId,
meterValue: [meterValue],
}
- );
- },
- interval
- );
+ )
+ .catch((error) => {
+ logger.error(
+ `${this.logPrefix()} Error while sending '${RequestCommand.METER_VALUES}':`,
+ error
+ );
+ });
+ }, interval);
} else {
logger.error(
`${this.logPrefix()} Charging station ${
});
let uploadResponse: FTPResponse;
if (accessResponse.code === 220) {
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
- ftpClient.trackProgress(async (info) => {
+ ftpClient.trackProgress((info) => {
logger.info(
`${chargingStation.logPrefix()} ${
info.bytes / 1024
} bytes transferred from diagnostics archive ${info.name}`
);
- await chargingStation.ocppRequestService.requestHandler<
- OCPP16DiagnosticsStatusNotificationRequest,
- OCPP16DiagnosticsStatusNotificationResponse
- >(chargingStation, OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION, {
- status: OCPP16DiagnosticsStatus.Uploading,
- });
+ chargingStation.ocppRequestService
+ .requestHandler<
+ OCPP16DiagnosticsStatusNotificationRequest,
+ OCPP16DiagnosticsStatusNotificationResponse
+ >(chargingStation, OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION, {
+ status: OCPP16DiagnosticsStatus.Uploading,
+ })
+ .catch((error) => {
+ logger.error(
+ `${chargingStation.logPrefix()} ${moduleName}.handleRequestGetDiagnostics: Error while sending '${
+ OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION
+ }'`,
+ error
+ );
+ });
});
uploadResponse = await ftpClient.uploadFrom(
path.join(