wlan.scan() only shows 17 APs
Breazile last edited by Breazile
I'm using a Lopy4 on a pysense with the latest firmware. I am unable to connect to my AP, at some locations, so I printed out all of the APs that were discovered. Turns out that wlan.scan() does not show all of the available APs. Maybe the system has a limit to the number that it will find. Does anyone know if this limit is configurable? It is able to find and connect to my AP in a place where there are less APs in the environment.
Here is the code, and it only prints the first 17 APs. Even if I try the connect call without a scan it fails. My theory is that the Lopy can only have so many APs in memory, and the one I want to connect to is not in the list. Is that true, and can you control how many APs it can handle?
wlan = WLAN(mode=WLAN.STA, power_save=True) nets = wlan.scan() print('Found ',nets) for net in nets: if net.ssid == WIFI_SSID: print('Network found!') wlan.connect(net.ssid, auth=(net.sec, WIFI_PASS), timeout=60000) while not wlan.isconnected(): machine.idle() # save power while waiting print('WLAN connection succeeded!') break else: print('ignoring', net.ssid)```
@breazile Hi, I'll take a look at that limit later. In the meantime, if you know your SSID and security settings, you can connect to your network without scanning first.