haniwers.v1.port.diagnoser#

ESP32 flash chip diagnostics using esptool.

Provides functions to connect to ESP32 devices and diagnose flash chip information for troubleshooting.

Module Contents#

Functions#

diagnose_esp32

Diagnose ESP32 flash chip using esptool.

_parse_flash_output

Parse esptool flash_id output into FlashInfo.

API#

haniwers.v1.port.diagnoser.diagnose_esp32(device: str, baudrate: int = 115200, flash_id: bool = False, chip_id: bool = False, summary: bool = False) None#

Diagnose ESP32 flash chip using esptool.

Connects to ESP32 device and retrieves flash chip information. Useful for troubleshooting firmware upload issues.

Args: device: Path to serial device (e.g., /dev/ttyUSB0, COM3) baudrate: Baud rate in bits per second (default: 115200) flash_id: Show only flash chip ID information chip_id: Show only chip ID information summary: Show only chip summary information

Raises: Exception: If connection fails or unexpected error occurs

Example: >>> diagnose_esp32(“/dev/ttyUSB0”)

haniwers.v1.port.diagnoser._parse_flash_output(output: str) haniwers.v1.port.model.FlashInfo#

Parse esptool flash_id output into FlashInfo.

Args: output: Raw output from esptool.flash_id()

Returns: FlashInfo instance with parsed fields

The output format looks like: Manufacturer: 20 Device: 4017 Detected flash size: 8MB Flash voltage set by a strapping pin: 3.3V