Skip to content

ESP32 node 35: brownout crash loop at phy_init (root cause of Wi-Fi drops / no auto-reconnect) #83

Description

@AndrewDemsDS

Symptom

The ESP32 node (esp-matter path) becomes unstable, drops its Wi-Fi association, and never rejoins on its own. It stays offline (Matter node unreachable, A/C uncontrollable) until the module is manually power-cycled.

Root cause: brownout crash loop at phy_init

Captured serial over a USB-TTL on UART0 (115200 8N1). The node is in a deterministic brownout crash loop: every boot resets ~33 ms after phy_init: phy_version ... prints, i.e. the instant the RF PHY powers on / calibrates, before Wi-Fi ever scans or associates:

I (1000) wifi_init: WiFi RX IRAM OP enabled
I (1033) phy_init: phy_version 4863,...
E BOD: Brownout detector was triggered
rst:0x3 (SW_RESET)
W hisense_ac: boot reason: BROWNOUT (supply sagged)

14 identical cycles in 15 s, ~1 s each. The brownout detector is already at the least-sensitive level (~2.43 V) and still trips, so the 3.3 V rail is collapsing below 2.43 V under the PHY turn-on peak (~400-500 mA) that the marginal 5 V supply plus dev-board decoupling cannot source. The stock Wi-Fi module ran on this same rail fine, so the weak link is the ESP32 board's power path, not the appliance supply.

This explains "never reconnects until power-cycle" precisely. The device does reset on its own, but on the marginal supply it cannot get past phy_init on the reboot, so it loops invisibly (offline) until a full power-cycle lets the rail recover. It is a supply/brownout problem, not primarily a missing esp_wifi_connect() re-arm.

Fixes

  1. Shorten the power wires (done): reduced IR drop; the node is now stable on Wi-Fi at idle (6/6 live Matter reads, no resets). Margin is thin.
  2. 470-1000 uF bulk cap at the module 3.3 V / GND + 0.1 uF ceramic: the real fix. Not yet fitted.
  3. Firmware power-saving (investigated): the phy_init peak cannot be reduced by TX-power / Wi-Fi-PS / CPU-freq (all pre-association or average-current levers on a peak-current event). The only firmware lever in that window is confirming PARTIAL RF calibration is not silently falling back to the ~4x-current FULL calibration (a brownout-corrupted NVS cal blob can force FULL, a plausible self-sustaining loop). The matter-safe OTA-time win, extending the TX-power throttle to the Matter BDX OTA path, is DONE (shipped in 19077d9 as HisenseOTARequestorDriver, throttling to 10 dBm for the BDX transfer and restoring on idle; it ships in all flavours, no #ifdef gate). The earlier "(currently HTTP-only)" note is obsolete. See OTA, watchdog, bus-error & link-loss recovery #12.
  4. Defense-in-depth (for genuine RF drops distinct from brownout): a robust WIFI_EVENT_STA_DISCONNECTED re-arm with backoff + a task watchdog so a hung connectivity task reboots into a recovery attempt.

Done when

The node survives both a Wi-Fi drop and a supply sag without going dark until power-cycle: cap fitted + reconnect handler + optionally the BDX-path OTA TX throttle.

Ported from the project's private tracker.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    esp32-pathESP32-replacement trackhilNeeds hardware-in-the-loop (bench) to validatereliability

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions