Skip to content

feat: FbuildSerialAdapter should support DTR reset for device reboot #50

@zackees

Description

@zackees

Summary

FbuildSerialAdapter does not support toggling DTR to reset an ESP32 device. When the device is already booted and idle (no serial output), RPC communication fails because the adapter connects to a silent serial port.

Current behavior

  • FbuildSerialAdapter.connect() opens the serial connection but does not toggle DTR
  • If the device is already booted, there is no output to read
  • RPC ping times out → autoresearch incorrectly reports "device not responding"
  • The tool then falls through to the GPIO pre-test which also fails → misleading "connect a jumper wire" error

Expected behavior

FbuildSerialAdapter should expose a reset() or toggle_dtr() method that:

  1. Asserts DTR (pulls low) for ~100ms
  2. De-asserts DTR
  3. Waits for device boot output (~3s)

This matches what PySerialAdapter can do via the underlying pyserial dtr property.

Workaround

FastLED/FastLED PR #2260 commit 2168882 adds a workaround in ci/autoresearch/gpio.py that bypasses FbuildSerialAdapter entirely — it opens a raw pyserial connection just to toggle DTR, closes it, then reconnects via the normal adapter. This is fragile and should be replaced once fbuild supports DTR natively.

Proposed API

class FbuildSerialAdapter:
    def reset_device(self, dtr_hold_ms: int = 100, boot_wait_ms: int = 3000) -> None:
        """Toggle DTR to reset the connected device and wait for boot."""
        ...

Or alternatively, add a dtr property setter that maps to the underlying connection.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions