Esp32 keeps rebooting if i use wifi connection

Hello, some time ago I updated from windows 10 to 11, and I find myself with a big problem with the esp32: I CANNOT USE WIFI, for some reason, codes that worked before (more or less) or examples of the wifi library, if I leave the wifi connection activated ".begin(SSID, PASS)", it stays in an infinite cycle of restarts, but, if I comment this line, the code compiles and uploads the same (only the wifi connection doesn't work, but the pins do), the error code is the following (for the example of: WiFiClientShowPeerCredentials) "WeMos Lolin 32":

abort() was called at PC 0x401514f7 on core 1


Backtrace: 0x40083679:0x3ffca9f0 0x4008d3f5:0x3ffcaa10 0x4009276d:0x3ffcaa30 0x401514f7:0x3ffcaab0 0x4015153e:0x3ffcaad0 0x40150d23:0x3ffcaaf0 0x40150c82:0x3ffcab10 0x400d695d:0x3ffcab30 0x400d294b:0x3ffcab50 0x400d2b9b:0x3ffcb060 0x400d88a9:0x3ffcb080




ELF file SHA256: 0a7f7ef72a060dd5

Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
Started C:\Users\Arixt\AppData\Local\Temp\arduino_modified_sketch_76335\WiFiClientShowPeerCredentials.ino build Jul 22 2023 13:41:39

In addition to the "WeMos Lolin 32", I have tested it with two "Lolin 32 s2", with the difference that this esp does not show error codes (in general)

any ideas?

Make sure that the power supply is adequate.

The radio module is power hungry and an inadequate power supply can lead to reboots due to brownouts.

1 Like

integrated usb port 3.2Gen2 5v 0.5% 1.5A

I repeat, the problem is software, the only thing that has changed is the OS

I add: I have tried with multiple versions of the arduino IDE (1.8.19, 2.x, etc.)

Then, brownout detector can be kept disabled by including the following codes in the sketch.

#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable   detector

just disabling the brownout detector won't prevent problems due to inadequate power supplies!

USB Port of PC should supply adequate power to the WiFi/Radio Section and yet the Brown Detector triggers.

For my case, this happened and the problem I traced down to loose connection in the USB connector at the Board side. It was indicated by the sudden flickering of the on-board Power LED. I changed the ESP32 Board and everything was ok.

The thing about radios - all radios - is that they take very large current peaks when they transmit.

It is these peaks that show up any deficiencies in power supplies, connections, etc.

I repeat, with the same usb port, same ide, same code, same boards, I try to program it from windows 10 and it works, I try it in windows 11 and it reboots constantly

Update: I've been testing, after several reboots, my "WeMos D1 Mini ESP32" board allows me to program it and the wifi works halfway, I can make http requests, but I can't use a secure connection, instead the other esp32 produces the same result, I leave the code I'm working on (it's to get the fingerprint of a specific domain and it's based on the example: "WiFiClientShowPeerCredentials" which doesn't work)

#include <WiFi.h>
#include <HTTPClient.h>
#include <WiFiClientSecure.h>

#define   WIFI_SSID "*****"
#define   WIFI_PASS "*****"

String    HTTPS_URL = "";
uint8_t   HTTPS_FINGERPRINT[32];


void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("runing");
  WiFi.mode(WIFI_STA);
  WiFi.begin(WIFI_SSID, WIFI_PASS);

  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("Wifi fail - rebooting");
    delay(5000);
    ESP.restart();
  }
}

void loop() {
  if(Serial.available()){
    HTTPS_URL = Serial.readStringUntil('\n');
    if(HTTPS_FINGERPRINT_GET(HTTPS_URL, HTTPS_FINGERPRINT)){
      Serial.print("OK: ");
      for (int i = 0; i < 32; i++) {
        Serial.print(HTTPS_FINGERPRINT[i], HEX);
        Serial.print(" ");
      };
      Serial.println("");
    }
  }
}

bool HTTPS_FINGERPRINT_GET(String URL_, uint8_t BUFFER_[32]){
  WiFiClientSecure *client = new WiFiClientSecure;
  client -> setInsecure();
  HTTPClient HTTPS_Client;
  if(!HTTPS_Client.begin(*client, URL_)){
    int httpCode = HTTPS_Client.GET();
    if(httpCode != 200){
      Serial.println(HTTPS_Client.errorToString(httpCode));
      return false;
    }
  }else{Serial.println("conection done");}
  if(!client->getFingerprintSHA256(BUFFER_)){
    Serial.println("fingerprint failed");
    return false;
  }else{Serial.println("fingerprint done");}
}```

Hi, I've been messing around with the esp32 board and library files, in a board definition file I found a character that shouldn't be there (black diamond with white question mark), I've deleted it and now it lets me use the wifi client secure library, but only on the "WEMOS D1 ESP32" board, could it be that somehow the board and library download server is failing? or is it an error of the ide?

at least I can use the good board, which is enough for me :slight_smile:

recently had a problem with an ESP32 dev board which had been working fine developed a problem
if would program OK but continuously rebooted at run time - even simple programs such as blink failed
in the end I changed the usb cable (which I had been using for some weeks) and problem went away

ESP32 mini S2 had this problem (still has on some boards from ebay/amazon).
The issue was restarting evey 1 second or so when using WiFi (broadcast a wifi network).

Solution from other forums: One capacitor on boards is not soldered right to GND.
Some newer boards are working fine. See below.
I tried to solder a blob of solder a 1/4 inch wire to EN pin on board (also tried 1 inch coiled wire), and it helped, esp32 is not resetting itself anymore and works fine.

Bad module was from amazon, good from Aliexpress (12.2023 order).

I use a Adafruit ESP32 Feather V2 and experienced also many reboots when using Wifi.

When I moved the device closer to my Wifi station it fixed the reboots. I have now ordered an antenna for the Feather board. Hope that it fixes the reboots.

You can just reduce the output power of the TX and all your problems will go away:

WiFi.mode(WIFI_AP);
WiFi.setTxPower(WIFI_POWER_5dBm);

Test with whatever value works for you... for me it works with 18dBm but you have to start somewhere.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.