Skip to content

Add serial console, log export, and autoboot detection#6

Merged
widgetii merged 2 commits intomasterfrom
feature/serial-console-autoboot
Mar 30, 2026
Merged

Add serial console, log export, and autoboot detection#6
widgetii merged 2 commits intomasterfrom
feature/serial-console-autoboot

Conversation

@widgetii
Copy link
Copy Markdown
Member

Summary

  • Serial console in TUI and WebUI after recovery (no need to switch to screen)
  • Auto-detect U-Boot autoboot countdown and send Ctrl-C automatically
  • Log export (Save Log button) for sharing with colleagues
  • Multiple bug fixes from real hardware testing

Verified on real hardware

Tested 3 times on hi3516ev300 — autoboot successfully interrupted every time.

Test plan

  • 177 Python tests pass (6 new autoboot regression tests)
  • 53 JS tests pass
  • Real hardware: hi3516ev300 flashed + autoboot caught + U-Boot console usable

🤖 Generated with Claude Code

widgetii and others added 2 commits March 30, 2026 16:43
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>
@widgetii widgetii merged commit 6d880ab into master Mar 30, 2026
12 checks passed
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