# Pico W will not join Wi-Fi in MicroPython: country, wait loop and 2.4 GHz

> Fix Wi-Fi on a Pico W: set station mode, connect, wait with a timeout, check the status code and use a 2.4 GHz network.

Canonical: https://roboticsengineering.in/fix/raspberry-pi-pico-w-wifi-micropython-wont-connect/ | Published: 2026-11-03 | Updated: 2026-11-04

**Activate the station interface, call connect, then wait and check the status.**

## What the message means

The connect call returns before the link is up. The status number tells you whether it failed because of the password, the network or the signal.

## Fix it in this order

1. Use network.WLAN(network.STA_IF), call active(True), then connect with the name and password.
2. Wait in a loop until isconnected() is true, with a timeout.
3. Print the status number and look it up in the documentation for your firmware.
4. Use a 2.4 GHz network.
5. Check the password and name for spaces and capitals.
6. Update the MicroPython firmware to a current Pico W build.

## Why it happens

The Pico W radio is a 2.4 GHz part, so it cannot join a 5 GHz-only network. The connect call starts the join and returns at once, which is why code that checks the result straight away reports a failure. Poll wlan.status() or isconnected() in a loop with a timeout. MicroPython defines constants such as network.STAT_WRONG_PASSWORD, network.STAT_NO_AP_FOUND and network.STAT_GOT_IP for the result, so compare against those names instead of guessing at numbers.

```
import network, time
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect("name", "password")
for _ in range(20):
    if wlan.isconnected():
        break
    print(wlan.status())
    time.sleep(1)
```

*The example above has not been run on hardware here; test it on your own board.*

## If you see this, do this

| You see | Do this |
| --- | --- |
| Status shows wrong password | Check the password. |
| Status shows no network | Band or distance. |

## Related

[Pico not detected](https://roboticsengineering.in/fix/raspberry-pi-pico-not-detected-bootsel/), [ESP32 Wi-Fi](https://roboticsengineering.in/fix/esp32-wifi-wont-connect/).

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.

## Why this happens

When you call connect on the Pico W, the radio chip first has to find the network, then authenticate, and then the Pico has to receive an address from the router using DHCP. Each stage takes time and each can fail separately. The status value reports which stage you are in, and this is why a one-time print right after connect is usually just 1, meaning still connecting.

The numbers MicroPython reports are small integers: 0 for idle, 1 for connecting, 2 for connected without an address yet, 3 for connected with an address, and negative values for failures such as a wrong password or no network found. The named constants in the network module are the safest way to compare them. A scan also helps, because it shows what the radio can actually hear, including the channel and signal strength.

## How to confirm the cause

- Call wlan.scan() and print the results. If your network name does not appear in the list, the radio cannot see it: wrong band, too far, or a hidden name.
- Each scan entry shows a channel. Channels 1 to 13 are in the 2.4 GHz band. Your network must be among them.
- Read the signal strength in the scan entry. Values near -50 are strong, values below about -80 are weak and often fail to connect.
- Print wlan.status() every second while connecting, and compare it with the constants network.STAT_WRONG_PASSWORD and network.STAT_NO_AP_FOUND.
- After status 3, print wlan.ifconfig(). A zero address or no output means DHCP did not finish.

## Worked example

This sketch lists what the radio can see before it tries to join. It is a walk-through of the checks above, so run it on your own board:

```
import network, time

wlan = network.WLAN(network.STA_IF)
wlan.active(True)
for ap in wlan.scan():                # (ssid, bssid, channel, rssi, security, hidden)
    print(ap[0], 'channel', ap[2], 'rssi', ap[3])

wlan.connect('name', 'password')
for _ in range(20):
    if wlan.status() < 0 or wlan.status() >= 3:
        break
    time.sleep(1)
print(wlan.status(), wlan.ifconfig())
```

## Common mistakes

- Putting a space or a different capital letter in the network name or password.
- Testing with a phone hotspot that is set to 5 GHz only.
- Waiting a fixed 1 second and giving up. A join can take several seconds.
- Powering the board from a weak USB port. The radio draws bursts of current when it transmits.
- Trying a network that needs a login page or enterprise credentials; a plain name and password connect does not cover that.

## If this did not fix it

- Router settings: MAC filtering, a full DHCP list, or WPA3-only mode can reject a client that has the right password.
- Old firmware: update to a current MicroPython build for the Pico W.
- Some guest or hotel networks isolate clients or require a web login, which a microcontroller cannot complete.
