0
0
Iot-protocolsHow-ToBeginner · 3 min read

Raspberry Pi WiFi Not Connecting Fix: Simple Steps to Solve

To fix Raspberry Pi WiFi not connecting, first check your /etc/wpa_supplicant/wpa_supplicant.conf file for correct network details and ensure your WiFi is enabled. Restart the networking service with sudo systemctl restart dhcpcd or reboot the Pi to apply changes.
📐

Syntax

The main file to configure WiFi on Raspberry Pi is /etc/wpa_supplicant/wpa_supplicant.conf. It contains network details like SSID and password.

Each network block looks like this:

  • network={}: Defines a WiFi network block.
  • ssid="YourNetworkName": Your WiFi name inside quotes.
  • psk="YourPassword": Your WiFi password inside quotes.

After editing, restart the network service or reboot to apply changes.

conf
network={
    ssid="YourNetworkName"
    psk="YourPassword"
    key_mgmt=WPA-PSK
}
💻

Example

This example shows how to add your WiFi details to wpa_supplicant.conf and restart the network service to connect.

bash
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

# Add the following at the end of the file:
network={
    ssid="HomeWiFi"
    psk="mypassword123"
    key_mgmt=WPA-PSK
}

# Save and exit, then restart the network service:
sudo systemctl restart dhcpcd

# Check connection status:
ip a
ping -c 3 google.com
Output
3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 14.123/15.456/16.789/0.876 ms
⚠️

Common Pitfalls

Common mistakes include:

  • Incorrect SSID or password in wpa_supplicant.conf.
  • Not restarting the network service or rebooting after changes.
  • WiFi disabled via hardware switch or software settings.
  • Conflicts with other network managers.

Always double-check your WiFi name and password, and ensure your Raspberry Pi’s WiFi is enabled.

conf
Wrong way:
network={
    ssid=HomeWiFi
    psk=mypassword123
}

Right way:
network={
    ssid="HomeWiFi"
    psk="mypassword123"
    key_mgmt=WPA-PSK
}
📊

Quick Reference

StepCommand or ActionPurpose
1Edit /etc/wpa_supplicant/wpa_supplicant.confAdd correct WiFi SSID and password
2sudo systemctl restart dhcpcdRestart network service to apply changes
3Check WiFi status with ip aVerify WiFi interface is up
4ping -c 3 google.comTest internet connectivity
5Reboot if neededApply all changes cleanly

Key Takeaways

Always verify your WiFi name (SSID) and password are correct in wpa_supplicant.conf.
Restart the network service or reboot the Raspberry Pi after making changes.
Check that WiFi is enabled and not blocked by hardware or software switches.
Use commands like ip a and ping to confirm network connection status.
Avoid syntax errors by enclosing SSID and password in double quotes.