Summary
FbuildSerialAdapter has timing characteristics that cause JSON-RPC ping responses to be dropped during FastLED's autoresearch GPIO pre-test on ESP32-S3. The root cause is a combination of short timeouts and early loop exit behavior.
Cross-reference
Downstream fix applied in FastLED/FastLED#2261 — autoresearch now always uses PySerialAdapter for RPC communication as a workaround.
Root Cause
Three compounding issues in FbuildSerialAdapter:
- 50ms read timeout per iteration — too short for an ESP32-S3 RPC round-trip (device must parse JSON-RPC request, execute handler, serialize response)
- Early exit on buffer drain timeout — stops reading before the response arrives, discarding partially-received data
- Async/sync boundary crossing via
ThreadPoolExecutor adds non-deterministic latency to the read path
Observed Behavior
- Schema validation phase uses
PySerialAdapter with reset_input_buffer() → succeeds
- GPIO pre-test uses
FbuildSerialAdapter (when serial_interface=None falls through to default) → consistently times out waiting for RPC ping response
Suggested Fix
Either:
- Increase the per-read timeout to ≥500ms for serial reads
- Don't exit early on buffer drain — continue reading until the caller's overall timeout expires
- Or expose a configurable read timeout that callers can set for RPC use cases
Workaround
FastLED/FastLED#2261 forces PySerialAdapter for all RPC communication, bypassing FbuildSerialAdapter entirely.
Summary
FbuildSerialAdapterhas timing characteristics that cause JSON-RPC ping responses to be dropped during FastLED's autoresearch GPIO pre-test on ESP32-S3. The root cause is a combination of short timeouts and early loop exit behavior.Cross-reference
Downstream fix applied in FastLED/FastLED#2261 — autoresearch now always uses
PySerialAdapterfor RPC communication as a workaround.Root Cause
Three compounding issues in
FbuildSerialAdapter:ThreadPoolExecutoradds non-deterministic latency to the read pathObserved Behavior
PySerialAdapterwithreset_input_buffer()→ succeedsFbuildSerialAdapter(whenserial_interface=Nonefalls through to default) → consistently times out waiting for RPC ping responseSuggested Fix
Either:
Workaround
FastLED/FastLED#2261 forces
PySerialAdapterfor all RPC communication, bypassingFbuildSerialAdapterentirely.