Checkout the getting started tutorial if you have no experience in programming the Raspberry Pi Pico.
This tutorial will first discuss setting up Wi-Fi with the IOTroam service available at the University of Twente, then after that, give some alternatives to get connected, see “Other options”.
Although this tutorial is for MicroPython, it is also possible to connect to Wi-Fi if you use CircuitPython.
Wi-Fi at the University of Twente: IOTroam
My students can make use of pre-registered Raspberry Pi Pico W’s from the Electronics Kit provided at several courses. That means that all they have to do is run an example script to get the MAC address of that Pico, and then get the password for that specific Pico and put that in a script to connect to Wi-Fi.
Other options will be discussed later.
First, start a new MicroPython project for this project. (details here)
Download the “wifi_mac_address.py” script and copy or save it into the project. Open it, connect the Pico to your computer and run the script. It should show the MAC address:

In the case above, the MAC address is d83add76479e.
Next, get the password here (by filling in the MAC address you just got).
Getting connected with the second example script
Get the second example script “wifi_get_url.py” and add that to the project too.
Update the password in the script at line 14 with the password you just got:

After running the script, you should see something like this:

Meaning that it connected successfully and has written a random number to the online variable store check-iotroam-XXXXXXXX.
Other options
If your device is not pre-registered, you are free to register it yourself at the IOTroam service (if you are an employee or a student of a university or school which it affiliated with Surfnet.
In other cases, use Wi-Fi credentials of your own router (eg. at home).
A quick way of giving your device access to the Wi-Fi is using your phone as a portable hotspot.
In all these cases you can follow the steps above from “Getting connected with the second example script”.
Next: Create a connected sensor that stores values online
Create a connected sensor that stores values online (see Wi-Fi section at the bottom of that page)
