Pika Diagnostics
Native VS Code extension for monitoring head_esp32 and back_esp32 serial logs in one Pika Monitor panel. The extension opens COM ports directly through Node serialport; Python and the Web UI are not required.
Features
- Two resizable HEAD/BACK log panes in the VS Code panel.
- Friendly COM-port names, baud-rate selection and connection status.
- Start/Stop/Reset per board or both boards together.
- Automatic serial reconnection.
- Search and Error/Warning/Info/Debug/Verbose/Other level filters.
- Wrap, timestamp, pause/resume and independent scrolling.
- Persisted per-board recording preferences.
- Log folder selection, file rotation and recording status/file size.
- Recorded-session browser with independent HEAD/BACK file selection.
- Offline and live Heap, PSRAM, Largest Heap and Largest PSRAM charts.
- Local diagnostic report with HEAD/BACK logs and additional attachments.
- Dashboard, Boards Tree and compact diagnostics status bar.
The extension does not create Pika: head or Pika: back terminals. The complete monitoring workflow stays inside Pika Monitor.
Requirements
- VS Code
1.85.0 or later.
- Windows COM ports for the current packaged native serial binding.
- No Python dependency.
Getting started
- Install the extension and reload VS Code.
- Open Pika Monitor from the bottom panel.
- Select a COM port and baud rate for HEAD or BACK.
- Click Start Monitoring, or use Start All.
- Enable recording before starting if the session should be saved.
COM and baud controls are locked after a port opens successfully. If opening fails, the port status shows the reason and the action remains Start Monitoring.
Recording
Enabling recording arms a board and persists that preference. A log file is created only after the board's serial port opens successfully.
- Start Monitoring creates a file only for that board when recording is enabled.
- Start All creates files for all enabled boards.
- Stop Monitoring and Stop All close the corresponding files.
- Cut Log closes the current file and continues in a new file.
- When automatic reconnection is enabled, an unexpected COM drop keeps the same recording session open.
Log names use <board>_<YYYYMMDD_HHMMSS>.log, with lines stored as [HH:MM:SS.mmm] text.
Recorded sessions and memory analysis
Load Recorded Session groups log files by timestamp. HEAD and BACK can be loaded from the same session, independently, or from different timestamps and folders.
Each diagnostics footer provides Analyze Memory, opening a four-series chart for:
- Heap
- Largest Heap
- PSRAM
- Largest PSRAM
Series can be shown or hidden independently. The chart supports hover values and automatic or fixed 0–100 KB scale. Recorded logs are parsed from firmware HEAP lines; Resume Live returns the monitor and chart to runtime data.
Diagnostic reports
The Báo lỗi action creates a local report directory containing selected HEAD/BACK logs, memory metrics, crash markers, a Markdown report, JSON summaries and optional attachments. Sensitive values are redacted and no data is uploaded automatically.
Configuration
pikaDiag.configFile is optional:
- If set to an existing file, the extension uses that file.
- If empty,
.vscode/pika-diagnostics.json is created in the current workspace.
- Without an open workspace, configuration is stored in extension storage.
The Dashboard and Pika Monitor persist COM port, baud rate, log directory and per-board recording preference automatically.
Known limitations
- ELF/addr2line backtrace decoding is not yet available in the VS Code UI.
- Web flow analysis from
log_catalog.json remains available only in the separate Web UI.
- Offline memory charts require the current firmware
HEAP log format.
- The monitor keeps at most 5,000 UI lines per board.
Development
npm install
npm run compile
Open this vscode/ directory in VS Code and press F5 to launch an Extension Development Host.
Package for Marketplace:
npm run compile
npx @vscode/vsce package