Skip to content

Instantly share code, notes, and snippets.

@coenraadhuman
Created April 10, 2020 11:14
Show Gist options
  • Save coenraadhuman/2976a926b3c2360231c418c95aca2971 to your computer and use it in GitHub Desktop.
Save coenraadhuman/2976a926b3c2360231c418c95aca2971 to your computer and use it in GitHub Desktop.
RPi - Could not communicate with wpa_supplicant: error n2 wifi
Solution
I referred to this official forum.
Raspbian Stretch: Wifi not starting on boot – Raspberry Pi Forums
First,
sudo vim /etc/network/interfaces
and, you should write in bottom
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
This will allow wlan at startup. afterwards,
sudo systemctl enable wpa_supplicant.service
restart wpa_supplicant
sudo reboot now
@OldSurferDude
Copy link

OldSurferDude commented Aug 3, 2022

Just what I was seeking! My RPi Zero (not w) needed a WiFi dongle. OK, I got one, still didn't work. Searched and eventually found this. I would rewrite this for clarity.

  • make a copy of /etc/network/interfaces

    sudo cp /etc/network/interfaces /etc/network/interfaces.original

  • append to the file /etc/network/interfaces

    allow-hotplug wlan0
    iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

  • enable the wpa_supplicant service and restart

    sudo systemctl enable wpa_supplicant.service
    sudo systemctl restart wpa_supplicant

  • restart the system

    sudo reboot now

Thanks for being there

@RaulSofia
Copy link

Had the same problem on a RPi 2. After a long search finnaly found this answer - THANK YOU SO MUCH!!!

@MarreKanin
Copy link

Just made my setup work and I just got how wpa_supplicant is used. Thanks alot.

@RodrigoHernan
Copy link

I was searched by 4hs. I followed your steps and I could fixed. when I went to save the gist on bookmarks I saw that I had alredy saved in the past.
thanks twice times!!

@rs7k
Copy link

rs7k commented Sep 21, 2023

Thank you so much !!!

@MCFtm
Copy link

MCFtm commented Feb 26, 2024

Thank you. You made my day

@OldSurferDude
Copy link

We stand on the shoulders of giants! Become a giant ... Pay it forward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment