Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not StartTransaction #51

Open
JPFarber55 opened this issue May 15, 2024 · 0 comments
Open

Can not StartTransaction #51

JPFarber55 opened this issue May 15, 2024 · 0 comments

Comments

@JPFarber55
Copy link

Hello,
I have some issues when try to StartTransaction, becuase StopTransaction Send me "DeAuthorized"
How can I resolve it?
This are my requests, responses and Code:

req = {
action: 'BootNotification',
ocppVersion: 'v1.6-json',
chargePointModel: 'CDT_TACW7::NET_WIFI',
chargePointVendor: 'ABB',
chargeBoxSerialNumber: 'TACW74',
firmwareVersion: 'TAC1Z9120',
meterType: 'V1'
}
chargePointId = TACW74
ret = {
action: 'BootNotification',
ocppVersion: 'v1.6-json',
status: 'Accepted',
interval: 1440,
currentTime: '2024-05-15T17:04:52.021Z'
}

req = {
action: 'StatusNotification',
ocppVersion: 'v1.6-json',
connectorId: 0,
errorCode: 'NoError',
info: 'null',
status: 'Available',
vendorErrorCode: '0x0000'
}
chargePointId = TACW74
ret = { action: 'StatusNotification', ocppVersion: 'v1.6-json' }

req = {
action: 'StatusNotification',
ocppVersion: 'v1.6-json',
connectorId: 1,
errorCode: 'NoError',
info: 'null',
status: 'Preparing',
vendorErrorCode: '0x0000'
}
chargePointId = TACW74
ret = { action: 'StatusNotification', ocppVersion: 'v1.6-json' }

req = { action: 'Authorize', ocppVersion: 'v1.6-json', idTag: '6CD98725' }
chargePointId = TACW74
ret = { idTagInfo: { status: 'Accepted' } }

req = {
action: 'StatusNotification',
ocppVersion: 'v1.6-json',
connectorId: 1,
errorCode: 'NoError',
info: 'null',
status: 'SuspendedEV',
vendorErrorCode: '0x0000'
}
chargePointId = TACW74
ret = { action: 'StatusNotification', ocppVersion: 'v1.6-json' }

req = {
action: 'StatusNotification',
ocppVersion: 'v1.6-json',
connectorId: 1,
errorCode: 'NoError',
info: 'null',
status: 'Charging',
vendorErrorCode: '0x0000'
}
chargePointId = TACW74
ret = { action: 'StatusNotification', ocppVersion: 'v1.6-json' }

req = {
action: 'StartTransaction',
ocppVersion: 'v1.6-json',
connectorId: 1,
idTag: '6CD98725',
meterStart: 0,
timestamp: '2024-05-15T17:05:12.000Z'
}
chargePointId = TACW74
ret = {
action: 'StartTransaction',
ocppVersion: 'v1.6-json',
idTagInfo: { satus: 'Accepted' },
transactionId: 739831
}

req = {
action: 'StatusNotification',
ocppVersion: 'v1.6-json',
connectorId: 1,
errorCode: 'NoError',
info: 'null',
status: 'SuspendedEVSE',
vendorErrorCode: '0x0000'
}
chargePointId = TACW74
ret = { action: 'StatusNotification', ocppVersion: 'v1.6-json' }

req = {
action: 'StatusNotification',
ocppVersion: 'v1.6-json',
connectorId: 1,
errorCode: 'NoError',
info: 'null',
status: 'Finishing',
vendorErrorCode: '0x0000'
}
chargePointId = TACW74
ret = { action: 'StatusNotification', ocppVersion: 'v1.6-json' }

req = {
action: 'StopTransaction',
ocppVersion: 'v1.6-json',
meterStop: 0,
idTag: '6CD98725',
timestamp: '2024-05-15T17:05:14.000Z',
transactionId: 739831,
reason: 'DeAuthorized'
}
chargePointId = TACW74
ret = {
action: 'StopTransaction',
ocppVersion: 'v1.6-json',
idTagInfo: { satus: 'Accepted' }
}

req = {
action: 'StatusNotification',
ocppVersion: 'v1.6-json',
connectorId: 1,
errorCode: 'NoError',
info: 'null',
status: 'Preparing',
vendorErrorCode: '0x0000'
}
chargePointId = TACW74
ret = { action: 'StatusNotification', ocppVersion: 'v1.6-json' }

This is my code:

    this.centralSystem = new CentralSystem(8100, (req, { chargePointId }) => {
      console.log('\n\n');
      console.log('req =', req);
      console.log('chargePointId =', chargePointId);
      let ret;

      switch (req.action) {
        case 'Heartbeat':
          ret = {
            action: req.action,
            ocppVersion: req.ocppVersion,
            currentTime: new Date().toISOString(),
          };
          break;
        case 'BootNotification':
          ret = {
            action: req.action,
            ocppVersion: req.ocppVersion,
            status: 'Accepted',
            interval: 1440,
            currentTime: new Date().toISOString(),
          };
          break;
        case 'StatusNotification':
          ret = {
            action: req.action,
            ocppVersion: req.ocppVersion,
          };
          break;
        case 'Authorize':
          ret = {
            idTagInfo: {
              status: 'Accepted',
            },
          };
          break;
        case 'StartTransaction':
          this.gTransactionId = this.getRandomNumber();
          ret = {
            action: req.action,
            ocppVersion: req.ocppVersion,
            idTagInfo: {
              satus: 'Accepted',
            },
            transactionId: this.gTransactionId,
          };
          break;
        case 'StopTransaction':
          ret = {
            action: req.action,
            ocppVersion: req.ocppVersion,
            idTagInfo: {
              satus: 'Accepted',
            },
          };
          break;
        case 'MeterValues':
          ret = {
            action: req.action,
            ocppVersion: req.ocppVersion,
          };
          break;
        default:
          throw new Error('message not supported');
      }

      console.log('ret =', ret);

      return ret;
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant