debug: test direct STA WiFi connection on LilyGO
This commit is contained in:
@@ -2087,6 +2087,23 @@ void connectStaWifi() {
|
||||
WiFi.disconnect(false, false);
|
||||
delay(500);
|
||||
WiFi.mode(WIFI_AP_STA);
|
||||
|
||||
Serial.println("STA debug: connecting to home WiFi...");
|
||||
WiFi.begin("WardAP", "Ward5213");
|
||||
|
||||
unsigned long staStart = millis();
|
||||
while (WiFi.status() != WL_CONNECTED && millis() - staStart < 15000) {
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
Serial.println();
|
||||
|
||||
if (WiFi.status() == WL_CONNECTED) {
|
||||
Serial.print("STA debug connected, IP: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
} else {
|
||||
Serial.println("STA debug connection failed or timed out");
|
||||
}
|
||||
delay(250);
|
||||
|
||||
WiFi.begin(staSsids[i].c_str(), staPasswords[i].c_str());
|
||||
|
||||
Reference in New Issue
Block a user