I have a raspberry pi 4 running raspberry pi os lite(headless). I have a wifi dongle attached to the pi for a better wifi signal (wlan1) as the built-in one was giving me issues, but I couldn't get wlan0 to connect to the network either. I'm using wpa_supplicant which worked perfect at my house but the location I'm at now has a hidden ssid and that seems to be the issue.

Ive tried using scan_ssid=1 which I thought would be the solution but it just didn't connect witch I thought to be very odd. I've tried adding a bunch of other options to get it to work such as 'proto', 'key_mgmt', 'pairwise' etc.

If I use sudo raspi-config to change the wifi network I get the error 'Could not communicate with wpa_supplicant' and 'There was an error running option N2 Wireless LAN'

here is the network configuration in /etc/wpa_supplicant...

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


output of 'ipa && ipr'

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:bd:b8:c5 brd ff:ff:ff:ff:ff:ff
    inet brd scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::fb4:fdb9:f917:c380/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b8:27:eb:e8:ed:90 brd ff:ff:ff:ff:ff:ff
4: wlan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 84:16:f9:1a:1e:2e brd ff:ff:ff:ff:ff:ff dev eth0 proto dhcp scope link src metric 202

added lines to /etc/dhcpcd.conf...

interface eth0
metric 202
static ip_address=

denyinterfaces wlan0

interface wlan1
metric 302
static ip_address=
static domain_name_servers=
static routers=
  • Have you been able to connect any other device (phone, laptop, etc) to the WiFi in your new location?
    – Seamus
    Jan 17, 2021 at 18:38
  • I guess wlan1 is the problem but you have provided absolutely no details of OS or diagnostics
    – Milliways
    Jan 17, 2021 at 20:50
  • @Milliways wlan1 is not the problem I have had it connect to my home network no problem. I also connected wlan0 to my home wifi no problem. also I don't know what details of os or diagnostics to attach Jan 18, 2021 at 5:52
  • 1
    @Milliways I edited the post and added the output. forgive me I'm new to this site so not sure if there is another way to post that output Jan 18, 2021 at 6:20
  • 1
    also added the lines of my dhcpcd which worked fine on my home network but thought they could help Jan 18, 2021 at 6:28

1 Answer 1


Both wlan interfaces are DOWN. There is no connection problem with wpa_supplicant, it is an initialization problem of your interfaces. Because we can't see details about your installation I would suggest to flash a fresh Raspberry Pi OS Lite on a spare SD Card and follow to Setting up a Raspberry Pi headless or Setting up a wireless LAN via the command line. In the latter guide you also find a section to connect to a hidden network.

If you have the RasPi connected with its default settings using interface wlan0 then you should plug in your USB/WiFi dongle and disable the built-in interface with this option in /boot/config.txt:


provided you are using a RasPi version of 3B, 3B+, 3A+, 4B and Zero W. The dongle will then become wlan0. May be it works out of the box. Otherwise you would have to look first for the correct driver to the USB/WiFi dongle.

If you got it to run then you know how to configure your production installation.

  • The devices initialize that is not the issue. I will add the dtoverlay, also thank you for the links. Hopefully I will have an answer for this soon Jan 22, 2021 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.