Search code examples
wifiesp32micropython

ESP32 : Error when activating Wi-Fi interface


I recently purchased an ESP-32 that I use with MicroPython for a web server via Wi-Fi. Everything works very well and I decided to buy 4 more. But on none of the 4 works when I enable the Wi-Fi interface.

I get this error everytime :

>>> import network
>>> wifi = network.WLAN(network.STA_IF)
>>> wifi.active(True)

Brownout detector was triggered

ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

I already searched on the web but I found nothing to solve my problem (changing usb cable, switching usb port, resetting and flashing micropython again... nothing works) and that on all of my 4 ESP-32

Do you have any idea of what is the problem and how to solve it ?

Infos:

  • D1 mini ESP-WROOM-32
  • MicroPython version: MicroPython v1.11-580-g973f68780
  • Power : 5V from computer usb
  • rshell

Solution

  • The problem is that the esp32 is drawing to much power during WiFi transmission, and the voltage drops below a threshold causing brownout. If you are not using the 3.3V pin to drive additional components (or the GPIO pins for LEDs), this should not happen and is due to poor board design. To work around, you could try the following things:

    • Add a capacitor between 3.3V and GND (as close to the chip as possible)
    • decrease current draw, e.g. by:

      • powering external components with 5V from USB
      • removing LEDs from the board (desolder)
      • reducing WiFi transmission power (if possible)
      • reducing the chip frequency e.g. to 40 MHz: machine.freq(40000000)
    • reduce/disable the brownout threshold (probably requires compilation of micropython)