Fixed Transaction ID retrieved from connector
MODIFY
src/server/ocpp/validator/OCPPValidator.ts
src/server/ocpp/validator/OCPPValidator.ts
@@ -137,7 +137,7 @@ export default class OCPPValidator extends SchemaValidator {
// Transaction ID is provided on Connector
if (foundConnector?.currentTransactionID > 0) {
// Check if provided in Meter Values
- if (Utils.isNullOrUndefined(meterValues.transactionId) && foundConnector.currentTransactionID > 0) {
+ if (meterValues.transactionId === 0 && foundConnector.currentTransactionID > 0) {
// Reuse Transaction ID from Connector
meterValues.transactionId = foundConnector.currentTransactionID;
await Logging.logWarning({
@@ -145,7 +145,7 @@ export default class OCPPValidator extends SchemaValidator {
tenantID: tenantID,
module: MODULE_NAME, method: 'validateMeterValues',
action: ServerAction.OCPP_METER_VALUES,
- message: `Transaction ID '${meterValues.transactionId}' not found in Meter Values but retrieved from Connector '${foundConnector.currentTransactionID}'`
+ message: `Transaction ID '${meterValues.transactionId}' not found in Meter Values but retrieved from Connector ID '${foundConnector.connectorId}'`
});
}
}

Fixed Transaction ID retrieved from connector