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());
}