Page 1 of 1

Cannot connect to WIFI from bare ESP32 board

Posted: Thu Nov 04, 2021 5:25 pm
by dt4350
Hello, I am using a bare ESP32 WROOM 32D module for prototyping: https://www.amazon.com/dp/B08XXH9RMT

I am using a simple breakout like this for uploading code/accessing the pins: https://www.amazon.com/dp/B08PNR6H1C

I am using the arduino IDE (v1.8.16) to upload code, and have successfully uploaded the blink sketch.

When I attempt to upload example sketches that use WIFI, the WIFI does not engage. The code uploads but it hangs on connecting to my WIFI network. This same code uploads and works properly on my Heltec ESP32 WIFI kit. I am including it at the end of my post for reference.

Might I need to make any config changes on the board that I haven't accounted for? Might I need to make any WIFI network changes? I successfully ran a network scan using the board, proving that it does in fact see my network.

Does anyone have any suggestions for troubleshooting? Thank you.

Code:

Code: Select all

#include <WiFi.h>
#include "arduino_secrets.h"

//Provide your own WiFi credentials
const char* ssid = SECRET_SSID;
const char* password = SECRET_PASS;

void setup() {
  Serial.begin(115200);
  initializeWifi();
}

void loop() {

}

void initializeWifi() {
  //First, set the Wi-Fi mode. If the ESP32 will connected
  //to another network (access point/hotspot) it must be in station mode.
  WiFi.mode(WIFI_STA);
  //Then, use WiFi.begin() to connect to a network.
  //You must pass as arguments the network SSID and its password:
  WiFi.begin(ssid, password);
  //WiFi.setSleep(false);// this code solves my problem
  Serial.print("Connecting to WiFi ..");
  //Connecting to a Wi-Fi network can take a while, so we usually add
  //a while loop that keeps checking if the connection was already established
  //by using WiFi.status(). When the connection is successfully established,
  //it returns WL_CONNECTED.

  while (WiFi.status() != WL_CONNECTED) {
    Serial.print('.');
    delay(1000);
  }
  Serial.println(WiFi.localIP());
  Serial.print("RRSI: ");
  Serial.println(WiFi.RSSI());
}

Re: Cannot connect to WIFI from bare ESP32 board

Posted: Fri Nov 05, 2021 4:54 am
by username
try WiFi.begin(ssid.c_str(), password.c_str());

Re: Cannot connect to WIFI from bare ESP32 board

Posted: Fri Nov 05, 2021 7:09 am
by dt4350
username wrote:
Fri Nov 05, 2021 4:54 am
try WiFi.begin(ssid.c_str(), password.c_str());
Thanks for your reply. That didn't work, unfortunately. It did prompt me to try hardcoding my ssid/password but that also didn't work.

Re: Cannot connect to WIFI from bare ESP32 board

Posted: Fri Nov 05, 2021 8:02 am
by ESP_Minatel
Hi,

Does your network provides 2.4GHz or it's 5GHz? ESP32 does not work on 5GHz band.

Please take a look at the WiFi API docs here.

Re: Cannot connect to WIFI from bare ESP32 board

Posted: Fri Nov 05, 2021 7:26 pm
by dt4350
Update: I have soldered a different bare module/breakout board and that one can successfully connect to my wifi network.

Is it possible that I somehow damaged the wifi chip/antenna of the first module during the soldering process?

Re: Cannot connect to WIFI from bare ESP32 board

Posted: Sat Nov 06, 2021 6:32 pm
by dt4350
ESP_Minatel wrote:
Fri Nov 05, 2021 8:02 am
Hi,

Does your network provides 2.4GHz or it's 5GHz? ESP32 does not work on 5GHz band.

Please take a look at the WiFi API docs here.
Hi, I thought I had replied to your comment but I don't see it now. I'm sorry if it appears twice.

I am trying to connect to a 2.4GHz network. I've since soldered a separate module/breakout board together and successfully connected to my network with that one.

Re: Cannot connect to WIFI from bare ESP32 board

Posted: Mon Nov 08, 2021 10:28 am
by ESP_Minatel
Hi,

Everything is possible when hand soldering or working with the bare chip. It's hard to say.