Skip to content

Fix RFID an der Duo - #4205

Open
AlexanderHa98 wants to merge 4 commits into
openWB:masterfrom
AlexanderHa98:fix_rfid_duo
Open

AlexanderHa98 wants to merge 4 commits into
openWB:masterfrom
AlexanderHa98:fix_rfid_duo

Conversation

@AlexanderHa98

@AlexanderHa98 AlexanderHa98 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Prevent stale shared-reader RFID scans from unlocking the wrong Duo chargepoint while preserving valid assignments across charging and reconnect cycles.

New Features:

  • Track RFID scan timestamps across internal and external chargepoint interfaces.

Bug Fixes:

  • Prevent stale or replayed RFID scans from incorrectly unlocking the wrong chargepoint in Duo configurations.
  • Preserve chargepoint RFID assignments and charging state correctly across unplugging, timeouts, rejected scans, and new scans.

Enhancements:

  • Refine Duo RFID targeting, validation, autolock handling, vehicle selection, and transaction handling for shared readers.
  • Extend MQTT configuration, validation, state storage, and publication for RFID timestamps.
  • Add comprehensive coverage for Duo RFID assignment, replay prevention, timeout behavior, ordering, and lifecycle scenarios.

Tests:

  • Add extensive regression tests covering shared-reader timestamp handling and Duo chargepoint RFID behavior.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

RFID routing can assign a shared scan to an actively charging outlet with an unchanged meter reading and discard a valid scan during unplug cleanup, requiring fixes to connector eligibility.

2 open issues
What changed in this PR

This PR updates shared RFID handling for Duo chargepoints so scans are assigned to a single outlet and only committed tags authorize charging.

Changes:

  • Adds Duo target selection, shared scan cleanup, and validation logic.
  • Uses committed RFID assignments for Duo locking, vehicle selection, and OCPP transactions.
  • Expands regression tests for scan timing, outlet selection, authorization, and cleanup.
File Description
packages/​control/​chargepoint/​rfid.py Implements Duo scan routing, validation, and shared cleanup.
packages/​control/​chargepoint/​rfd_test.py Adds parameterized Duo RFID and control-cycle regression tests.
packages/​control/​chargepoint/​chargepoint.py Integrates committed Duo tags into authorization, vehicle selection, and transactions.

Review effort: Balanced

Comment thread packages/control/chargepoint/rfid.py Resolved
Comment thread packages/control/chargepoint/rfid.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@LKuemmel LKuemmel mentioned this pull request Nov 4, 2026
5 of 10 tasks

@LKuemmel LKuemmel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im Hardware-Test wurde auch der zweite LP freigeschaltet.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical RFID state-handling defects can commit the wrong card, release a connector on a stale scan, and start a new OCPP transaction after unplugging without a new scan.

4 open issues
2 resolved since last review

Review effort: Balanced

if self.data.config.ocpp_chargebox_id:
# Starte nur Transaction wenn bereits ein RFID Tag oder die Fahrzeug ID erkannt wurde
if (self.data.set.rfid or self.data.get.rfid or self.data.get.vehicle_id):
if (rfid or self.data.get.vehicle_id):
Comment on lines +79 to +80
if not newer_scan_waiting:
self.chargepoint_module.clear_rfid()
Comment on lines +132 to 134
Pub().pub("openWB/set/internal_chargepoint/last_tag_timestamp",
timecheck.create_timestamp())
Pub().pub("openWB/set/internal_chargepoint/last_tag", key_string)
Comment thread packages/control/chargepoint/rfid.py Outdated
Comment on lines +55 to +56
if rfid_timestamp is not None and max(t1, t2) > rfid_timestamp:
return first if t1 < t2 else second
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants