[ocpp] Recover connectors stuck in Finishing or Faulted#151
Open
stamateviorel wants to merge 2 commits into
Open
[ocpp] Recover connectors stuck in Finishing or Faulted#151stamateviorel wants to merge 2 commits into
stamateviorel wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A connector can hang in
Finishing(a transaction that never tears down) orFaulted, 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 →UnlockConnectorwith 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.SuspendedEVSEis 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).