Skip to content

Instantly share code, notes, and snippets.

@misterhay
Last active July 11, 2023 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misterhay/b93ca6d943419571c6a049a2b0a5ae5b to your computer and use it in GitHub Desktop.
Save misterhay/b93ca6d943419571c6a049a2b0a5ae5b to your computer and use it in GitHub Desktop.
Raspberry Pi Pico W SSID Scan
# 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