Skip to content
StuntCharger

CI runner run the CSMS self-check from your pipeline.

A single-file Node command runs the same scenarios as the self-check in the simulator, headless, through the hosted relay. It prints one line per scenario, writes an HTML and a JSON report, and exits non-zero when a scenario fails.

Set up

  1. 1

    Create an API key

    On your Account page, create a key. It is shown once; store it as a CI secret named STUNTCHARGER_API_KEY. Keys need the Team plan or higher (pricing) and work only for the relay.
  2. 2

    Download the runner

    Get stuntcharger-selfcheck.mjs and run it with Node 20 or later. It has no dependencies.
  3. 3

    Run it against your CSMS

    Give it your CSMS URL, a charge point id registered there, the OCPP version and an idTag your CSMS accepts. The relay connects from the internet, so use a deployed or staging CSMS URL: a CSMS started inside the CI job (localhost or a service container) cannot be reached. If your CSMS filters by source address, allowlist the relay first (see the relay guide).
shell
curl -fsSLO https://stuntcharger.com/cli/stuntcharger-selfcheck.mjs
STUNTCHARGER_API_KEY=sck_... node stuntcharger-selfcheck.mjs \
  --csms wss://csms.example.com/ocpp --id SC-CI-01 --version ocpp1.6 --tag 04A1B2C3

GitHub Actions

.github/workflows/csms-selfcheck.yml
name: CSMS self-check
on: [push]
jobs:
  selfcheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: curl -fsSLO https://stuntcharger.com/cli/stuntcharger-selfcheck.mjs
      - run: >-
          node stuntcharger-selfcheck.mjs
          --csms wss://csms-staging.example.com/ocpp
          --id SC-CI-01 --version ocpp2.0.1 --tag 04A1B2C3
          --out selfcheck
        env:
          STUNTCHARGER_API_KEY: ${{ secrets.STUNTCHARGER_API_KEY }}
          STUNTCHARGER_CSMS_PASSWORD: ${{ secrets.CSMS_PASSWORD }}
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: csms-selfcheck
          path: selfcheck.*

Flags

--csms <url>CSMS WebSocket URL (ws:// or wss://) without the charge point id. Required.
--id <id>Charge point id registered in your CSMS. Required.
--version <v>ocpp1.6 or ocpp2.0.1. Required.
--tag <idTag>An idTag your CSMS accepts. Required.
--invalid-tag <idTag>An idTag your CSMS does not know. Default: random.
--password <pw>Basic Auth password; the user is the charge point id. Or set STUNTCHARGER_CSMS_PASSWORD, which keeps it out of the command line.
--scenarios <ids>Comma-separated scenario ids. Default: every scenario for the version that is not opt-in.
--operator-cmd <cmd>Shell command for operator steps (below). Without it, operator scenarios are left out of the default set.
--out <prefix>Writes <prefix>.json and <prefix>.html. Default: stuntcharger-selfcheck.
--server <url>StuntCharger server. Default: https://stuntcharger.com.
--helpPrints usage.

Exit codes

0No scenario failed (warnings and inconclusive checks do not fail the run).
1At least one scenario failed.
2Usage error, or the relay refused the connection: an invalid or revoked key (4401), a plan without the scenario runner or Terms not accepted (4403), or the concurrent charger limit (4429). The reason is printed.
3The CSMS (or the relay) could not be reached.

Operator steps

Some scenarios need your CSMS to send a command, such as a remote start or a configuration change. In the simulator you click it in your CSMS; in CI, --operator-cmd runs a shell command of yours for each such step, which triggers it through your CSMS's API.

The command gets the environment variable SC_STEP with JSON {scenarioId, expect, say, copy}: expect is the OCPP action the charger waits for, say the instruction, and copy the values to use (connector id, idTag, transaction id). Exit 0 when you sent the command; any other exit code skips the step.

operator hook
node stuntcharger-selfcheck.mjs ... --operator-cmd 'node trigger.mjs'
# trigger.mjs reads JSON.parse(process.env.SC_STEP) and calls your CSMS API

What a result means

Self-check run by StuntCharger's simulated charging station, using StuntCharger's own scenarios written from the OCPP specifications. Not OCTT, not lab-tested, not certified, and not evidence of certification. A pass means the observed messages met the listed checks on this date in this configuration.