piopulse-0.1.2 is not a library.
☕ PioPulse
PioPulse is a terminal user interface (TUI) factory flashing tool designed for high-concurrency ESP32 chip flashing on production lines.
Unlike general-purpose tools like PlatformIO or Arduino IDE, PioPulse is built specifically for factory environments. It prioritizes fail-safe operation (anti-fooling / 防呆), extreme parallel execution, comprehensive QA testing, and production line audit logs.
✨ Core Features
- Simultaneous Multi-Device Flashing (Parallelism): Uses Rust async workers (
tokio) to flash multiple connected ESP32 boards concurrently. If one device gets disconnected or hangs, other devices continue flashing unaffected. - Auto-Discovery: Continuously scans serial ports to auto-detect ESP32 connections. No manual port selection required for the operator.
- Simulation Mode: Includes a fully-simulated factory flashing flow. Operators and developers can play with the interface, trigger mock writes, and witness error-handling rates without any actual hardware connected.
- Operator & Admin Mode Separations:
- Operator Mode: Interface is locked to prevent unauthorized changes. Operators can only press
Spaceto start/stop the flashing process and1/2/3to view tabs. - Admin Mode: Password protected (default:
admin). Administrators can live-edit offsets, flash speeds, flash modes, crystal frequencies, and target firmware paths.
- Operator Mode: Interface is locked to prevent unauthorized changes. Operators can only press
- Real-Time Auditing & Statistics: Displays total attempts, passes, failures, and yield rate. Logs are written to an on-screen scrolling panel for real-time diagnostics.
🛠️ Architecture
The project is structured into clean Rust modules:
src/main.rs: Coordinates the asynchronous event loop, crossterm inputs, and state dispatcher.src/app.rs: Implements the core application states, stats counters, and port scanning.src/ui.rs: Implements the layout widgets, grid rendering for channels, logs tab, config tab, and authorization modals usingratatui.src/worker.rs: Manages background tasks. Wraps/home/waya/.local/bin/esptool.pyto parse real flashing stdout logs, and contains the logic for Simulation Mode.src/config.rs: Handles JSON serialization/deserialization for project settings. Saves files toproject_config.json.
🚀 How to Run
To build and run PioPulse:
# Navigate to the project directory
# Compile and run the application
Keyboard Shortcuts
Space: Start batch flashing to all detected/simulated devices.TaborF1: Toggle Admin Mode (Enter password:admin).s: Toggle Simulation Mode (Default:ON). Enables mock flashing for demonstration purposes.c: Clear production statistics.1: Switch to Channels Tab (Displays grid cards for each channel).2: Switch to Logs Tab (Displays scrolling log entries).3: Switch to Configuration Tab (Locks/unlocks setting alterations).Esc: Exit the application.