Repository navigation
fix(autoresearch): chip-id probe fallback chain + classic-ESP32 pin 8 gate (#3446) - #3447
Conversation
…ESP32 (#3446) ## chip-id detection — three-strategy fallback chain (#3446) Previously the autoresearch port detection probed each port with a single 3.0 s esptool `chip-id` attempt using the default DTR/RTS auto- reset. On a CP210x ESP32-WROOM devkit that budget consistently undershoots — the realistic worst case is ~7 s (slow CP210x driver init + ~4 s of esptool SYNC retries + bootloader handshake), so healthy boards were misclassified as "device may not be in bootloader mode" and the entire bring-up gave up before any test could start. New behaviour: - Per-strategy timeout default is 7 s (covers the worst case while keeping a 5-port-all-empty sweep under ~10 s total). - Primary strategy is still `--before default-reset`. - ONLY when the primary attempt actually times out do we escalate to the fallback chain (`--before usb-reset` then `--before no-reset`). "Port open OK but no chip-id produced" stays a fast-path failure — empty ports don't drag the total budget out. - The caller in `_resolve_port` drops its explicit `timeout=3.0` override so it picks up the new default and the fallback chain. Local repro: `bash autoresearch esp32dev` with a CP210x ESP32-wroom on COM11 now resolves to `(esp32) ESP32` on the first attempt instead of `detection failed (esptool timed out after 3.0s)`. ## LegacyClocklessProxy — gate pin 8 on classic ESP32 `SK6812<8, RGB>` instantiation fires FastLED's `_ESPPIN<8, 256, false>::validpin() == false` static_assert because GPIO8 on the classic ESP32 (esp32dev / WROOM) is reserved for SPI flash (D2/HD). Newer ESP32 variants (S2/S3/C2/C3/C5/C6/H2/P4) repurpose GPIO8 and accept it as a valid output pin, and every non- ESP family treats pin 8 as a normal digital — so the gate is the narrow classic-ESP32 exclusion, not a broad change. Mirrors the existing `AUTORESEARCH_LEGACY_SUPPORTS_PIN_22` Teensy gate. Without this the sketch failed at compile time for esp32dev and autoresearch never got past the build phase. ## pyproject.toml — fbuild 2.3.15 pin note + version chase The pin stays at `fbuild==2.3.14` for now (2.3.15 isn't on PyPI yet as of this commit) but the comment history is updated to reflect the Windows compile env + path-separator fixes that landed in FastLED/fbuild#885 and FastLED/fbuild#890. Bump the pin to 2.3.15 in a follow-up once the release workflow publishes. Closes (pending CI): #3446 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR refactors ESP chip detection in ci/util/port_utils.py to use a multi-strategy reset-mode fallback chain with a new probe helper and adjusted default timeout, adds a compile-time guard for pin 8 support in LegacyClocklessProxy.h, and updates the fbuild pin-history comment in pyproject.toml. ChangesESP Chip Detection Fallback
LegacyClocklessProxy Pin 8 Guard
fbuild Pin History Update
Sequence Diagram(s)sequenceDiagram
participant AutoDetectUploadPort
participant DetectAttachedChip
participant ProbeChipWithResetMode
participant Esptool
AutoDetectUploadPort->>DetectAttachedChip: detect_attached_chip(port.device)
DetectAttachedChip->>ProbeChipWithResetMode: probe(default-reset)
ProbeChipWithResetMode->>Esptool: esptool chip-id --before default-reset
Esptool-->>ProbeChipWithResetMode: result or timeout
alt timeout
DetectAttachedChip->>ProbeChipWithResetMode: probe(usb-reset)
ProbeChipWithResetMode->>Esptool: esptool chip-id --before usb-reset
DetectAttachedChip->>ProbeChipWithResetMode: probe(no-reset)
ProbeChipWithResetMode->>Esptool: esptool chip-id --before no-reset
else other failure
DetectAttachedChip-->>AutoDetectUploadPort: return error immediately
end
DetectAttachedChip-->>AutoDetectUploadPort: chip_type or aggregated error
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…low-up to #3447) (#3448) PR #3447 attempted to gate `case 8:` in `LegacyClocklessProxy` behind a `#if defined(FL_IS_ESP_32) && !defined(<every variant>)` clause. Two bugs: 1. `FL_IS_ESP_32` is not a real macro. The actual classic-ESP32 sentinel is `FL_IS_ESP_32DEV` (see `src/platforms/esp/is_esp.h:68`). The gate never fired, so esp32dev compile still hit `_ESPPIN<8, 256, false>::validpin() == false`. 2. Even with the right macro, only gating pin 8 isn't enough — classic ESP32's `FASTLED_UNUSABLE_PIN_MASK` covers pins {6, 7, 8, 9, 10, 11, 20} (SPI flash SD0/SD1/SD2/SD3/CMD/CLK pads + GPIO20). LegacyClocklessProxy iterates pins 0-8 so the SK6812/WS2812B instantiations on pins 6 and 7 were still failing the static_assert. Fix: introduce `AUTORESEARCH_LEGACY_SUPPORTS_PIN_{6,7,8}` macros, each gated by `defined(FL_IS_ESP_32DEV)`. Classic ESP32 builds skip those three cases; every other family (including ESP32-S2/S3/C/H/P, Teensy, AVR, ARM, RP2040) keeps them. Verified: `bash compile esp32dev --examples AutoResearch --no-filter` now succeeds in 1m35s, where it previously failed with `error: static assertion failed: This pin has been marked as an invalid pin` for pins 6, 7, and 8 in sequence. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Closes #3446. Fixes the autoresearch port-detection collapse on CP210x ESP32-WROOM devkits AND unblocks the AutoResearch compile path on classic ESP32 so the existing neighbor-pin discovery RPC (
findConnectedPins→run_pin_discovery) can actually run.Part 1 — chip-id detection: three-strategy fallback chain (#3446)
ci/util/port_utils.pypreviously probed each port with a single 3.0 s esptoolchip-idattempt using the default DTR/RTS auto-reset. On a CP210x ESP32-WROOM devkit that budget consistently undershoots — realistic worst case is ~7 s — so healthy boards were misclassified as "device may not be in bootloader mode" and the whole bring-up gave up before any test could start.New behaviour:
--before default-resetonlydefault-resetfirst; only if it times out, fall back tousb-resetthenno-resetLocal repro:
bash autoresearch esp32devwith a CP210x ESP32-wroom on COM11 now resolves to(esp32) ESP32on the first attempt instead ofdetection failed (esptool timed out after 3.0s).Part 2 — LegacyClocklessProxy: gate pin 8 on classic ESP32
SK6812<8, RGB>instantiation fires FastLED's_ESPPIN<8, 256, false>::validpin() == falsestatic_assert because GPIO8 on the classic ESP32 (esp32dev / WROOM) is reserved for SPI flash (D2/HD). Newer ESP32 variants (S2/S3/C2/C3/C5/C6/H2/P4) repurpose GPIO8 and accept it as a valid output pin, and every non-ESP family treats pin 8 as a normal digital — so the gate is the narrow classic-ESP32 exclusion, not a broad change.Mirrors the existing
AUTORESEARCH_LEGACY_SUPPORTS_PIN_22Teensy-only gate. Without this, the sketch failed at compile time foresp32devand autoresearch never got past the build phase — thefindConnectedPinsneighbor-pin RPC (the actual mechanism for finding a soldered/jumpered pin pair) was unreachable because the example wouldn't link.Part 3 — pyproject.toml: fbuild 2.3.15 note
The pin stays at
fbuild==2.3.14for now (2.3.15 isn't on PyPI yet as of this commit) but the comment history is updated to reflect the Windows compile env + path-separator fixes that landed in FastLED/fbuild#885 and FastLED/fbuild#890. A follow-up will bump the pin to 2.3.15 once the release workflow publishes.Test plan
bash test --cpp --clean— 340/340 pass.bash compile esp32dev --examples Blink— succeeds (with fbuild patched binary).workflow_dispatch).bash autoresearch esp32devend-to-end on a known-good ESP32-WROOM.🤖 Generated with Claude Code
Summary by CodeRabbit