How to Connect a Raspberry Pi Zero W to Wi-Fi: 3 Proven Methods

Raspberry Pi Zero W — is a compact single-board computer with an integrated module Wi-Fi 802.11n And Bluetooth 4.1, which is ideal for smart home projects, mini servers, and portable devices. However, its main drawback—the lack of an Ethernet port—makes many users struggle with initial network connection. Without a wired connection, setting up Wi-Fi can be a daunting task, especially if you don't have an extra monitor or keyboard handy.

In this article we will look at three reliable connection methods Raspberry Pi Zero W to Wi-Fi: via file editing wpa_supplicant.conf on the memory card, using the utility raspi-config and manually via the command line. Each method is suitable for different scenarios—from a head unit without peripherals to a full setup with a screen. You'll also learn how to diagnose connection issues and what settings optimize network performance.

Important: All instructions are valid for Raspberry Pi OS (previously Raspbian) versions Bullseye And BookwormIf you are using alternative OS (for example, DietPi or Ubuntu Core), some commands and file paths may differ.

📊 How do you plan to use the Raspberry Pi Zero W?
Smart home (Home Assistant, IoT)
Media Center (Kodi, Plex)
Game console (RetroPie)
Server (Nextcloud, Pi-hole)
Another project

1. Preparation: what you will need for connection

Before you begin setting up Wi-Fi, make sure you have everything you need. The minimum set will vary depending on the method you choose, but you'll need:

Myself Raspberry Pi Zero W (or Zero WH with soldered contacts). Models without index W (For example, Pi Zero v1.3) do not have a Wi-Fi module and will not work.

microSD card (class 10 recommended, capacity from 8 GB) with recorded Raspberry Pi OS Lite or the full version. For the file editing method wpa_supplicant.conf Even an empty card will do, as long as it's formatted in FAT32.

power unit 5V/2.5A with microUSB connector (for Zero W) or USB-C (for Zero 2 W). Using low-quality adapters may result in unstable operation of the Wi-Fi module.

Additionally, you may find the following useful:

  • 🖥️ Computer with a card reader for editing files on microSD.
  • 🔌 USB-OTG adapter and a keyboard (if you plan to configure it via the console).
  • 📡 Router with known network names (SSID) and password.
  • 🔧 Image burning program (Raspberry Pi Imager, BalenaEtcher).

If you are setting up Pi Zero W For the first time, we recommend starting with the file editing method wpa_supplicant.conf — it doesn't require a monitor or keyboard connection. For experienced users, setting it up via raspi-config or command line.

2. Method 1: Configuring Wi-Fi via the wpa_supplicant.conf file (without a monitor)

This method is ideal for initial connectionwhen you have no way to connect to Pi Zero W keyboard or screen. All manipulations are performed on the computer with the memory card.

Step 1. Insert the microSD card with the recorded Raspberry Pi OS to your computer. If you haven't yet written the image, do so using Raspberry Pi Imager, by selecting the version Lite (without graphical interface).

Step 2. Open the root partition of the card (usually it is called boot). Create a new text file there with the name:

wpa_supplicant.conf

Step 3. Open the file in any text editor (for example, Notepad++ or VS Code) and paste the following template, replacing YOUR_SSID And YOUR_PASSWORD to your network data:

country=RU

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

network={

ssid="YOUR_SSID"

psk="YOUR_PASSWORD"

key_mgmt=WPA-PSK

}

Important nuances:

  • 🌍 Parameter country=RU Sets the region to comply with local Wi-Fi regulations. For other countries, use the two-letter code (e.g., US, DE).
  • 🔒 If your network uses hidden SSID, add a line scan_ssid=1 inside the block network.
  • 📶 For networks with Enterprise authentication (for example, in offices) additional parameters will be required: eap=PEAP, identity="your_login" And password="your_password".

Step 4. Save the file and safely remove the card from your computer. Insert it into Raspberry Pi Zero W and apply power. The device should connect to Wi-Fi within 1–2 minutes.

Turn on your Pi Zero W and wait 2 minutes|Try connecting to the device via SSH (command: ssh pi@raspberrypi.local)|Check the IP address in the list of connected devices on the router|If it doesn't work, double-check the file syntax wpa_supplicant.conf

-->

3. Method 2: Using raspi-config (with monitor and keyboard)

If you have the ability to connect to Pi Zero W monitor (via mini-HDMI) and the keyboard (via USB-OTG), setting up Wi-Fi will take no more than a minute using the built-in utility raspi-config.

Step 1. Connect all peripheral devices and apply power to Pi Zero WAfter the system boots, log in. pi and password raspberry (if you haven't changed it).

Step 2. Enter the command to launch the configuration utility:

sudo raspi-config

Step 3. Go to section: System Options → Wireless LAN

The system will ask:

  1. Network Name (SSID) - enter the exact name of your Wi-Fi network (case-sensitive!).
  2. Password - Enter the security key.

Step 4. After entering the data, select Finish and confirm the reboot. Pi Zero W will connect to the network automatically at the next startup.

⚠️ Attention: If there is no connection after reboot, check:

  • 📵 Make sure you entered the correct password (registry errors are a common cause of problems).
  • 🔄 Router settings: some models block new devices by default (see section "Control of connected devices" in the router's web interface).
  • 🔌 Does it eat? Pi Zero W from a high-quality power supply (insufficient voltage may turn off the Wi-Fi module).
What to do if raspi-config does not save settings?

If after reboot the changes in raspi-config not applied, check file permissions /etc/wpa_supplicant/wpa_supplicant.conf. Enter the command:

sudo chmod 600 /etc/wpa_supplicant/wpa_supplicant.conf

Then restart raspi-config and try setting up Wi-Fi again.

4. Method 3: Manual configuration via the command line

This method is suitable for experienced users who prefer to work directly with configuration files. It is also useful if the previous methods did not work or if you need setting up multiple networks.

Step 1. Connect to Pi Zero W through SSH (if you already have cable access) or use a monitor with a keyboard. Enter the command to edit the configuration file:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Step 2. Add a block with your network settings to the end of the file (similar to Method 1):

network={

ssid="YOUR_SSID"

psk="YOUR_PASSWORD"

key_mgmt=WPA-PSK

}

For networks with open access (without password) use:

network={

ssid="YOUR_SSID"

key_mgmt=NONE

}

Step 3. Save changes (Ctrl+O, then Enter) and close the editor (Ctrl+X). Restart the service. wpa_supplicant:

sudo wpa_cli -i wlan0 reconfigure

Step 4. Check the connection status with the command:

iwconfig wlan0

The output should show a line with your SSID and parameter Link Quality.

5. Diagnosing connection problems

If Raspberry Pi Zero W If your Wi-Fi is not connecting, follow this diagnostic algorithm:

1. Checking the interface status wlan0

Run the command:

ifconfig wlan0

If the interface is missing from the output, the Wi-Fi module is not initialized. Try rebooting it:

sudo ifconfig wlan0 up

2. Scanning available networks

Make sure your network is visible to the device:

sudo iwlist wlan0 scan | grep SSID

If your SSID not in the list:

  • 📡 Check that the router is turned on and broadcasting the network.
  • 🔍 Make sure that Pi Zero W is within the coverage area (Wi-Fi module) Zero W weaker than full-size models Raspberry Pi).
  • 🔄 Restart your router - this can sometimes help resolve SSID broadcast issues.

3. Checking system logs

Review the service log wpa_supplicant:

sudo journalctl -u wpa_supplicant -b

Pay attention to lines with errors, for example:

  • Authentication with [MAC] timed out - Incorrect password or encryption type.
  • No suitable network found — network not found or hidden.

4. Testing the connection to another network

Try connecting to a different access point (for example, a smartphone in modem mode). If the connection is successful, the problem lies with the main router settings.

sudo nano /etc/dhcpcd.conf

Add the following lines:

interface wlan0

static ip_address=192.168.1.100/24

static routers=192.168.1.1

static domain_name_servers=8.8.8.8

(replace IP with the ones relevant for your network).-->

6. Optimizing Wi-Fi on Raspberry Pi Zero W

Wi-Fi module Zero W It is not very powerful, so for stable operation it is recommended to perform several optimizations:

1. Changing regional settings

Some Wi-Fi channels may be blocked in your region. Check your current settings:

sudo iw reg get

If the country is incorrect, please change it:

sudo raspi-config

Go to Localisation Options → WLAN Country and select your region.

2. Forced use of 2.4 GHz

Module Zero W It doesn't support 5 GHz, but may sometimes try to connect to non-existent networks. To avoid delays, disable 5 GHz scanning:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Add a line to the block network:

disabled=1

For networks with 802.11n You can also explicitly specify the standard:

proto=RSN

pairwise=CCMP

group=CCMP

3. Reduce energy consumption

The Wi-Fi module may shut down due to insufficient power. To reduce the load:

  • 🔌 Use the power supply on 5V/3A (even if the specification says 2.5A).
  • ⚡ Disconnect unnecessary USB devices (for example, flash drives without LEDs).
  • 📉 Reduce Wi-Fi power (if the signal is already stable):
    sudo iwconfig wlan0 txpower 10

    (meaning 10 - this is 10 dBm, usually by default 31).

4. Updating the Wi-Fi module firmware

In rare cases, instability is related to outdated firmware. Update it:

sudo apt update

sudo apt install firmware-brcm80211

Problem Possible cause Solution
No networks visible when scanning The Wi-Fi module is disabled or faulty sudo ifconfig wlan0 up or check the power supply
The connection is broken after 1-2 minutes Insufficient power supply or interference 5V/3A power supply or change the channel on the router
Unable to connect to hidden network Missing parameter scan_ssid=1 Add a line to wpa_supplicant.conf
Slow speed (less than 10 Mbps) Outdated 802.11b standard or interference Force set 802.11n in the settings
No IP address assigned (no DHCP) Router DHCP server failure Assign a static IP in /etc/dhcpcd.conf

7. Alternative connection methods (if Wi-Fi doesn't work)

If none of the methods help, consider alternative connection options. Raspberry Pi Zero W to the network:

1. USB-ethernet via OTG

By using USB-OTG adapter and cable Ethernet-USB can be connected Pi Zero W to the router via wire. To do this:

  1. Turn on the mode USB Ethernet Gadget V raspi-config (Advanced Options → USB Gadget).
  2. Connect the adapter to the port USB on Pi Zero W and connect it to your router or PC.
  3. Set up Internet sharing on the main device (for example, via Connection Sharing in Windows).

2. Bluetooth bridge

If the Wi-Fi module is faulty, but Bluetooth It works, you can use your smartphone as a bridge:

  1. Turn it on on your smartphone Bluetooth tethering.
  2. Connect Pi Zero W to the phone via bluetoothctl:
bluetoothctl

power on

agent on

scan on

pair [phone MAC address]

connect [phone's MAC address]

3. Configuration via serial console (UART)

This will require USB-to-TTL adapter (For example, CP2102). Connect it to the contacts TX, RX And GND on Pi Zero W, then use the program PuTTY or screen to access the console:

screen /dev/ttyUSB0 115200

⚠️ Attention: When working with UART Disable the console on the port ttyAMA0Otherwise, conflicts with Bluetooth may occur. To do this, edit the file:

sudo nano /boot/config.txt

And add the line:

enable_uart=1

8. Common mistakes and how to avoid them

Even experienced users sometimes encounter problems when setting up Wi-Fi on Raspberry Pi Zero WHere are the most common mistakes and how to avoid them:

1. Typos in wpa_supplicant.conf

Any extra comma or space can cause a crash. Always check the file for syntax errors with the command:

wpa_cli -i wlan0 reconfigure

If the output contains OK, the file is correct.

2. Incompatible router settings

Some routers (especially older models) TP-Link or D-Link) use non-standard encryption protocols. If Pi Zero W does not connect:

  • 🔧 Change the security type on your router WPA2/WPA3 Mixed on WPA2-PSK (AES).
  • 🔄 Turn off the feature Quick Connection (Fast Roaming) or 802.11r.

3. IP address conflict

If there is already a device with the same IP on the network, Pi Zero W will not be able to obtain an address. Check the list of leased IPs in the router's web interface (section DHCP Clients) and reserve the address for you if necessary Pi Zero W by MAC.

4. MAC address blocking

Some routers have a MAC filtering feature. Make sure your router's MAC address is Pi Zero W whitelisted. You can find it using the command:

cat /sys/class/net/wlan0/address

5. Outdated version Raspberry Pi OS

In old images (before Buster) There could be bugs in the Wi-Fi drivers. Update the system:

sudo apt update && sudo apt full-upgrade -y
How do I reset all Wi-Fi settings to factory defaults?

If you've been experimenting with the settings and want to return everything to its original state, run:

sudo rm /etc/wpa_supplicant/wpa_supplicant.conf

sudo reboot

After rebooting, the file will be recreated with default settings.

FAQ: Answers to Frequently Asked Questions

Is it possible to connect a Raspberry Pi Zero W to Wi-Fi without a monitor and keyboard?

Yes, the easiest way is to edit the file wpa_supplicant.conf on the memory card before the first launch (see Method 1 in the article). You can also use USB-OTG to connect via Ethernet or Bluetooth for remote configuration.

Why can't my Raspberry Pi Zero W see my 5 GHz network?

Module Zero W only supports range 2.4 GHzIf your router broadcasts both networks with the same SSID, the device will automatically connect to 2.4 GHz. To avoid confusion, we recommend separating the networks on the router (for example, MyWiFi_2G And MyWiFi_5G).

How to find the IP address of a Raspberry Pi Zero W on a network?

There are several ways:

  1. View the list of connected devices in the router's web interface.
  2. Use command arp -a on another device on the same network.
  3. Connect via mDNS (if enabled): ssh pi@raspberrypi.local.
  4. Install on Pi Zero W a script that, when run, sends the IP to your email or Telegram-bot.

Can you use Raspberry Pi Zero W as a Wi-Fi repeater?

Yes, but with limitations. Zero W does not support the mode AP+STA (simultaneous operation of the access point and client) at the driver level. However, it is possible:

  • Set it up like this client (connect to an existing network) and distribute the Internet via Ethernet USB-OTG.
  • Use an external Wi-Fi adapter (via USB hub) to organize a repeater.

For a full-fledged repeater it is better to choose Raspberry Pi 3/4 or specialized devices.

How to update the Wi-Fi driver on a Raspberry Pi Zero W?

The Wi-Fi driver is part of the kernel and is updated with the system. To apply the latest fixes:

  1. Update package lists: sudo apt update.
  2. Update kernel and firmware: sudo apt install --upgrade raspberrypi-bootloader raspberrypi-kernel.
  3. Reboot your device: sudo reboot.

To manually reinstall the Wi-Fi firmware, follow these steps:

sudo apt install --reinstall firmware-brcm80211