Skip to content

[ocpp] Recover connectors stuck in Finishing or Faulted#151

Open
stamateviorel wants to merge 2 commits into
ConnectorIO:masterfrom
stamateviorel:pr/14-stuck-watchdog
Open

[ocpp] Recover connectors stuck in Finishing or Faulted#151
stamateviorel wants to merge 2 commits into
ConnectorIO:masterfrom
stamateviorel:pr/14-stuck-watchdog

Conversation

@stamateviorel

Copy link
Copy Markdown
Collaborator

A connector can hang in Finishing (a transaction that never tears down) or Faulted, blocking every new session until someone physically unplugs the cable. Phoenix Contact CHARX SEC-3xxx is prone to the Finishing hang.

A per-connector watchdog ticks every 5s and escalates while a connector stays stuck: 20s → TriggerMessage(StatusNotification), 40s → ChangeAvailability(Inoperative→Operative), 60s → UnlockConnector with a loud error. A legitimate teardown — Finishing within 5 min of a real Charging session — is handled gently: the ChangeAvailability cycle is skipped (it would break the charger's natural wind-down) and the unlock deferred to 180s, so a normal Wallbox Pulsar Plus teardown (30-90s) never triggers an aggressive reset. SuspendedEVSE is left alone because it is usually a deliberate pause. Decision logic is isolated for unit testing; the handler owns the timer and recovery CALLs.

Stacks on #141 (uses the RemoteTrigger profile it registers).

stamateviorel and others added 2 commits May 28, 2026 20:50
When a charger reconnects to a CSMS that already has Things defined for
it, those Things currently sit at NULL until the next charger-initiated
event. Ask the charger to re-emit its current StatusNotification and
BootNotification right after registerSession, so the state is populated
within seconds of connect rather than minutes.

Verified live against Wallbox Copper SB, Wallbox Pulsar Plus (both FW
6.7.38) and Phoenix Contact CHARX SEC-3xxx (FW 1.9.0) — all three honour
the TriggerMessage. Chargers that don't support it respond NotImplemented;
the trigger then becomes a no-op.

Signed-off-by: Stamate Viorel <stamate.viorel@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
A connector can hang in Finishing (a transaction that never tears down)
or Faulted, blocking every new session until someone physically unplugs
the cable. Phoenix Contact CHARX SEC-3xxx is prone to the Finishing hang.

A per-connector watchdog ticks every 5s and escalates while a connector
stays stuck: 20s → TriggerMessage(StatusNotification), 40s →
ChangeAvailability(Inoperative→Operative), 60s → UnlockConnector with a
loud error. A legitimate teardown — Finishing within 5 min of a real
Charging session — is handled gently: the ChangeAvailability cycle is
skipped (it would break the charger's natural wind-down) and the unlock
is deferred to 180s, so a normal Wallbox Pulsar Plus teardown (30-90s)
never triggers an aggressive reset. SuspendedEVSE is left alone because
it is usually a deliberate pause.

The escalation decision is isolated in StuckStateWatchdog for unit
testing; ConnectorThingHandler owns the timer and the recovery CALLs.
Uses the RemoteTrigger profile registered in ConnectorIO#141.

Verified against CHARX SEC-3xxx (FW 1.9.0) stuck-Finishing recovery and
Wallbox Pulsar Plus (FW 6.7.38) legitimate teardown (no false reset).

Signed-off-by: Stamate Viorel <stamate.viorel@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant