One of my project I am sending post request using esp32. While checking my project powered by my laptop it is working perfectly. But my issue is that, esp32 is not connecting after using external power.
I meant, I am giving power using vin pin and esp32 is not connecting to wifi. But it works fine while it is powered by laptop. The code is included below for connecting to wifi:
Code: Select all
void connectWifi(const char* ssid,const char* password){
WiFi.begin(ssid, password);
digitalWrite(2,LOW);
while (WiFi.status() != WL_CONNECTED) { //Check for the connection
delay(1000);
Serial.println("Connecting to WiFi..");
}
Serial.println("Connected to the WiFi network");
digitalWrite(2,HIGH);
}
Note: I am using esp32 dev kit 1 and including wifi.h and HTTPClient.h library.