ESP 32 doesn't connect to wifi

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

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like