#include <WiFi.h>
#define WIFI_SSID "Wokwi-GUEST"
#define WIFI_PASSWORD ""
// Defining the WiFi channel speeds up the connection:
#define WIFI_CHANNEL 10
String IP = "00:00:00:00:00:00";
void setup() {
Serial.begin(115200);
Serial.println();
Serial.print("ESP Board MAC Address: ");
IP = WiFi.macAddress();
IP.replace(":", "");
Serial.println(WiFi.macAddress());
Serial.println(IP);
int n = WiFi.scanNetworks();
Serial.println("Scan completed");
for (int i = 0; i < n; i++) {
// Get the signal strength of the i-th access point
int signal_strength = WiFi.RSSI(i);
// Get the BSSID of the i-th access point
uint8_t* bssid = WiFi.BSSID(i);
Serial.println(WiFi.BSSIDstr(i));
}
WiFi.begin(WIFI_SSID, WIFI_PASSWORD, WIFI_CHANNEL);
Serial.print("Connecting to WiFi ");
Serial.print(WIFI_SSID);
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}
Serial.println(" Connected!");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
}