defconnect():sta_if.active(True)# seems more reliable to start with a fresh connect()ifsta_if.isconnected():sta_if.disconnect()print(f'started in the connected state, but now disconnected')else:print(f'started in the disconnected state')utime.sleep(0.1) while True: try: np[0] = (12...