Skip to content

fix(opcua): run a fault manager in the OpenPLC tank demo - #683

Merged
bburda merged 0 commit into
fix/persist-entity-freeze-framesfrom
fix/opcua-demo-runs-a-fault-manager
Nov 17, 2026
Merged

bburda merged 0 commit into
fix/persist-entity-freeze-framesfrom
fix/opcua-demo-runs-a-fault-manager

Conversation

@bburda

@bburda bburda commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

The plugin's start.sh started OpenPLC and one gateway container and no fault manager, so the demo the README describes could not confirm a fault: GET /api/v1/faults answered 503 ListFaults service not available, and a PLC alarm waited in the plugin's report buffer for a service that never came.

start.sh now runs fault_manager_node in the gateway container before gateway_node, waits for /fault_manager/report_fault, and logs it to /var/lib/ros2_medkit/fault_manager.log. The fault manager's state sits under /var/lib/ros2_medkit, the named volume from #680, so faults, freeze frames and recordings survive stop.sh and start.sh together. The image is unchanged. test_all.sh, the test scripts and the CI workflow are untouched.

Stacked on #680.

Issue

Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

Shell and docs only, so the evidence is the demo run, base against branch.

Base: start.sh, GET /api/v1/faults answers 503 ListFaults service not available. Driving tank_temperature to 95 raises the alarm on x-plc-status and the fault list stays empty, no faults.db on the volume.

Branch: GET /api/v1/faults answers 200. The same write confirms PLC_HIGH_TEMP within 2 s, and the fault detail carries a freeze_frame with tank_temperature at 95. After stop.sh and start.sh the same detail is served with the same captured_at while the live PLC reads 25 °C. After the documented purge the fault is gone and the list is empty.

Injected failure: a directory in place of faults.db makes the fault manager abort, and start.sh exits 1 naming the missing service and printing the log tail.

shellcheck and pre-commit pass.

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

@bburda bburda self-assigned this Sep 10, 2026
@bburda
bburda force-pushed the fix/opcua-demo-runs-a-fault-manager branch from 90b3ddf to 7bfc266 Compare November 17, 2026 08:47
@bburda
bburda merged commit 7bfc266 into fix/persist-entity-freeze-frames Nov 17, 2026
@bburda
bburda force-pushed the fix/persist-entity-freeze-frames branch from b4bf815 to 016a68e Compare November 17, 2026 08:49
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.

1 participant