Skip to content
Discussion options

You must be logged in to vote

I have a Pico W that connects OK either using USB or battery power. My codes a little different to yours:

station.active(True)
while True:
  try:
	  station.scan()
	  station.connect(SSID,PSWD)	
  except:
	  pass	
  if station.isconnected():
	  break
print('Connection successful')

When making network connections I always use a loop that keeps trying and ignores errors and not just with the Pico W.

Rather bizarely I found I get much more reliable connections with the Pico if I include the .scan() before trying to connect.

I'm using a relatively recent nightly build.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@XexusUs
Comment options

Answer selected by XexusUs
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants