ESP32 Not connecting to wifi if serial monitor is not running on IDE

Octavio_Bs
Posts: 2
Joined: Thu Jan 20, 2022 7:37 pm

ESP32 Not connecting to wifi if serial monitor is not running on IDE

Postby Octavio_Bs » Thu Jan 20, 2022 8:19 pm

I have an strange problem. I created a program in wich i use several libraries like FasLED, Led 7 segments drivers, time.h and it worked perfectly until i disconnected the board from the computer and connected to an standard USB power supply.

After many tests what I have found is that if the ESP32 is not connected to the computer USB and Serial Monitor is not running in the Arduino IDE the program does not connect to the WiFi. I started to eliminate parts of the program in order to find what could cause that.

Now I am in a very simple bare bones program and it is still the same, if the board is not connected to the computer and the serial monitor is not running the prograam does not connect to wifi.

I am using an ESPDUINO32 it has an ESP-WROOM-32 and I use a Mac. Have tried Arduino IDE 1.8.15 as well as 2.0.0 Beta 9

I have two boards and both have the same behaviour, this is not a power supply problem as I have tried with several power bricks and also tested the consumption being really below the capability of the bricks, neither a cabling one as I only have a LED and it flashes correctly and stays on after connecting to wifi, if that is succesful.

Also the board does not resets and stay on the loop forever, i have tried to put a counter on the loop and send it via serial and it send a continuous count, so no reset.

I am completely clueless.

So, this is probably something really strange or more probably really stupid on my side.

p.d. Excuse me if something is not clear as english is not my main language. Just for the records, I have been designing electronics and programming, mainly in assembler, for hobby or professionally for nearly 40 years but fairly new to ESP32 and C.

Code: Select all

#include <Arduino.h>

/* ------------------------------------------ */

#include "WiFi.h"

const char* ssid = "Yourssid";
const char* password = "yourpass";

bool flashFlag = false;


#define CONNECTING_LED 18  // 27

/* ------------------------------------------ */

void setup() {
  delay(3000);  // 3 second delay for recovery just in case
  pinMode(CONNECTING_LED, OUTPUT);
  digitalWrite(CONNECTING_LED, HIGH);

  // Connect to Wi-Fi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    flashFlag = !flashFlag;
    if (flashFlag == true) {
      digitalWrite(CONNECTING_LED, HIGH);
    } else {
      digitalWrite(CONNECTING_LED, LOW);
    }
  }
  digitalWrite(CONNECTING_LED, HIGH);
}

/* ------------------------------------------ */

void loop() {
}

https://pastebin.com/TAkXW4Zx

Octavio_Bs
Posts: 2
Joined: Thu Jan 20, 2022 7:37 pm

Re: ESP32 Not connecting to wifi if serial monitor is not running on IDE

Postby Octavio_Bs » Sat Jan 22, 2022 6:29 pm

SOLVED iI found that pins EN and GPIO0 had a voltage level of 4,2 volts when serial monitor was not running (this is a voltage that should seriously damage the ESP32) so i have tried to put a resistor of beteen 470R and 1K beetwen RTS and GPIO0 and GND and that forces "gently" the logical level of those pins to a reasonable one. Thanks to all for your tips.

EDIT, I men une resistor betwwen RTS and GND and another one from GPIO0 and GND, but finally found that using just one from GPIO0 is enough.

Who is online

Users browsing this forum: Bing [Bot] and 88 guests