"enable": true,
"minDuration": 60,
"maxDuration": 80,
- "minDelayBetweenTwoTransaction": 15,
- "maxDelayBetweenTwoTransaction": 30,
+ "minDelayBetweenTwoTransactions": 15,
+ "maxDelayBetweenTwoTransactions": 30,
"probabilityOfStart": 1,
"stopAfterHours": 0.3,
"stopOnConnectionFailure": true
"enable": false,
"minDuration": 60,
"maxDuration": 80,
- "minDelayBetweenTwoTransaction": 15,
- "maxDelayBetweenTwoTransaction": 30,
+ "minDelayBetweenTwoTransactions": 15,
+ "maxDelayBetweenTwoTransactions": 30,
"probabilityOfStart": 1,
"stopAfterHours": 0.3,
"stopOnConnectionFailure": false
"enable": false,
"minDuration": 30,
"maxDuration": 60,
- "minDelayBetweenTwoTransaction": 15,
- "maxDelayBetweenTwoTransaction": 30,
+ "minDelayBetweenTwoTransactions": 15,
+ "maxDelayBetweenTwoTransactions": 30,
"probabilityOfStart": 1,
"stopAfterHours": 0.3,
"stopOnConnectionFailure": false
"enable": false,
"minDuration": 60,
"maxDuration": 80,
- "minDelayBetweenTwoTransaction": 15,
- "maxDelayBetweenTwoTransaction": 30,
+ "minDelayBetweenTwoTransactions": 15,
+ "maxDelayBetweenTwoTransactions": 30,
"probabilityOfStart": 1,
"stopAfterHours": 0.3,
"stopOnConnectionFailure": false
"enable": false,
"minDuration": 60,
"maxDuration": 80,
- "minDelayBetweenTwoTransaction": 15,
- "maxDelayBetweenTwoTransaction": 30,
+ "minDelayBetweenTwoTransactions": 15,
+ "maxDelayBetweenTwoTransactions": 30,
"probabilityOfStart": 1,
"stopAfterHours": 0.3,
"stopOnConnectionFailure": false
"enable": false,
"minDuration": 60,
"maxDuration": 80,
- "minDelayBetweenTwoTransaction": 15,
- "maxDelayBetweenTwoTransaction": 30,
+ "minDelayBetweenTwoTransactions": 15,
+ "maxDelayBetweenTwoTransactions": 30,
"probabilityOfStart": 1,
"stopAfterHours": 0.3,
"stopOnConnectionFailure": false
"enable": true,
"minDuration": 60,
"maxDuration": 80,
- "minDelayBetweenTwoTransaction": 15,
- "maxDelayBetweenTwoTransaction": 30,
+ "minDelayBetweenTwoTransactions": 15,
+ "maxDelayBetweenTwoTransactions": 30,
"probabilityOfStart": 1,
"stopAfterHours": 0.3,
"stopOnConnectionFailure": false
"enable": false,
"minDuration": 60,
"maxDuration": 80,
- "minDelayBetweenTwoTransaction": 15,
- "maxDelayBetweenTwoTransaction": 30,
+ "minDelayBetweenTwoTransactions": 15,
+ "maxDelayBetweenTwoTransactions": 30,
"probabilityOfStart": 1,
"stopAfterHours": 0.3,
"stopOnConnectionFailure": false
"enable": false,
"minDuration": 60,
"maxDuration": 80,
- "minDelayBetweenTwoTransaction": 15,
- "maxDelayBetweenTwoTransaction": 30,
+ "minDelayBetweenTwoTransactions": 15,
+ "maxDelayBetweenTwoTransactions": 30,
"probabilityOfStart": 1,
"stopAfterHours": 0.3,
"stopOnConnectionFailure": false
async startConnector(connectorId) {
do {
- const wait = Utils.getRandomInt(this._chargingStation._stationInfo.AutomaticTransactionGenerator.maxDelayBetweenTwoTransaction,
- this._chargingStation._stationInfo.AutomaticTransactionGenerator.minDelayBetweenTwoTransaction) * 1000;
+ const wait = Utils.getRandomInt(this._chargingStation._stationInfo.AutomaticTransactionGenerator.maxDelayBetweenTwoTransactions,
+ this._chargingStation._stationInfo.AutomaticTransactionGenerator.minDelayBetweenTwoTransactions) * 1000;
logger.info(this._basicFormatLog(connectorId) + ' wait for ' + Utils.secondstoHHMMSS(wait / 1000));
await Utils.sleep(wait);
if (this._timeToStop) break;
onOpen() {
logger.info(`${this._basicFormatLog()} Is connected to server through ${this._url}`);
+ if (!this._heartbeatInterval) {
+ // Send BootNotification
+ try {
+ this.sendMessage(Utils.generateUUID(), this._bootNotificationMessage, Constants.OCPP_JSON_CALL_MESSAGE, 'BootNotification');
+ } catch (error) {
+ logger.error(this._basicFormatLog() + ' Send boot notification error: ' + error);
+ }
+ }
if (this._isSocketRestart) {
this._basicStartMessageSequence();
if (this._messageQueue.length > 0) {
}
});
}
- } else {
- // At first start, send BootNotification
- try {
- this.sendMessage(Utils.generateUUID(), this._bootNotificationMessage, Constants.OCPP_JSON_CALL_MESSAGE, 'BootNotification');
- } catch (error) {
- logger.error(this._basicFormatLog() + ' Send boot notification error: ' + error);
- }
}
this._autoReconnectRetryCount = 0;
this._isSocketRestart = false;
// eslint-disable-next-line class-methods-use-this
async _startHeartbeat(self) {
if (self._heartbeatInterval && !self._heartbeatSetInterval) {
- logger.info(self._basicFormatLog() + ' Heartbeat started every ' + self._heartbeatInterval + 'ms');
self._heartbeatSetInterval = setInterval(() => {
try {
const payload = {
logger.error(self._basicFormatLog() + ' Send heartbeat error: ' + error);
}
}, self._heartbeatInterval);
+ logger.info(self._basicFormatLog() + ' Heartbeat started every ' + self._heartbeatInterval + 'ms');
} else {
logger.error(self._basicFormatLog() + ' Heartbeat interval undefined, not starting the heartbeat');
}