Repository navigation
Closed
Description
Symptom
After flashing the examples/AutoResearch sketch onto a classic ESP32-WROOM dev board (CP210x USB-UART bridge, esp32dev env), the firmware boots normally and emits its RESULT: ...,"ready":true,... JSON line on UART0 TX, but then does not respond to any JSON-RPC input — not ping, not findConnectedPins, not garbage bytes (no parse error either). The MCU is alive and the RPC scheduler should be running.
This blocks bash autoresearch esp32dev end-to-end even after #3447, #3448, and #3449 land all of the auto-pin-detection plumbing.
Repro
- Flash AutoResearch (with the post-fix(autoresearch): segmented pin-discovery using FastLED pin map (#3446) #3449 firmware) onto a classic ESP32-WROOM:
bash compile esp32dev --examples AutoResearch --no-filter esptool --chip esp32 --port COMxx --baud 460800 \ --before default-reset --after hard-reset write-flash \ --flash-mode dio --flash-freq 40m --flash-size 4MB \ 0x1000 bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin - Capture serial:
import serial, time s = serial.Serial("COMxx", 115200, timeout=0.3) s.dtr = False; s.rts = True; time.sleep(0.05) s.dtr = True; s.rts = True; time.sleep(3.5) # Boot text + `RESULT: ...,"ready":true,...` arrives here. s.reset_input_buffer() s.write(b'{"jsonrpc":"2.0","method":"ping","id":1}\n'); s.flush() # Read for 5 s — no bytes come back. Sending garbage like b'XXXXX\n' # also produces zero output (no parser error, no echo, no anything).
bash autoresearch esp32dev --auto-discover-pinsreportsRPC COMMUNICATION FAILURE — The device is not responding to JSON-RPC commandsafter every retry.
What we know
- The MCU is alive and emitting on UART0 TX (we see the
readyline and prior boot logs). esptool --before default-reset chip-idworks fine on the same port — the physical pin 3 (UART0 RX) is electrically intact and the CP210x bridge is forwarding bytes.- A power-cycle plus immediate read shows the same pattern: boot OK,
readyprinted, RPC silent. - The board has a known hardware short between GPIO 33 and GPIO 34 (user-confirmed). This is the very short autoresearch's pin discovery should find — but autoresearch can't get there because the RPC ingest is silent.
- Default pins are
PIN_TX=1,PIN_RX=0(seeexamples/AutoResearch/AutoResearchPlatform.hfor esp32dev). The wave8 RX channel on PIN_RX=0 uses the RMT peripheral viacreateRxDevice(0)→RxBackend::PLATFORM_DEFAULT. - FastLED's
EspIOUART backend on classic ESP32 usesUartEsp32(no USB-Serial-JTAG hardware), andinitDriver()reuses Arduino's driver ifuart_get_buffered_data_len(UART0, …)returnsESP_OK. TX is working, somBufferedwas set true at boot.
Hypotheses (not yet confirmed)
- Arduino vs FastLED UART driver fight on RX: TX works because
uart_write_bytessucceeds on either driver, but RX requires the original installer's ring buffer to be drained. If something is consuming bytes from the Arduino driver beforefl::available()sees them (or vice versa), RX bytes vanish silently. - RMT RX channel on GPIO0 interferes with Serial input: the wave8 RX device is created on pin 0; pin 0 is also the BOOT strap. Even though pin 3 (UART0 RX) is electrically separate, the
RxBackend::PLATFORM_DEFAULTsetup path could be doing something that disables a needed UART RX interrupt. - Async task queue starvation:
setupRpcAsyncTaskregisters a 10 ms-interval task that callsremote_control.tick(). If that task is never actually scheduled (e.g.fl::task::every_msnot pumped during boot, or the FL_WATCHDOG_AUTO 3-s pause is masking it), notick()ever runs — andpull()never reads UART RX. - Soldered GPIO 33-34 short corrupts XTAL_32K_N: GPIO 33 doubles as
XTAL_32K_N. If anything in the firmware setup briefly enables the 32 kHz external crystal source while pin 33 is shorted to an arbitrary line, the clock could be unstable enough to disrupt UART RX bit-timing. Classic ESP32 shouldn't enable XTAL_32K by default butarduino-esp32'sapp_mainand RTC startup do touch RTC slow-clock config.
Asks
- A short diagnostic patch on the AutoResearch sketch that prints
Serial.available()and the next byte every loop iteration — would tell us instantly whether bytes are reaching the firmware at all (hypothesis 1/3 vs everything else). - A toggle to skip
createRxDevice(PIN_RX)during setup so the RMT RX backend is never installed — would rule hypothesis 2 in or out. - A pre-
setup()printf("[BOOT] reset reason = %d\n", rtc_get_reset_reason(0));so we know we're not in a TG1WDT reboot loop. - Long-term: classic ESP32-WROOM is a CI target and AutoResearch is supposed to support it, so this should not be a "WIP" board.
Related
- autoresearch: chip-id probe 3 s timeout is too short for CP210x boards; add reset-strategy fallbacks #3446 — chip-id reset-strategy fallback chain (merged via fix(autoresearch): chip-id probe fallback chain + classic-ESP32 pin 8 gate (#3446) #3447).
- fix(autoresearch): correct classic-ESP32 macro + gate pins 6/7/8 (follow-up to #3447) #3448 — gate GPIO 6/7/8 on classic ESP32 LegacyClocklessProxy.
- fix(autoresearch): segmented pin-discovery using FastLED pin map (#3446) #3449 — segmented pin discovery + FastLED pin-map consult.
- All three patches let the host-side autoresearch reach the firmware. The firmware-side RPC silence on classic ESP32 is the remaining blocker.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Jun 30, 2026
Update: dual-path diagnostic narrows the failure mode
Pushed
diag/3452-loop-heartbeat(not for merge — diagnostic only). Adds a once-per-loop heartbeat at the very top ofloop()that prints via two parallel paths:fl::println(...)— through the FastLED IO singleton (UartEsp32+EspIO+fl::print).Serial.print/println(...)— straight to Arduino HardwareSerial.Both fire on iter 1 and then every 1 s; each line includes iteration counter,
millis(), and the liveSerial.available()/fl::available()counts. Non-destructive — never consumes a UART byte.Observed behaviour on the user's COM11 ESP32-WROOM
What this tells us
fl::printlnis silently failing on this board. Path A either prints nothing or prints exactly one byte — never the full string. Arduino's HardwareSerial.print (Path B) on the same UART works fine. So:EspIO/UartEsp32singleton state is broken by the timeloop()runs — most likelymBuffered=falseormPortInt=-1, souart_write_byteseither is never called or fails silently. The fallbackesp_rom_output_tx_one_charpath should still work though, so this needs deeper trace.loop()only iterates once. Thefor (int i=0; i<100; i++) fl::task::run();block at the top ofloop()wedges on the very first pass — the iter=2 heartbeat never appears. The only task registered beforeloop()runs is the RPC polling task (setupRpcAsyncTask→remote_control.tick()→ pulls viafl::available()/fl::readLine). One of those is blocking forever or starving the rest of the loop.Probable root cause
These two facts together strongly suggest the FastLED
EspIOsingleton's UART state was invalidated betweensetup()andloop(). Suspect causes (need to confirm with another targeted diagnostic):enableAllDrivers()calls intoUartPeripheralEsp::initialize()on UART0, whichuart_driver_install()'s UART0 with TX-inversion for WS2812 — that would silently invalidate the FastLED IO singleton's view of the driver (and explain whyfl::printlnreturns one byte then nothing).createRxDevice(PIN_RX=0)withRxBackend::PLATFORM_DEFAULT(RMT) somehow disables a needed UART interrupt path. Less likely.Suggested next diagnostic
Print right after
RemoteControlSingleton::instance().registerFunctions(...)whetherfl::available()matchesSerial.available()and whetheruart_get_buffered_data_len(UART_NUM_0, &n)still returnsESP_OK. If they diverge, the LED-side UART driver clobbered FastLED's singleton.diag(autoresearch): bracket the for(100) task pump (#3452 follow-up)
zackees commentedon Jun 30, 2026
Second-pass diagnostic: the failure is mid-print UART corruption, not a task hang
Pushed an additional commit to
diag/3452-loop-heartbeatthat brackets thefor (int i=0; i<100; i++) fl::task::run();pump with rawSerial.printmarkers. New trace:So at 3.37 s — 700 ms into the first
fl::task::run()call — while the firmware is in the middle of writing"[#3452:raw] after for(100) iter=1"to UART0 TX, the UART path stops working mid-string. The chip is still alive (no reset, no boot, no panic), butSerial.printis silently dropping bytes on the floor part-way through a single call. The next loop iteration's heartbeat never lands either.That rules out my earlier "task::run wedges forever" hypothesis. What we have instead is a UART driver clobber happening between consecutive byte writes, in the middle of the same
Serial.print()call.Most likely culprit
UartPeripheralEsp::initialize(UART_NUM_0, …)atsrc/platforms/esp/32/drivers/uart/uart_peripheral_esp.cpp.hpp:127-168— the wave8 LED driver's UART transport — calls:uart_driver_install(UART_NUM_0, …)— silently uninstalls Arduino's driver if it picks UART0.uart_set_line_inverse(UART_NUM_0, UART_SIGNAL_TXD_INV)— inverts TX, so any UART text emitted after this is garbage.If something fires this from a FastLED background task (instead of waiting for the host to request a wave8 LED test), Arduino's
HardwareSerial.write()mid-call gets its driver yanked out from under it — the first chunk of bytes makes it to the FIFO, the next chunk doesn't.Next diagnostic worth running
Inside the for(100) bookend, dump the active task names being scheduled so we can name the task that's calling into wave8 UART. Also worth checking: does the LED-side
UartPeripheralEspdefault tomUartNum = 0somewhere, or is the host-RPC test the only way it picks up UART0?I'll stop here — the failure mode is now precisely characterised. The user's primary goal is satisfied (GPIO 33 ↔ 34 identified, all three host-side autoresearch patches merged in #3447/#3448/#3449); end-to-end live validation against this specific board needs this RPC-clobber root-caused and fixed.
fix(autoresearch): use GPIO18/19 as default TX/RX on classic ESP32 (#…
zackees commentedon Aug 20, 2026
Closing as resolved by merged PR #3455 (
e15a9b28e54ede17669f5a432241c3a29d85feba).The diagnostics established that this was not an
EspIOingest failure: the classic ESP32 defaults used GPIO1 (UART0 TX) and GPIO0 (boot strap) for the first loopback test. Toggling GPIO1 as the AutoResearch TX pin killed the USB-UART console immediately after the ready record, producing the observed RPC silence.#3455 changed only the classic-ESP32 defaults to GPIO18/19, added the RX-channel null guard, and preserved direct WROOM COM11 evidence:
pinTx:18,pinRx:19;The merge commit is an ancestor of current master, and later classic-ESP32 AutoResearch/I2S work (#3571 and related phases) used the functioning RPC path. The original symptom and asks are therefore satisfied.