Repository navigation
P0: ESP32-P4 autonomous SV/PTP publishing independent of Studio USB lease #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
masarray
merged 29 commits into
main
from
fix/p0-board-autonomous-sv-ptp-ethernet-ownership-20261025
Oct 25, 2026
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
48f7323
fix(p0): decouple autonomous SV publisher from USB heartbeat lease ex…
masarray 124991e
fix(ui): leave running SV/PTP untouched on Studio process shutdown
masarray cbb9d5f
fix(p0): asynchronous PTP teardown on Ethernet link down; preserve SV…
masarray a7c5079
fix(p0): asynchronous PTP teardown on Ethernet link down; preserve SV…
masarray 11781ad
fix(p0): asynchronous PTP teardown on Ethernet link down; preserve SV…
masarray 41a0db1
test(p0): guard autonomous SV/PTP control-plane and Ethernet fault ow…
masarray c7c27ec
ci(p0): enforce autonomous SV/PTP runtime contract on every firmware …
masarray 9196d0f
docs(p0): specify autonomous data-plane ownership and USB/LAN physica…
masarray 1ef68ed
fix(ptp): remove teardown task-handle race from Ethernet event callback
masarray 3a9585c
docs(p0): distinguish bounded PTP boot-source link recovery from forb…
masarray da4cd44
test(ui): replace obsolete fail-closed USB shutdown contract with aut…
masarray a073bfd
feat(p0): add authoritative Ethernet physical-link STOP provenance
masarray 8452820
feat(p0): add authoritative Ethernet physical-link STOP provenance
masarray c207df8
fix(p0): stop SV immediately on physical LAN-loss edge with explicit …
masarray f8bc9a4
fix(p0): wire physical Ethernet down edge into immediate SV STOP, tas…
masarray 5459849
test(p0): require physical Ethernet-down edge to produce immediate pe…
masarray d14e647
docs(p0): state immediate PHY-link SV STOP plus retained TX driver fa…
masarray b4d4497
ui(p0): show explicit physical LAN-loss STOP cause instead of generic…
masarray 9c15704
fix(ui): correct QML newline after physical Ethernet STOP caption
masarray ca3c5b5
docs(code): remove stale USB heartbeat fail-stop comments after board…
masarray 88c7ab3
fix(ptp): provide separate nonblocking SOURCE and receiver/monitor LA…
masarray e47fcd0
fix(ptp): provide separate nonblocking SOURCE and receiver/monitor LA…
masarray cbbfc07
fix(ptp): provide separate nonblocking SOURCE and receiver/monitor LA…
masarray 2ecda21
fix(ptp): role-aware nonblocking PHY-fault cancellation and boot auto…
masarray ffe62a6
fix(phy): latch only genuine UP-to-DOWN event, preserving no-LAN boot…
masarray 6e8da9a
test(p0): enforce role-aware PTP cancellation and physical PHY cycle …
masarray b24ab28
docs(p0): reflect fail-closed all-role LAN fault and explicit PTP res…
masarray 06e4dd0
fix(ptp): prevent in-flight SOURCE/RECEIVER START from surviving PHY …
masarray c9f1e99
test(p0): guard PTP START versus concurrent Ethernet physical fault c…
masarray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # ESP32-P4 autonomous publishing — field P0 contract | ||
|
|
||
| The ESP32-P4 owns the IEC 61850 SV and PTP data plane. ARStack Studio owns **operator commands and observability**, not the continuous eligibility to transmit. | ||
|
|
||
| ## Transitions | ||
|
|
||
| | Event | ESP32-P4 SV | ESP32-P4 PTP | Studio on reconnect | | ||
| | --- | --- | --- | --- | | ||
| | Verified operator START + successful CFG commit/readback, physical Ethernet UP | RUNNING at configured grid | Unchanged according to board PTP role | Reads real state with SHOW; never re-START just to discover | | ||
| | Studio closes, crashes, USB COM15 temporarily disappears or heartbeat expires | **Continue RUNNING** with last verified RAM scenario | **Continue** in currently configured role | UI says disconnected; board is NOT asserted STOPPED | | ||
| | Studio returns with a verified same board/boot | Unchanged until operator explicitly commands | Unchanged | Reconcile via identity + SHOW / SVLIFE + PTP readback, no guessed READY/STOP or unsolicited profile replacement | | ||
| | User clicks SV STOP | Explicit STOP suppresses SV publisher | Unchanged (independent PTP control) | Verified STOP readback; GUI STOP is not treated as USB disconnect | | ||
| | User clicks PTP STOP | Unchanged | Explicit PTP STOP | Verified PTP stopped readback | | ||
| | Physical Ethernet link drops | Ethernet DISCONNECTED event immediately latches explicit `ETHERNET_LINK_DOWN` SV STOP; the separate 400-consecutive-driver-TX-failure guard remains for faults even when PHY reports UP | Ethernet callback sets a nonblocking atomic PTP teardown request; task polls within 5 ms and owns EMAC cleanup; after a verified LAN fault, boot PTP autostart is latched OFF until reboot; explicit operator PTP START may re-enable the selected role | Reports actual fault/stop reason once available; **never** auto-resumes a physical fault | | ||
| | Ethernet returns after fault | Remains STOPPED until fresh verified operator START | Reconfiguration/start must satisfy existing PTP policy | Readback first; never auto-START SV. PTP SOURCE, TIME_RECEIVER, and MONITOR remain STOPPED after the LAN-loss fault until explicit operator restart | | ||
| | Board power cycle | No automatic restored SV RUN from PC draft | Compiled isolated-lab boot policy; not a claim of external GM lock | Check new boot ID, firmware compatibility and verified scenario before START | | ||
|
|
||
| Scope: isolated process-bus laboratory only. This deliberately does **not** persist a RUNNING command to flash/NVS or restart an injector after a power loss, nor does it disable the canonical TX fail-closed protection, PTP lease validity checks, or actual operator STOP. | ||
|
|
||
| The old `SESSION-LEASE` capability name is retained for wire-protocol interoperability with existing Studio versions; its heartbeat is now **diagnostic** for the publisher lifetime. START still requires fresh board-authorized scenario token/hash plus an active control session, whereas **ongoing transmission** never waits on a PC heartbeat. Compatibility should be verified against the shipped paired Studio/firmware after applying this change. | ||
|
|
||
| ## Field evidence — 25 October 2026 | ||
|
|
||
| User-supplied independent NIC capture report (firmware build `83439a4a15f186b0`, **before** this change) recorded approximately 1231.679 seconds, 4,926,580 SV frames, 3,999.89 frames/s, zero missing/duplicates/reordered sample counts, zero malformed frames, and 3,693 PTP Layer 2 packets. It ended `INVALID_CAPTURE` because the publisher reported STOPPED before the requested 3600 seconds. The report does NOT identify the actual STOP cause or prove USB was lost: `PUBLISHER_STOP` in SVSYNC is a consequence, not a causal classification. Full `SVLIFE` and `SVTXFAULT` around STOP remain necessary. | ||
|
|
||
| Do not relabel the M3.H.2 RC1 release as stable until a **new exact-head firmware+GUI** physical acceptance demonstrates: | ||
| 1. Start in Studio, then disconnect USB/close/crash Studio for at least 10 minutes while independent NIC captures uninterrupted SV/PTP. | ||
| 2. Reconnect Studio; verified `RUNNING` should appear without replaying START, and no change in smpCnt phase trajectory should be seen. | ||
| 3. Explicit operator SV STOP works promptly while PTP remains in its role; explicit PTP STOP works independently. | ||
| 4. Unplug Ethernet in isolated test network. SV must stop fail-closed, PTP must tear down promptly; SV must not resume implicitly on replug. PTP does not automatically resume on replug; explicit operator restart is required. | ||
| 5. Run a 3600-second uninterrupted receiving-NIC SV test, then verify independent ARSAS/DigSubAnalyzer receive and decode with APPID/svID/smpCnt evidence. |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.