Skip to content

Commit

Permalink
Report BSSID's to help distinguish wifi networks
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Dec 17, 2024
1 parent e92cd18 commit d5d3bd0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ build_flags =
-DDEBUG_RP2040_CORE
-DDEBUG_RP2040_WIFI
-DNDEBUG
-DLWIP_DEBUG
-DLWIP_DEBUG=1
-DDEBUG_RP2040_PORT=Serial1
-DDEBUG_RP2040_UART_1
-DDEBUG_RP2040_UART=1
Expand Down
19 changes: 15 additions & 4 deletions src/network_interfaces/ws_networking_pico.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,23 @@ class ws_networking_pico : public Wippersnapper {

// User-set network not found, print scan results to serial console
WS_DEBUG_PRINTLN("ERROR: Your requested WiFi network was not found!");
WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks: ");
for (int i = 0; i < n; ++i) {
WS_DEBUG_PRINTLN("WipperSnapper found these WiFi networks:");
for (uint8_t i = 0; i < n; ++i) {
WS_DEBUG_PRINT(WiFi.SSID(i));
WS_DEBUG_PRINT(" ");
WS_DEBUG_PRINT(" (");
uint8_t BSSID[WL_MAC_ADDR_LENGTH];
WiFi.BSSID(i, BSSID);
for (int m = 0; m < WL_MAC_ADDR_LENGTH; ++m) {
if (m != 0) {
WS_DEBUG_PRINT(":");
}
WS_DEBUG_PRINTHEX(BSSID[m]);
}
WS_DEBUG_PRINT(") ");
WS_DEBUG_PRINT(WiFi.RSSI(i));
WS_DEBUG_PRINTLN("dB");
WS_DEBUG_PRINT("dB (ch");
WS_DEBUG_PRINT(WiFi.channel(i))
WS_DEBUG_PRINTLN(")");
}

return false;
Expand Down

0 comments on commit d5d3bd0

Please sign in to comment.