-->
Page 2 of 2

Re: Connect to WiFi gives code 6

PostPosted: Fri Oct 21, 2022 3:18 pm
by Rubens Matos
I get the same error, but I am sure the password is rith because I can connect in other devices, such as notebooks and smartphones using the same password

Re: Connect to WiFi gives code 6

PostPosted: Wed Dec 14, 2022 10:11 pm
by Dario_esp
The OP said "it gives" but we have to guess they probably meant WiFi.begin() was returning WL_WRONG_PASSWORD, and this highlights the importance of pasting error messages when looking for help.

WL_WRONG_PASSWORD, was defined in wl_definitions.h, and had nothing to do with what was set at the access point (AP aka router), at least in core version 3.0.2. The function behind WiFi.begin was meant to return WL_WRONG_PASSWORD if the pass phrase exceeded 64 chars.

The expected behaviour with a well written sketch, but using a 'wrong' pass phrase, is WiFi.status() == WL_DISCONNECTED. Fairly easy to test, with for example the OP's nearly complete code above.

For more in depth understanding, try https://github.com/esp8266/Arduino/ then use the search tool to find references of interest. Happy reading.