Or maybe this:
I have also found doing:
seems to help.
Code:
def connect(): sta_if.active(True) # seems more reliable to start with a fresh connect() if sta_if.isconnected(): sta_if.disconnect() print ('started in the connected state, but now disconnected') else: print ('started in the disconnected state') utime.sleep(0.1) etc
Code:
def disconnect(): sta_if.disconnect() sta_if.active(False)
seems to help.
Statistics: Posted by davefes — Tue Jan 16, 2024 6:49 pm