Add serial console, log export, and autoboot detection#6
Merged
Conversation
Serial Console (TUI + WebUI):
- Post-recovery interactive serial terminal in both UIs
- TUI: Input widget for commands, Ctrl-C sends 0x03 to device
- WebUI: text input + Send/Ctrl-C buttons, auto-scrolling output
Autoboot detection:
- Console read loop auto-detects "autoboot" in serial stream
and immediately sends Ctrl-C to interrupt U-Boot countdown
- Session-level break extended to 15s with autoboot keyword detection
- Fixed false-positive prompt matching on boot log substrings
(e.g. "hisilicon" in SPI probe function names)
- Verified on real hardware (defib_hi3516ev300_20260330_163650.log)
Log export:
- "Save Log" button in TUI (writes defib_{chip}_{timestamp}.log)
- "Save Log" button in WebUI (browser file download)
- Captures both recovery progress and serial console output
Bug fixes:
- TUI BadIdentifier crash: stage ids replace spaces with hyphens
- Duplicate log messages removed (Boot mode entered x2, Recovery complete x3)
- Handshake waits forever (no artificial timeout) across all 3 protocols
- "power-cycle the device now!" message on all protocols (Python + JS)
- Ctrl-C in TUI sends 0x03 to device instead of killing app
Tests:
- 6 autoboot regression tests from real hardware captures
- ProgressScreen rendering regression test
- *.log added to .gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Summary
screen)Verified on real hardware
Tested 3 times on hi3516ev300 — autoboot successfully interrupted every time.
Test plan
🤖 Generated with Claude Code