How to scan for wifi networks when already connect...
# help
h
Hi, it's probably easy but I can't seem to find out how I can scan for wifi networks. I always get the error "wifi already connected or established". I read some posts by @bmentink and I tried
jag run  -D jag.disabled -D jag.timeout=20000s webserver.toit --assets webserver.assets
but the result is the same. Can I use an active wifi connection to scan for networks? Or is it physically impossible to scan for networks when a wifi connection has already been established? (I didn't think so, but I might be wrong, - it happens.)
(I just checked with my old Arduino software and it can scan for networks while having an established wifi connection.)
f
I think Toit doesn't support scanning while being connected (yet).
h
OK, thanks Florian, no worries, I'll put that one aside then for now. Should I make an issue/request for it somewhere?
f
I just looked at the code.
It seems like we just abort the scan if we are already connected.
I removed that check, and things just seem to work.
Will write a PR, and it will likely be in the next SDK release.
h
Excellent! Thanks so much Florian!