wl.isconnected() timeout possible?
-
Just came across a scenario i have never experienced. If i am trying to connect to a wifi ap and it never connects, how do i get it to continue the rest of the code?
from network import WLAN import os import time import machine import pycom # len([item for item in os.listdir() if fname==item])>0 wl = WLAN(mode=WLAN.STA) wl.connect("xer", (WLAN.WPA2, "0996"), timeout=10000) print("_connect_wifi::Connected to with IP address:",wl.ifconfig()) time.sleep(1) while not wl.isconnected(): #it could lock here for ever!!!! machine.idle() # save power while waiting time.sleep(5) print("not connected to wifi yet..") pycom.heartbeat(True) print("_connect_wifi::Connected to with IP s:",wl.ifconfig()) -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login