pytest-embedded-serial-esp

class pytest_embedded_serial_esp.serial.EspSerial(pexpect_proc: PexpectProcess, msg_queue: MessageQueue, target: Optional[str] = None, beta_target: Optional[str] = None, port: Optional[str] = None, port_mac: Optional[str] = None, baud: int = 115200, esptool_baud: int = 921600, flash_port: Optional[str] = None, esp_flash_force: bool = False, skip_autoflash: bool = False, erase_all: bool = False, meta: Optional[Meta] = None, **kwargs)

Bases: Serial

Serial class for ports connected to espressif products. Each object could be treated as one target chip.

ESPTOOL_DEFAULT_BAUDRATE = 921600
erase_flash(force: bool = False) None

Erase the complete flash

hard_reset()

Hard reset your espressif device

property stub
use_esptool(no_stub: Optional[bool] = None)
  1. tell the redirect serial thread to stop reading from the pyserial instance

  2. esptool reuse the pyserial instance and call esptool.main() to do the actual work

  3. tell the redirect serial thread to continue reading from serial

Parameters:
  • hard_reset_after – run hard reset after (deprecated)

  • no_stub – disable launching the flasher stub (deprecated)

class pytest_embedded_serial_esp.serial.EsptoolArgs(**kwargs)

Bases: object

fake args object, this is a hack until esptool Python API is improved