Skip to content

Commit e612520

Browse files
committed
Report BSSID's to help distinguish wifi networks
1 parent e92cd18 commit e612520

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ build_flags =
494494
-DDEBUG_RP2040_CORE
495495
-DDEBUG_RP2040_WIFI
496496
-DNDEBUG
497-
-DLWIP_DEBUG
497+
-DLWIP_DEBUG=1
498498
-DDEBUG_RP2040_PORT=Serial1
499499
-DDEBUG_RP2040_UART_1
500500
-DDEBUG_RP2040_UART=1

src/network_interfaces/ws_networking_pico.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,21 @@ class ws_networking_pico : public Wippersnapper {
137137

138138
// User-set network not found, print scan results to serial console
139139
WS_DEBUG_PRINTLN("ERROR: Your requested WiFi network was not found!");
140-
WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks: ");
141-
for (int i = 0; i < n; ++i) {
140+
WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks:");
141+
for (uint8_t i = 0; i < n; ++i) {
142142
WS_DEBUG_PRINT(WiFi.SSID(i));
143-
WS_DEBUG_PRINT(" ");
143+
WS_DEBUG_PRINT(" (");
144+
uint8_t BSSID[WL_MAC_ADDR_LENGTH];
145+
WiFi.BSSID(i, BSSID);
146+
for (int m = 0; m < WL_MAC_ADDR_LENGTH; ++m) {
147+
if (m != 0) WS_DEBUG_PRINT(":");
148+
WS_DEBUG_PRINTHEX(BSSID[m]);
149+
}
150+
WS_DEBUG_PRINT(") ");
144151
WS_DEBUG_PRINT(WiFi.RSSI(i));
145-
WS_DEBUG_PRINTLN("dB");
152+
WS_DEBUG_PRINT("dB (ch");
153+
WS_DEBUG_PRINT(WiFi.channel(i))
154+
WS_DEBUG_PRINTLN(")");
146155
}
147156

148157
return false;

0 commit comments

Comments
 (0)