-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: No Return of status WRONG_PASSWORD
during WiFi Connect
#8233
Comments
WRONG_PASSWORD
during WiFi ConnectWRONG_PASSWORD
during WiFi Connect
WRONG_PASSWORD
during WiFi ConnectWRONG_PASSWORD
during WiFi Connect
WRONG_PASSWORD
during WiFi ConnectWRONG_PASSWORD
during WiFi Connect
Does it have different results replacing - WiFi.setAutoConnect(false);
+ WiFi.setAutoConnect(true); ? edit: is this related to the #7432? |
I will try |
see also this Note: |
With the setting
|
With the setting
|
looking at the event handler, it does not see the invalid psk reason as well int reason{0};
// insert this in the connect-check loop
void dump_reason() {
if (reason > 0) {
int copy{reason};
reason = 0;
Serial.printf(" 4 - WiFi disconnect event: %d\n", copy);
}
}
void setup() {
static auto disconnected = WiFi.onStationModeDisconnected([](const auto& event) {
reason = event.reason;
});
... the rest ...
}
while on the ap box, hostapd logs psk mismatch
also note the invalid psk test should be at least 8bytes long i.e. something like testtest |
Do I have it implemented Correctly? bool wifi_connect(const char *_SSID, const char * _PASSWORD, const char *_hostname = nullptr){
Serial.printf("Set WiFi mode to WIFI_STA - %d\n", WiFi.mode(WIFI_STA));
if (_hostname != nullptr) WiFi.hostname(_hostname);
// Warte auf Verbindung
WiFi.begin(_SSID, "testtest");
while (WiFi.status() != WL_CONNECTED) {
dump_reason();
// Status function from API
uint8_t status_API = wifi_station_get_connect_status();
Serial.printf(" 1 - Wifi status API:\t%d\n", status_API);
// Status from Arduino core
wl_status_t status_CORE = WiFi.status();
Serial.printf(" 2 - Wifi status core:\t%d\n", status_CORE);
Serial.printf(" 3 - Wifi status:\t%d\n", get_wifi_status());
if ((status_API == STATION_WRONG_PASSWORD) || (status_CORE == WL_WRONG_PASSWORD)){
return true;
}
delayMicroseconds(100);
}
return true;
} void setup() {
static auto disconnected = WiFi.onStationModeDisconnected([](const auto& event) {
reason = event.reason;
});
Serial.begin(115200);
pinMode(LED, OUTPUT);
while (!Serial) yield();
Serial.print("\n\n");
WiFi.printDiag(Serial);
WiFi.setAutoReconnect(false);
WiFi.setAutoConnect(false);
WiFi.persistent(false);
time_t tic {millis()};
digitalWrite(LED, HIGH);
if (wifi_connect(SSID, PASSWORD)) {
Serial.printf("time until connect: %0.3f s\n", (millis() - tic)/1000.0);
WiFi.disconnect();
digitalWrite(LED, LOW);
delay(1000);
}
} |
@mcspr your event will not be print in my code, maybee I implemented it wrong? |
the reason seems to be always |
as I modified it to run - https://gist.github.com/mcspr/c7b40fea7dd1323c11ad45b08103b979 |
Thanks for Your Update :-) Here is the result:
after 5400 s the WRONG PASSWORD rises... :-( |
how could we proceed now? |
from the examples above, imo it's a duplicate of the #7432
|
So you mean the introduced Enum WRONG_PASSWORD in core 3.0.0 has no intention to get the info of a wrong password within a few ms? |
this might be a historical feature that was never implemented / broken? one mention of it is here - tzapu/WiFiManager#528 (comment) |
Good to see its not a me problem, I was going crazy with this. I get 4 as the result of |
Basic Infos
Platform
Settings in IDE
Problem Description
When try to provoke the return off info
WL_WRONG_PASSWORD
this does not happen.sketch is provided.
MCVE Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: