Problem
Drivers cannot stop an OCPP 1.6 session from the portal. The station receives the OCPP 2.1 command as is:
[2, "…", "RequestStopTransaction", {"transactionId": "4"}]
and a KEBA KC-P30 answers CALLERROR InternalError.
sendOcppCommandAndWait() forwards its optional version to the command listener, which then dispatches the command unchanged (dispatcher.sendCommand), because a caller passing a version is expected to send a version-native payload. Without a version the listener uses sendVersionAwareCommand, which translates RequestStopTransaction to RemoteStopTransaction with an integer transactionId for 1.6 stations.
Several callers build OCPP 2.1 payloads but still pass the station protocol:
- portal start and stop (
routes/portal/charger.ts: start, TxInProgress recovery stop and retry start, session stop),
- guest start (
routes/portal/guest.ts),
- stop of an active session from the CSMS (
routes/stations.ts, POST /stations/:id/evses/:evseId/stop-active-session),
SendLocalList (routes/local-auth-list.ts, whose comment already says "2.1 format; command-translation handles 1.6").
So remote start, remote stop and the local list do not work with OCPP 1.6 stations from these paths.
Proposed fix (PR follows)
Do not pass the version from these callers so the existing translation applies. triggerAndWaitForStatus() builds a version-native payload and keeps passing it. Document the version parameter.
Problem
Drivers cannot stop an OCPP 1.6 session from the portal. The station receives the OCPP 2.1 command as is:
and a KEBA KC-P30 answers
CALLERROR InternalError.sendOcppCommandAndWait()forwards its optionalversionto the command listener, which then dispatches the command unchanged (dispatcher.sendCommand), because a caller passing a version is expected to send a version-native payload. Without a version the listener usessendVersionAwareCommand, which translatesRequestStopTransactiontoRemoteStopTransactionwith an integertransactionIdfor 1.6 stations.Several callers build OCPP 2.1 payloads but still pass the station protocol:
routes/portal/charger.ts: start, TxInProgress recovery stop and retry start, session stop),routes/portal/guest.ts),routes/stations.ts,POST /stations/:id/evses/:evseId/stop-active-session),SendLocalList(routes/local-auth-list.ts, whose comment already says "2.1 format; command-translation handles 1.6").So remote start, remote stop and the local list do not work with OCPP 1.6 stations from these paths.
Proposed fix (PR follows)
Do not pass the version from these callers so the existing translation applies.
triggerAndWaitForStatus()builds a version-native payload and keeps passing it. Document theversionparameter.