At this momment there is no circuitpython support for the new Pico W version, so I made this MicroPython example to test the wireless connection on a RaspBerry Pico W.
I'm using ujson library to get my secrets from a json file. To get this example working place a secrets.json file at the root directory with the following structure:
{
"wifi": {
"ssid": "YOUR SSID",
"pass": "YOUR PASSWORD"
}
}
I'm running this program on a Raspeberry Pico W using Thonny.
If everything goes fine you should get the following shell output:
#[ 0] no connection and no activity
#[ 1] connecting in progress
#[-3] failed due to incorrect password
#[-2] failed because no access point replied
#[-1] failed due to other problems
#[ 3] connection successful
Last connection is still active, disconnecting...
Trying connect YOUR SSID...
#[ 3] connection successful
IP = YOUR LOCAL IP
{'milliseconds_since_epoch': 1656961317486, 'date': '07-04-2022', 'time': '07:01:57 PM'}