Skip to content

Add a read-only monitor that actually captures the native console - #30

Merged
bdbarnett merged 2 commits into
mainfrom
monitor-console-capture
Sep 15, 2026
Merged

bdbarnett merged 2 commits into
mainfrom
monitor-console-capture

Conversation

@bdbarnett

Copy link
Copy Markdown
Collaborator

Summary

  • Adds mpftp monitor COM4 --seconds N --log-path …: read-only capture that holds the sidecar open so panic / stderr / ESP_LOG actually land in the log.
  • CLI debug-tee still returns immediately and kills the private sidecar, which is why those logs were empty.
  • SidecarClient.close() no longer deadlocks after a streaming capture: once a stdout reader is active, close terminates the process instead of fighting the pipe.

Test plan

  • PYTHONPATH=cli/src python3 -m unittest discover -s cli/tests (267 tests)
  • Hardware: mpftp monitor COM4 --seconds 100 captured pair_loop + [spremote] lines on an autostarted P4 without dropping it to the REPL
  • mpftp monitor --help shows the new command
  • Confirm debug-tee help still warns that the CLI one-shot cannot keep a tee alive

debug-tee from the CLI closed the private sidecar immediately, so the tee
log stayed empty. monitor holds the port without REPL or DTR/RTS, and
close() no longer deadlocks once a stdout reader is active.
The tee lives in the session, not in the socket that started it. The
subprocess client sends debug_tee_stop on its own pipe when the capture
ends; the RPC client just closed its stream, so with the extension
running -- which is the path get_client() prefers -- monitor --seconds N
returned and left the sidecar reading that COM forever: port held
against the next connect, log growing, and nothing said so.

The new test drives a real socket server and asserts both methods
arrive. Against the previous commit it sees only debug_tee_start.
@bdbarnett
bdbarnett merged commit 9eaad8f into main Sep 15, 2026
3 checks passed
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