Example: 09-WiFi/scan.py
# 本作品采用MIT许可证授权。
# 版权所有 (c) 2013-2023 OpenMV LLC。保留所有权利。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# 扫描示例
#
# 此示例展示了如何扫描 WiFi 网络。
import time
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
print("Scanning...")
while True:
scan_result = wlan.scan()
for ap in scan_result:
print(
"SSID: %s BSSID: %s Channel: %d RSSI: %d Auth: %d"
% (ap[0], ":".join(["%X" % i for i in ap[1]]), ap[2], ap[3], ap[4])
)
print()
time.sleep_ms(1000)