I scan for all SSIDs in the area, and when the one I'm looking for is found, I attempt to connect to it.
if (WiFi.SSID(i) == "MySSID") {
foundSSID = true;
Serial.print("Found ");
Serial.println(WiFi.SSID(i));
WiFi.mode(WIFI_STA);
Serial.printf("Wi-Fi mode set to WIFI_STA %s\n", WiFi.mode(WIFI_STA) ? "" : "Failed!");
WiFi.begin("MySSID", "MyPASS");
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
WiFi.printDiag(Serial);
}
}
And then it starts ...
Network name: MySSID
Signal strength: -59
Found InfluxIoT
Wi-Fi mode set to WIFI_STA
waiting for Wifi
Mode: STA
PHY mode: N
Channel: 7
AP id: 0
Status: 1
Auto connect: 1
SSID (9): MySSID
Passphrase (13): MyPASS
BSSID set: 0
Mode: STA
PHY mode: N
Channel: 14
AP id: 0
Status: 1
Auto connect: 1
SSID (9): MySSID
Passphrase (13): MyPASS
BSSID set: 0
scandone
no MySSID found, reconnect after 1s
reconnect
And this will go on forever.
Yes, I've validated that the SSID and password are correct (change here for obvious reasons).
I am running the Access Point in Linux, and so I have watched hostapd and while other clients show up when connecting:
wlan0: STA 00:00:00:00:0:00 WPA: pairwise key handshake completed (RSN)
wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: associated
wlan0: AP-STA-CONNECTED xx:xx:xx:xx:xx:xx
The MAC address of this device never shows up, which means that it is never even attempting to send the password for the network.
What could possibly be the problem here?