Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/validation/wifi/test_wifi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
def test_wifi(dut):
dut.expect_exact("Scan start")
dut.expect_exact("Scan done")
dut.expect_exact("Wokwi-GUEST")
dut.expect_exact("WiFi connected")
dut.expect_exact("IP address:")
22 changes: 22 additions & 0 deletions tests/validation/wifi/wifi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,28 @@ void setup() {
Serial.println(eventID);
// WiFi.removeEvent(eventID);

Serial.println("Scan start");

// WiFi.scanNetworks will return the number of networks found.
int n = WiFi.scanNetworks();
Serial.println("Scan done");
if (n == 0) {
Serial.println("no networks found");
} else {
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i) {
// Print SSID for each network found
Serial.printf("%s\n", WiFi.SSID(i).c_str());
Serial.println();
delay(10);
}
}
Serial.println("");

// Delete the scan result to free memory for code below.
WiFi.scanDelete();

WiFi.begin(ssid, password);

Serial.println();
Expand Down