pica200
Posts: 151
Joined: Tue Aug 06, 2019 10:27 am

[solved] RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 11:40 am

So, yesterday i got my Pi 4 4 GB. Everything seems to work except for WiFi.

My setup:
Raspberry Pi 4 4GB
Official USB-C power supply.
Heatsink enclosure (open at antenna location).
Legit 64GB SanDisk Ultra microSDXC card (A1) fully tested (including overwrite) with f3.
1080p 60 Hertz LCD monitor connected to the port next to the USB-C port (HDMI<-->HDMI).
Wired keyboard connected to a USB 2.0 port.
Wireless mouse (needs "usbhid.mousepoll=0" to work properly) connected to the other USB 2.0 port.
Latest Raspian Buster (without recommended software).

The problem in detail:
I followed the first time setup normally. It showed the WiFi networks around my home and my own one fine. Selected it, typed the password and after around 30 seconds it failed to connect. I thought maybe wrong password but no matter how hard i tried it would fail the same way again. I even copied the password out of a known good .txt file and still not working.
It's noteworthy that the little "5G" icon is shown in the network list. And the router has band steering enabled. Security is WPA2-PSK (CCMP) only. The network icon on the desktop doesn't even change at all on any connection attempt. Signal strength is 1 bar below full signal strenth.

What i tried so far:
I tried with a wpa_supplicant.conf in the boot partition. Not working.
I tried an external 2.4 GHz-only dongle which gets me just as far as the builtin WiFi. Noteable is for the external dongle only a kernel message appears "denied authentication (status 34)" which i could not find anywhere with this exact status code. Also when trying to connect with this dongle the mouse acts flaky and eventually stops until i plug it in again but there is nothing suspicious shown in dmesg output.
I fully updated Raspian over Ethernet with the Pi connected headless to the router. Still not working.

I'm out of ideas and not sure how to debug this. It seems to be a software problem since not even external dongles work. Every other device is able to connect including my Linux Notebook. Would appreciate help/ideas on how to get this working. Thanks in advance ;)



edit:
Solved. I had the routers MAC filter enabled and forgot it was on.
Last edited by pica200 on Tue Aug 06, 2019 11:58 pm, edited 1 time in total.

User avatar
davidcoton
Posts: 4243
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 2:09 pm

What's in your wpa_supplicant.conf file? (Redact the passphrases, but nothing else.)
Signature retired

pica200
Posts: 151
Joined: Tue Aug 06, 2019 10:27 am

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 2:34 pm

/etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=DE

network={
	ssid="FRITZ!Box-awS5qplxN6"
	psk="<snip>"
	key_mgmt=WPA-PSK
}

network={
	ssid="Telekom_FON"
	key_mgmt=NONE
	disabled=1
}
This open network was not there yesterday and if i remove it from the config it re-appears as soon as i get to the network list. Weird. But connecting to my router through the GUI still fails.

User avatar
davidcoton
Posts: 4243
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 4:01 pm

Two thoughts, but I don't have much hope for either.
  1. Your network SSID is not hidden by the AP?
  2. You did reboot after the update/upgrade?
Signature retired

pica200
Posts: 151
Joined: Tue Aug 06, 2019 10:27 am

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 5:34 pm

Yes and yes. SSID is not hidden and i rebooted many times (including after dist-upgrade).

drgeoff
Posts: 9912
Joined: Wed Jan 25, 2012 6:39 pm

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 5:51 pm

In the router's SSID can you delete or change the ! to a more normal character (a-z, A-Z, 0-9). Modify the wpa_supplicant.conf to match and retry.

I'm puzzled by you writing that the FON network section reappears in wpa_suppliant.conf even if you delete it from there.

bls
Posts: 286
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 6:20 pm

drgeoff wrote:
Tue Aug 06, 2019 5:51 pm
In the router's SSID can you delete or change the ! to a more normal character (a-z, A-Z, 0-9). Modify the wpa_supplicant.conf to match and retry.

I'm puzzled by you writing that the FON network section reappears in wpa_suppliant.conf even if you delete it from there.
According to the docs, wpa_supplicant updates the .conf file if update_config=1. If you don't ever want that to happen, change it to 0.

drgeoff
Posts: 9912
Joined: Wed Jan 25, 2012 6:39 pm

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 6:40 pm

bls wrote:
Tue Aug 06, 2019 6:20 pm
drgeoff wrote:
Tue Aug 06, 2019 5:51 pm
In the router's SSID can you delete or change the ! to a more normal character (a-z, A-Z, 0-9). Modify the wpa_supplicant.conf to match and retry.

I'm puzzled by you writing that the FON network section reappears in wpa_suppliant.conf even if you delete it from there.
According to the docs, wpa_supplicant updates the .conf file if update_config=1. If you don't ever want that to happen, change it to 0.
To me that implies that the RPi is definitely "seeing" the Wi-Fi networks. So is it a problem with the SSID or with the encryption? I suggest either temporarily disabling the Wi-Fi security on the Fritzbox or trying to connect to the FON SSID. If that works it points to a problem with the security/encryption side of things.

User avatar
HawaiianPi
Posts: 4857
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 6:44 pm

bls wrote:
Tue Aug 06, 2019 6:20 pm
According to the docs, wpa_supplicant updates the .conf file if update_config=1. If you don't ever want that to happen, change it to 0.
That still doesn't explain why (and how) an unknown network is being added. That seems highly suspicious.

@OP,
Was the password still the default "raspberry" when you were connected to the router with Ethernet? I would start over with a newly imaged card.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

pica200
Posts: 151
Joined: Tue Aug 06, 2019 10:27 am

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 6:48 pm

Removed the "!" from the SSID and still no luck. Also i remember now i tried to connect to the open one for shits and giggles. That's probably why it appeared in the config. Now it's updating the config with the old network name (with !) instead of the open network.

Disabling security is a no-no in my opinion even for short amounts of time. I could however try making a hotspot on my Notebook using the dongle.

edit:
HawaiianPi wrote:
Tue Aug 06, 2019 6:44 pm
@OP,
Was the password still the default "raspberry" when you were connected to the router with Ethernet? I would start over with a newly imaged card.
I changed that password at the first time setup (before all of this) and it's working as expected.

drgeoff
Posts: 9912
Joined: Wed Jan 25, 2012 6:39 pm

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 6:53 pm

HawaiianPi wrote:
Tue Aug 06, 2019 6:44 pm
That still doesn't explain why (and how) an unknown network is being added. That seems highly suspicious.
It isn't an unknown network. Many telco-ISP supplied routers in Europe have an additional SSID with FON in the name. Adds an open Wi-Fi hotspot which is tunneled to/from the ISP and thence (after login and password) to the public internet. No impact on the customer's service other than a controlled modest reduction of his/her download and upload rates when someone else is using the hotspot. https://fon.com/

pica200
Posts: 151
Joined: Tue Aug 06, 2019 10:27 am

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 7:13 pm

Created a hotspot on my Linux Notebook using the 2.4 GHz dongle and its internal WiFi and that works with both open and WPA2-PSK. "ping -c3 google.de" goes through without any packet loss. Can't wrap my head around why it can't connect to the router then :shock:

bls
Posts: 286
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 7:48 pm

Is there anything useful in the system log from wpa_supplicant?

pica200
Posts: 151
Joined: Tue Aug 06, 2019 10:27 am

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 8:43 pm

There is no log file in /var/log for wpa supplicant. dmesg is totally quiet on connection attempts.

drgeoff
Posts: 9912
Joined: Wed Jan 25, 2012 6:39 pm

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 8:44 pm

Try changing the WPA key to the same one that worked for the hotspot you created.

bls
Posts: 286
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 9:01 pm

pica200 wrote:
Tue Aug 06, 2019 8:43 pm
There is no log file in /var/log for wpa supplicant. dmesg is totally quiet on connection attempts.
Seems like there would be some messages about wlan0 or from some component of wpa. I find that the messages are pretty helpful, so would be great if you could find them.

Can you confirm that the wpa_supplicant service running? (sudo systemctl show wpa_supplicant)

pica200
Posts: 151
Joined: Tue Aug 06, 2019 10:27 am

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 9:54 pm

drgeoff wrote:
Tue Aug 06, 2019 8:44 pm
Try changing the WPA key to the same one that worked for the hotspot you created.
I tried it the other way around mimicking the original network (SSID with ! in the name and the exact same password) and that's working with the hotspot but was not working with the router. I will try changing the password on the router later.
bls wrote:
Tue Aug 06, 2019 9:01 pm
Seems like there would be some messages about wlan0 or from some component of wpa. I find that the messages are pretty helpful, so would be great if you could find them.

Can you confirm that the wpa_supplicant service running? (sudo systemctl show wpa_supplicant)
I tried all log files in /var/log ("sudo cat *.log | grep "wpa_"" in the log dir) and there are no messages from wpa_supplicant itself in any log file.

wpa_supplicant seems to be running. Getting lots of output from the systemctl command and the logs (from above) confirm it's running:

Code: Select all

...
Aug  6 21:19:21 raspberrypi systemd[1]: Condition check resulted in Copy user wpa_supplicant.conf being skipped.
Aug  6 21:19:21 raspberrypi wpa_supplicant[411]: Successfully initialized wpa_supplicant
Aug  6 21:19:21 raspberrypi dhcpcd-run-hooks[488]: wlan0: starting wpa_supplicant

drgeoff
Posts: 9912
Joined: Wed Jan 25, 2012 6:39 pm

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 10:02 pm

I wonder if you have somehow got some invisible characters in the wpa_supplicant.conf file. Try renaming it and type in a new one from scratch.

User avatar
davidcoton
Posts: 4243
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 10:22 pm

Reboot the router?
Signature retired

bls
Posts: 286
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 10:28 pm

Maybe worth stopping wpa_supplicant and running it from the terminal with 'sudo /sbin/wpa_supplicant -u -O /run/wpa_supplicant'. Unless something is really broken the output should show it trying to connect and failure information.

pica200
Posts: 151
Joined: Tue Aug 06, 2019 10:27 am

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 11:56 pm

Well, i hit the jackpot. After some thinking i remembered i a router setting i had done months ago and sure enough it was exactly that. The router has an option to only allow known devices to connect which is just another name for MAC filter. The Pi was of course not in the list. I started from scratch and have successfully setup everything and WiFi is working perfectly.

So don't do MAC filters kids unless you can remember you have it enabled months later :roll: Sorry for my stupidity.

jrocco36
Posts: 1
Joined: Tue Aug 06, 2019 11:52 pm

Re: RPi 4 unable to connect to WiFi

Tue Aug 06, 2019 11:57 pm

Im having about the same problem. I can put in my wifi password and it takes it however sometimes it connects and drops but more times then not it simply will not connect. Ive tried a few different wifi networks without any change. Maybe there is something wrong with the Pi 4 and Raspbian Buster that causes the wifi to become unstable?

pica200
Posts: 151
Joined: Tue Aug 06, 2019 10:27 am

Re: [solved] RPi 4 unable to connect to WiFi

Wed Aug 07, 2019 2:10 am

You need to give us more infos to be able to help you. It sounds like low signal strength if it works sometimes.

While testing with the hotspot i noticed the connection dropped once but that was about it. The connection to the router seems rock solid. The recommect i can probably blame on too many 2.4 GHz networks as my router detects over 30... 5 GHz is the way to go.

guestxyz
Posts: 2
Joined: Wed Aug 07, 2019 6:16 am

Re: [solved] RPi 4 unable to connect to WiFi

Wed Aug 07, 2019 6:26 am

Had the same problem with Raspi 4B.
Problem was dependent on screen resolution (!!).
With 1920x1080, wlan0 became disconnected after it was ok at lower screen resolutions. Was in 2.4GHz band.
After turning on 5GHz in the router and going into the network preferences (right click the network icon top right on screen) and SSID ... and checking "automatically configure options" the connection remains stable (so far :D ).

pica200
Posts: 151
Joined: Tue Aug 06, 2019 10:27 am

Re: [solved] RPi 4 unable to connect to WiFi

Wed Aug 07, 2019 4:39 pm

What do you use to power the Pi? Resolution should not matter.

Return to “Troubleshooting”