Code: Select all
>>> interface.scan()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: scan failed
Code: Select all
>>> interface.scan()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: scan failed
Code: Select all
try:
scan_results = wifi.scan()
except:
## for some odd reason OSERROR here means no wifi APs found
scan_results = None
I know, this is very old but yes, I have the same Problem.eradicatore wrote: ↑Thu Nov 16, 2017 8:21 pmI still can't get the try/except to work around this failure when there are no wifi scan results. Does anyone else see this failure if there are zero ap's visible when you try to scan? Why would code like this not work?
Code: Select all
from network import WLAN
wlan=WLAN()
while True:
try:
print(wlan.scan())
except OSError:
print("Silence")