Pico W Not Connecting to WiFi
Your Raspberry Pi Pico W fails to connect to WiFi networks. The device may scan networks but cannot authenticate, or the CYW43439 WiFi chip fails to initialize. This guide covers country code configuration, 2.4GHz network requirements, power supply issues, and driver problems.
Last updated: April 22, 2026 | 12 min read
Symptoms
- Pico W scans networks but fails to connect to your WiFi
- Serial Monitor shows "WiFi connecting..." then "WiFi connection failed"
- Error message: "WiFi: Could not connect to AP" or "WiFi: Connection timeout"
- Pico W connects but drops connection after a few seconds/minutes
- WiFi scan returns no networks
- Device works on some networks but not others
- Pico W connects to 2.4GHz but not 5GHz
- CYW43439 initialization fails at boot
Common Causes
- Missing Country Code Configuration Most common issue. Pico W requires WiFi country code for regulatory compliance
- 5GHz Network Only Pico W supports 2.4GHz ONLY . Does NOT support 5GHz networks
- Wrong WiFi Credentials SSID or password case-sensitive, special characters may cause issues
- Weak Signal Strength Pico W has less powerful WiFi than ESP32
- Insufficient Power Supply WiFi transmission draws ~160mA peak, causing brownout
- Incorrect WiFi Mode Pico W does not support enterprise WiFi without additional configuration
- Hidden SSID Network Pico W may have trouble connecting to hidden networks
Pico W WiFi Specifications
| Specification | Value | Note |
|---|---|---|
| WiFi Standards () | 802.11 b/g/n | No 5GHz support |
| Frequency Band () | 2.4 GHz | Channels 1-14 |
| Security () | WEP, WPA, WPA2-PSK, WPA3-PSK | No WPA2-Enterprise |
| TX Power () | Up to 20 dBm | Adjustable via API |
| Current Draw | 80-160 mA (typical) | Peak during transmission () |
| Antenna () | PCB trace antenna | Less sensitive than external antenna |
| Country Code Required () | YES () | Must set for WiFi to work |
Pico W MUST have country code configured before WiFi will work in most Arduino environments.
Step-by-Step Fixes
1. Set Country Code
Pico W requires WiFi country code for regulatory compliance:
#include
void setup() {
Serial.begin;
delay;
// CRITICAL: Set country code BEFORE WiFi.begin()
WiFi.setCountry; // For United States
// Other options:
// WIFI_COUNTRY_GB
// WIFI_COUNTRY_DE
// WIFI_COUNTRY_FR
// WIFI_COUNTRY_ES
// WIFI_COUNTRY_IT
// WIFI_COUNTRY_JP
// WIFI_COUNTRY_KR
// For Morocco, use WIFI_COUNTRY_MA or FR as fallback
// WIFI_COUNTRY_MA is available in newer board packages
Serial.print;
WiFi.begin;
// Rest of connection code...
}
2. Verify Network is 2.4GHz
Pico W does NOT support 5GHz networks:
- Log into your router admin panel
- Check if 2.4GHz band is enabled
- If both bands share the same SSID, create a separate 2.4GHz SSID for IoT devices
- Example: "MyWiFi" and "MyWiFi-2.4G"
- Connect Pico W to the 2.4GHz SSID only
3. Test WiFi Scan First
Verify Pico W can see your network:
#include
void setup() {
Serial.begin;
delay;
// Set country code first
WiFi.setCountry;
Serial.println;
int networks = WiFi.scanNetworks();
if {
Serial.println;
} else {
Serial.print;
Serial.println;
for {
Serial.print;
Serial.print;
Serial.print);
Serial.print(" (");
Serial.print);
Serial.println");
}
}
}
void loop() {}
4. Check Power Supply
WiFi transmission draws high current:
- Use 5V 1A power supply minimum
- Avoid powering from computer USB port
- Use quality USB cable
- Add 470-1000F capacitor between VBUS and GND for stability
- If voltage drops below 4.5V during WiFi connection, power supply is inadequate
5. Check Signal Strength
Pico W has less sensitive antenna than ESP32:
| RSSI Range | Quality | Action |
|---|---|---|
| -30 to -50 dBm | Excellent | Good connection |
| -50 to -65 dBm | Good | Works fine |
| -65 to -75 dBm | Weak | May disconnect, move closer to router |
| Below -75 dBm | Unusable | Relocate device or router |
6. Update Board Package
Older board packages have WiFi issues:
- Tools Board Boards Manager
- Search "Raspberry Pi Pico"
- Update to version 4.0.0 or newer
- Version 3.x had significant WiFi stability issues
- Restart Arduino IDE after update
- Re-upload firmware after update
7. Add Connection Retry Logic
Pico W may need multiple connection attempts:
bool connectToWiFi() {
int attempts = 0;
const int MAX_ATTEMPTS = 20;
WiFi.setCountry;
WiFi.begin(ssid, password);
while != WL_CONNECTED && attempts < MAX_ATTEMPTS) {
delay;
Serial.print(".");
attempts++;
}
if == WL_CONNECTED) {
Serial.println;
Serial.print;
Serial.println);
return true;
} else {
Serial.println;
Serial.print;
Serial.println);
return false;
}
}
WiFi Status Codes
| Code | Constant | Meaning | Solution |
|---|---|---|---|
| 0 | WL_NO_SHIELD | No WiFi hardware | Check Pico W board |
| 1 | WL_IDLE_STATUS | Idle, not connecting | Check credentials, country code |
| 4 | WL_CONNECT_FAILED | Connection failed | Wrong password, weak signal |
| 5 | WL_CONNECTION_LOST | Connected then lost | Power issue, interference |
| 6 | WL_DISCONNECTED | Disconnected | Check router, signal strength |
| 255 | WL_NO_SSID_AVAIL | Network not found | Wrong SSID, 5GHz only |
Prevention Tips
- Always set country code BEFORE WiFi.begin()
- Use 2.4GHz network only Pico W does NOT support 5GHz
- Keep Pico W within 5-10 meters of router
- Use quality 5V 1A+ power supply with capacitor
- Update board package to latest version
- Add WiFi auto-reconnect logic in firmware
- Use simple SSID and password
Related Issues
Frequently Asked Questions
Q: Does Pico W support 5GHz WiFi?
A: No. The CYW43439 chip only supports 2.4GHz . Make sure your router broadcasts a 2.4GHz network. If your router has both bands with the same name, create a separate 2.4GHz SSID.
Q: Why do I need to set country code? Other boards don't require it.
A: Pico W implements strict regulatory compliance for WiFi channels. The CYW43439 driver requires country code to know which channels are legal in your region. Without it, WiFi may not work at all. This is not a bug it's by design.
Q: Pico W WiFi is weaker than ESP32. Is this normal?
A: Yes. The CYW43439 has lower transmit power and less sensitive receiver than ESP32's WiFi. Expect ~30% shorter range. Position Pico W closer to router or add external antenna .
Still having WiFi issues? Contact Support or return to the Troubleshooting Hub.