Esp 32 Doesn't Connect to Wifi
I Can't Connect My Esp32 to My Wifi, but I Can Connect to My Cellphone Router. I Made a Simple Print to Show Which Code It Returns, and I Get over and over...
I cant connect my ESP32 to my wifi, but i can connect to my cellphone router. I made a simple print to show which code it returns, and i get over and over WL_IDLE_STATUS.
#include <Arduino.h>
#include <WiFi.h>
const char* meuSSID = "asdfgh";
const char* meuPASS = "12345678";
void setup() {
Serial.begin(9600);
WiFi.mode(WIFI_STA);
WiFi.begin(meuSSID , meuPASS);
int status = WiFi.status();
while (status != WL_CONNECTED) {
Serial.print("status:");
Serial.println(status);
Serial.print("ip:");
Serial.println(WiFi.localIP());
Serial.println(WiFi.macAddress());
Serial.println("Conectando...");
status = WiFi.status();
delay(1000);
}
Serial.println(WiFi.localIP());
}
void loop() {
Serial.println("Oi");
delay(1000);
}
I tried to put WiFi.setMinSecurity(WIFI_AUTH_WPA2_PSK);, but no sucess.
Output (my wifi)
status:0
ip:0.0.0.0
24:6F:28:B0:28:6C
Conectando...
status:0
ip:0.0.0.0
24:6F:28:B0:28:6C
Conectando...
(...)
Output (my cellphone)
status:6
ip:0.0.0.0
24:6F:28:B0:28:6C
Conectando...
status:6
ip:192.168.43.1
24:6F:28:B0:28:6C
Conectando...
192.168.43.1
1 Answer
I was looking in my router configuration and its was blocking my ESP32 MAC so i just add another mac rule and now it connects.