ChargeLink

Self-test without a device under test

In normal use ChargeLink plays one role against your device under test (DUT). For a self-test it plays both: ChargeLink as charger against ChargeLink as vehicle. Use a self-test to check an installation, to demonstrate a session without customer hardware, to run a regression in CI, or to decide whether a failure with your DUT comes from the ChargeLink side.

$CL   = 'C:\ChargeLink\<VERSION>\charger\bin\chargelink.exe'
$Data = 'C:\ChargeLinkData'

The kit has a charger\ and a vehicle\ folder.

What a self-test proves

ProvesDoes not prove
The installed binary, its license, EXI encoding, V2GTP framing, the TLS stack, the IPv6 or CAN transport between the two roles, and the evidence chain (run folders, manifests, integrity) on this installation.Any behaviour of your DUT, interoperability with equipment from other suppliers, the physical layer (PLC/SLAC, control pilot, power stage) or conformance to a standard.

One PC

These self-tests need no network adapter, no second PC and no hardware.

ISO 15118-20 loopback

Runs ChargeLink as vehicle and ChargeLink as charger on this PC over ::1, with real TCP, V2GTP framing and EXI encoding (no SDP):

chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json evcc local-loopback-policy
chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json evcc local-loopback-smoke `
  --protocol iso15118-20 `
  --profile-id iso15118_20_dc `
  --peer-ipv6 '::1' `
  --tcp-port 50118 `
  --max-steps 6 `
  --battery-model constant_power_reference `
  --battery-capacity-kwh 80 `
  --initial-soc-pct 20 `
  --target-soc-pct 80 `
  --requested-power-kw 50 `
  --battery-step-seconds 1

Expected: "status": "completed"; evse_processed_messages lists SupportedAppProtocolBoundary, SessionSetupReq/Res and ServiceDiscoveryReq/Res; evcc_executed_steps is 6 and the final state of charge moved from 20.0 to about 20.1 %. The artifact list names EXI captures under exi\, JSON-lines traces under traces\ and reports under protocol\. The loopback stops after service discovery by design: it proves transport, framing and EXI encoding on this PC. It is the fastest installation health check and the recommended first step in every support case.

Managed SIL pair through the Integration API

The managed SIL pair runs both roles under the gRPC server over the IPv6 loopback interface, with TLS and EXI, and can be driven from campaigns. Start the server in window 1 and leave it open:

chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" `
  integration serve --listen 127.0.0.1:50051 --state-root "$Data\runtime\integration"

In window 2:

chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json integration health --endpoint http://127.0.0.1:50051
chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json integration sil-smoke --endpoint http://127.0.0.1:50051 `
  --ipv6-host '::1' --interface-index 0 --output "$Data\tests\sil-smoke"

The evidence goes to --output (default .chargelink\integration\sil-smoke). The access token and the other server rules are described in gRPC Integration API.

IEC 61851-23/-24 System A (CHAdeMO) case matrix

The CHAdeMO case-matrix command runs the station, the EV, the simulated plant and a virtual CAN bus on this PC. It is the regression run for CHAdeMO and the first thing to run on a new installation:

chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json dc-can chademo run --cases all --run-id matrix-<DATE>
chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json dc-can chademo run --cases n1,k1,k5b --run-id matrix-quick

Expected with --cases all: exit code 0, "status": "passed", cycles_requested 29, cycles_run 29, cycles_passed 29, cycles_failed 0, cycles_blocked 0; about four minutes. The cases, the repeatability run and the evidence layout are in the CHAdeMO runbook.

Offline: deterministic simulation

A seeded paired simulation runs both roles without sockets and writes a transcript with a SHA-256 hash that a replay must reproduce:

chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json sim paired --protocol iso15118-20 --scenario dc-bpt-nominal --seed 42 `
  --run-id first-sim --write-artifacts --output "$Data\tests\first-sim-report.json"
chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json sim replay --trace "$Data\tests\first-sim-report.json"

Expected: 27 events; transcript SHA-256 d89b78cc48603b4b889d5acf470ed59b86367487f55aef2ca29c3a639c1f05c9; the replay reports "status": "replay_verified" with identical expected_transcript_sha256 and actual_transcript_sha256. See Deterministic Simulation for every scenario.

Two PCs: a charger PC and a vehicle PC

A two-PC self-test puts each role on its own machine, so that discovery, TLS and the session cross a real network link (or a CAN bus). The charger PC uses the charger folder of the kit (charger\); the vehicle PC uses the vehicle folder (vehicle\). Both chargelink.exe copies are byte-identical.

ItemRequirement
LinkOne Ethernet adapter per PC for a direct link, IPv6 enabled; link-local addressing is enough. MCS uses a USB 10BASE-T1S adapter per PC; CHAdeMO uses the network hub or a Kvaser CAN channel per PC plus the network for the plant link.
ReleaseThe same ChargeLink release on both PCs. A charger and a vehicle from different releases refuse each other.
LicenseAn activated license on each PC (Install and Activate).
TLS materialBoth sides from one root. evse tls-material-init --bench-pki on the charger PC generates both identities; copy the three files of its vehicle-side certificate folder to vehicle\tls on the vehicle PC after every generation (TLS and PKI).
FirewallInbound rules for SDP and the session port on the charger PC; outbound rules on the vehicle PC if its firewall filters outbound traffic (Set Up the VeriStand Bench).

Per standard

StandardCharger PCVehicle PCDetails
ISO 15118-20The plant-coupled charger on the NI VeriStand bench: charger\Start-SeccSession.ps1vehicle\Start-Evcc.ps1 (runs evcc activate-profile with the kit's EV cases)NI VeriStand Bench, ISO 15118-20
MCS (ISO 15118-20 over 10BASE-T1S)charger\Start-ChargeLinkVeriStand.ps1 -Stack Mcs, then the operator screenevcc activate-profile --energy-service mcs --mcs-coupler-link ...MCS
ISO 15118-2The plant-coupled DC EIM charger, profile iso15118_2_dc_eim (needs --plant-grpc-endpoint)iso2-evcc; iso2-pki generates the engineering identityISO 15118-2
DIN 70121The plant-coupled DC charger, profile din70121_dc (needs --plant-grpc-endpoint)din-evccDIN 70121
IEC 61851-23/-24 System A (CHAdeMO)dc-can chademo evse: station, simulated plant, CAN hub and plant linkdc-can chademo evCHAdeMO

Example: ISO 15118-20 on the NI VeriStand bench

Charger PC, in C:\ChargeLink\<VERSION>\charger:

powershell -NoProfile -ExecutionPolicy Bypass -File .\Start-SeccSession.ps1

It prints the run folder, validates the configuration and prints Starting the owner host together with the vehicle-PC command line. The host waits up to 120 s for the vehicle.

Vehicle PC, in the vehicle folder, as soon as the charger PC prints that line:

powershell -NoProfile -ExecutionPolicy Bypass -File .\Start-Evcc.ps1 -PeerIpv6 <SECC link-local address> -InterfaceAlias '<vehicle PC adapter>'

The vehicle ends the session itself after its charge loop. Judge the result from the run folder on the charger PC, not from the exit codes (Reading the result).

Example: ISO 15118-2 and DIN 70121 vehicle side

With the plant-coupled charger listening on the charger PC, run on the vehicle PC:

$IfIndex   = <INTERFACE_INDEX>
$Advertise = 'fe80::<CHARGER_PC_ADDRESS>%' + $IfIndex

chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json iso2-evcc --sdp-server "[$Advertise]:15118" --tls --tls-root "$Data\pki\iso2\private-root.pem" `
  --current-demands 20 --period-ms 50 --target-voltage-v 400 --target-current-a 100 --run-id iso2-ev-<DATE>

chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json din-evcc --sdp-server "[$Advertise]:15118" `
  --current-demands 20 --period-ms 150 --target-voltage-v 400 --target-current-a 100 --run-id din-ev-<DATE>

The zone index after % is the vehicle PC's own interface index. The options are described in the ISO 15118-2 and DIN 70121 runbooks.

Example: CHAdeMO over the network hub

Charger PC (replace the address with the charger PC's IPv4 address on the link):

chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json dc-can chademo evse --hub-bind 192.0.2.10:47100 --plant-link-bind 192.0.2.10:47101 --allow-network `
  --cases n1,n2,k1,k5b --sessions 1 --ev-wait-s 600 --run-id chademo-charger-<DATE>

Vehicle PC:

chargelink --runtime-root "$Data\runtime" --artifact-root "$Data\artifacts" --json dc-can chademo ev --hub 192.0.2.10:47100 --plant-link 192.0.2.10:47101 `
  --sessions 4 --connect-wait-s 600 --run-id chademo-vehicle-<DATE>

The station decides which case runs in each session and tells the EV through the plant link, so the vehicle PC needs no case list. Open TCP 47100 and 47101 on the charger PC for the vehicle PC's address only. On a PC with Docker Desktop or WSL, Windows can reserve these ports; the runbook names other ports to use. The Kvaser CAN variant uses --can-backend kvaser --kvaser-channel 0 on both sides (CHAdeMO runbook).

Self-tests in CI

  • Run the one-PC self-tests (loopback, managed SIL pair, CHAdeMO case matrix, deterministic simulation) on the build agent with explicit --runtime-root and --artifact-root folders inside the job's workspace, and keep the artifact root as the job's artifact.
  • Judge each step on the status field of its JSON result, not on the exit code alone; several commands exit 0 when they ran, whatever the verdict.
  • Check the evidence with chargelink --json artifacts integrity --run-id <RUN_ID>, and compare deterministic transcript hashes with the stored values of your golden reference runs.
  • Give each job its own runtime root: only one charger session and one vehicle session can be live per runtime root.
  • Commands that need an entitlement need an activated license on the build agent, as on any ChargeLink PC.

After a passing self-test, return to your DUT: ChargeLink as Charger or ChargeLink as Vehicle.