Last active
July 11, 2023 16:28
-
-
Save misterhay/b93ca6d943419571c6a049a2b0a5ae5b to your computer and use it in GitHub Desktop.
Raspberry Pi Pico W SSID Scan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://dev.webonomic.nl/scanning-network-with-the-raspberry-pi-pico-w | |
import network | |
import binascii | |
wlan = network.WLAN() # network.WLAN(network.STA_IF) | |
wlan.active(True) | |
networks = wlan.scan() # list with tupples with 6 fields ssid, bssid, channel, RSSI, security, hidden | |
networks.sort(key=lambda x:x[3],reverse=True) # sorted on RSSI (3) | |
for i, w in enumerate(networks): | |
print(i, w[0].decode(), binascii.hexlify(w[1]).decode(), w[2], w[3], w[4], w[5]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment