0

maybe this is a dumb question, but is there a way to test for wrong wifi password,

I know you can do WL_CONNECT to check if the password works, but is there a command for checking if the password is wrong? not just by waiting.

  • my esp is trying to connect to the WiFi – Marius Wanscher Oct 15 at 19:20
  • i guess that makes my esp client – Marius Wanscher Oct 15 at 19:21
  • there's no way to tell if a password is right or wrong other than by trying to use it. – dandavis Oct 16 at 16:13
  • @dandavis but the WiFi class does not return the info even though it's available. It simply returns an error. – Sim Son Oct 16 at 17:54
1

The information is available on SDK level. If you include #include "user_interface.h", you can use function wifi_station_get_connect_status(). It returns one of:

STATION_GOT_IP
STATION_NO_AP_FOUND
STATION_CONNECT_FAIL
STATION_WRONG_PASSWORD
STATION_IDLE

The WiFi.status() function uses function wifi_station_get_connect_status(), but returns WL_CONNECT_FAILED for STATION_WRONG_PASSWORD.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.