0

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
update_config=1
country=US

network={ ssid="Hidden_Network" scan_ssid=1 psk="password" key_mgmt=WPA-PSK }

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 127.0.0.1/8 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 10.0.0.100/8 brd 10.255.255.255 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
10.0.0.0/8 dev eth0 proto dhcp scope link src 10.0.0.100 metric 202

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

interface eth0
metric 202
static ip_address=10.0.0.100

denyinterfaces wlan0

interface wlan1 metric 302 static ip_address=172.16.0.62 static domain_name_servers=1.1.1.1 static routers=172.16.0.1

  • Have you been able to connect any other device (phone, laptop, etc) to the WiFi in your new location? – Seamus Jan 17 '21 at 18:38
  • I guess wlan1 is the problem but you have provided absolutely no details of OS or diagnostics – Milliways Jan 17 '21 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 – judylong443 Jan 18 '21 at 05:52
  • @Seamus Yes my laptop is connected to the network and my phone as well, only issue us with the pi – judylong443 Jan 18 '21 at 05:53
  • @Milliways I will provide any logs as soon as I know what to provide – judylong443 Jan 18 '21 at 05:53
  • Don't worry about logs (which are rarely helpful). What we do need is details of OS, what is ACTUALLY connected and description of your config files. ip a && ip r is a help in diagnosing problems. It is always a problem to rely on default interface enumeration as there is no guarantee which will be wlan0 – Milliways Jan 18 '21 at 06:03
  • 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 – judylong443 Jan 18 '21 at 06:20
  • 1
    also added the lines of my dhcpcd which worked fine on my home network but thought they could help – judylong443 Jan 18 '21 at 06:28
  • You have committed one of the errors of many new Pi users. Static routes create more problems than they solve and you have got the settings wrong! See How to set up networking/WiFi. The wlan does not seem to be connected sudo iwlist wlan1 scan will show what it can see. It is unclear what network you are testing (home or otherwise), why you have disabled wlan0 or why you are trying to use 2 different network segments. NOTE do not post Comments, edit your Question with details. – Milliways Jan 18 '21 at 06:44
  • I will give that a shot, thank you! – judylong443 Jan 22 '21 at 06:43

1 Answers1

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:

dtoverlay=disable-wifi

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.

Ingo
  • 42,107
  • 20
  • 85
  • 197
  • 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 – judylong443 Jan 22 '21 at 06:46