cwille97
Posts: 6
Joined: Sun May 09, 2021 2:50 pm

Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Sun May 09, 2021 2:57 pm

So I'm trying to get my Pi 3B on my WiFi so I can use it in the other room to collect ADSB data. I have tried two different microSD cards, with brand new versions of Raspberry Pi OS from the official flashing tool.

I created an ssh file and the wpa_supplicant according to the official guide. I verified my SSID and password letter for letter from my WiFi admin panel. I truly can't understand why this isn't working. I thought maybe the physical hardware was damaged, but when I ran

Code: Select all

iwlist wlan0 | grep "SSID"
I found my SSID so the WiFi chip can talk to my router. I checked the .conf one more time, things looked good so I did a

Code: Select all

systemctl reboot
and unplugged ethernet. Here is the format I used for my wpa_supplicant.conf file:

Code: Select all

country=us
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
 scan_ssid=1
 ssid="MyNetworkSSID"
 psk="Pa55w0rd1234"
}
The Pi just won't connect to my WiFi network no matter what I do. Any suggestions on what I could try here to get this working? WiFi has worked in the past on this Pi.

epoch1970
Posts: 6513
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Mon May 10, 2021 2:21 pm

Perhaps something is wrong with the configuration file.
I would try reconfiguring the wireless network using raspi-config.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

wolf.z
Posts: 147
Joined: Thu Dec 24, 2015 8:34 pm

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Mon May 10, 2021 3:36 pm

So many possibilities. Just one:
Typical pity is to allow connect for known hardware adresses only. Check config on your router. In case, disable for very first connect, after enable again.

MiscBits
Posts: 249
Joined: Wed Jan 27, 2021 12:48 pm

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Mon May 10, 2021 6:05 pm

Not sure if the sequence of entries in wpa_supplicant can be an issue.

The 'standard' I've used is:

Code: Select all

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

network={
   ssid="WIFI_SSID"
   psk="WIFI_PASSWORD"
   key_mgmt=WPA-PSK
}
NOTE the change in the first line to yours.

I find that the key_mgmt line is optional - it seems to make no difference to the networks that use this that I connect to if its in or not.

I see you also have scan_ssid = 1 -> Hiding the SSID broadcast at AP / Router end is known to cause the PI issues and does not help with security (the SSID is broadcast in plain text during connection)

That seems a bit odd as you say it can see the network in the scan...
Is a computer language with goto's totally Wirth-less?

cwille97
Posts: 6
Joined: Sun May 09, 2021 2:50 pm

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Mon May 10, 2021 9:02 pm

epoch1970: I have tried using raspi-config with the same lack of results.

wolf.z: This didn't seem to make a difference for me, also wouldn't the router already recognize the MAC from when I plugged it in via ethernet?

MiscBits: I have copied your standard format and skipped the optional key_mgmt line. I think I did the scan and then tried adding the scan_ssid=1 after to see if that would help, which would explain the confusing discrepancy.

My current status on this problem: after trying the suggestions in the thread, I am still stuck with the same results. I appreciate the help so far! Any other suggestions?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 6276
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Mon May 10, 2021 9:49 pm

cwille97 wrote:
Mon May 10, 2021 9:02 pm

...
wolf.z: This didn't seem to make a difference for me, also wouldn't the router already recognize the MAC from when I plugged it in via ethernet?
...
IIRC, the MAC addresses (and thus any IP address assigned by DHCP via the router) are different for the (wired) ethernet and wifi connections (certainly true for the P4B, don't have a P3B setup running currently to refresh my memory ;) ). Do you have admin access to the router or can run "Fing" ** (or similar) on a 'phone or tablet connected to the same router to check that the router has "found" the Pi?
Trev.
** http://www.cpmspectrepi.uk/raspberry_pi ... tApps.html
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

MiscBits
Posts: 249
Joined: Wed Jan 27, 2021 12:48 pm

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Mon May 10, 2021 10:21 pm

There are some odd characters that cannot go into the password or SSID field easily but I've never found a list of them.

I do know that the iOS default WiFi names are one issue due to the single right quotation mark! (Link gives work-around)

There is a work around here to use hex characters for the SSID and that links to a c program here for the password (must be an easier way).

It may be worth just changing the SSID / Password just to use A to Z and 0 to 9 for now as a test (may upset the other users - do not blame me).
Is a computer language with goto's totally Wirth-less?

epoch1970
Posts: 6513
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Mon May 10, 2021 10:24 pm

Each interface has its MAC address. The MAC of the wireless interface may need to be authorized to connect to the AP.
“ip link show” in the terminal on the Pi will return the list of interfaces and their hardware address, aka MAC address.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

cwille97
Posts: 6
Joined: Sun May 09, 2021 2:50 pm

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Tue May 11, 2021 9:30 pm

MiscBits wrote:
Mon May 10, 2021 10:21 pm
There are some odd characters that cannot go into the password or SSID field easily but I've never found a list of them.

I do know that the iOS default WiFi names are one issue due to the single right quotation mark! (Link gives work-around)

There is a work around here to use hex characters for the SSID and that links to a c program here for the password (must be an easier way).

It may be worth just changing the SSID / Password just to use A to Z and 0 to 9 for now as a test (may upset the other users - do not blame me).
My SSID and password are already A to Z 0 to 9.

cwille97
Posts: 6
Joined: Sun May 09, 2021 2:50 pm

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Tue May 11, 2021 9:40 pm

FTrevorGowen wrote:
Mon May 10, 2021 9:49 pm
cwille97 wrote:
Mon May 10, 2021 9:02 pm

...
wolf.z: This didn't seem to make a difference for me, also wouldn't the router already recognize the MAC from when I plugged it in via ethernet?
...
IIRC, the MAC addresses (and thus any IP address assigned by DHCP via the router) are different for the (wired) ethernet and wifi connections (certainly true for the P4B, don't have a P3B setup running currently to refresh my memory ;) ). Do you have admin access to the router or can run "Fing" ** (or similar) on a 'phone or tablet connected to the same router to check that the router has "found" the Pi?
Trev.
** http://www.cpmspectrepi.uk/raspberry_pi ... tApps.html
I ran the command epoch1970 provided and I have confirmed that the MAC addresses are different on the Pi 3b between WiFi and ethernet. I do have access to the admin panel on the router, and I do not see the Pi until I plug it in via ethernet. I do have one unknown device showing up on my network, but I am almost certain it is not the Pi. It shows up in the list whether the Pi is on ethernet, disconnected from ethernet, or disconnected from power entirely. Is there anything you would recommend I check within the admin panel for the router?

Edit: I have managed to track down the unknown device, it was just my Xbox on the network.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Tue May 11, 2021 10:28 pm

wpa_supplicant.conf you show in your first post has a number of errors. Also the command you show to scan does not work as it also has an error.

I would suggest you try the following:

Code: Select all

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

network={
        ssid="Network-SSID"
	psk="Network-password"
}
Note the country= code has to be CAPITAL letters. Also you do not need scan_ssid.

To scan the command should be

Code: Select all

iwlist wlan0 scan | grep "SSID"
or better use

Code: Select all

sudo iwlist wlan0 scan | grep "SSID"
A scan without sudo will get the scan details from a saved list of the first scan when you booted the PI. Using sudo will provide an up to date scan showing the currently available networks.

EDIT: also check the output of command rfkill list as this can stop your network connecting as it can block the wifi.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

cwille97
Posts: 6
Joined: Sun May 09, 2021 2:50 pm

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Wed May 12, 2021 7:12 pm

MrEngman wrote:
Tue May 11, 2021 10:28 pm
wpa_supplicant.conf you show in your first post has a number of errors. Also the command you show to scan does not work as it also has an error.

I would suggest you try the following:

Code: Select all

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

network={
        ssid="Network-SSID"
	psk="Network-password"
}
Note the country= code has to be CAPITAL letters. Also you do not need scan_ssid.

To scan the command should be

Code: Select all

iwlist wlan0 scan | grep "SSID"
or better use

Code: Select all

sudo iwlist wlan0 scan | grep "SSID"
A scan without sudo will get the scan details from a saved list of the first scan when you booted the PI. Using sudo will provide an up to date scan showing the currently available networks.

EDIT: also check the output of command rfkill list as this can stop your network connecting as it can block the wifi.


MrEngman
I just tried your wpa_supplicant.conf with the same results. I put it back on ethernet and ran the scan command with superuser privileges, and got the following results:

Code: Select all

ESSID:"Network-SSID"

mglass
Posts: 12
Joined: Wed Jan 11, 2017 9:05 am

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Sat May 15, 2021 8:19 am

Hi Mr Engman,

I want to ask your help regarding how to get working (as an Access Point on 2.5GHz) an AC1200 WiFi USB dongle on Raspberry Pi 3.

1200Mbps WiFi Adapter,Dual Band... https://www.amazon.co.uk/dp/B08FDMY4GB

There’s no help from the seller.

All I’ve been able to find is that the dongle has an RTL8812 chip. I don’t know which variant.

I’ve search high and low for a driver, but can’t find any that work - most fail to compile at all.

I see you as a guru in this subject. Can you help me?

Perhaps we could continue the chat in another posting, but I don’t know about that.

Your help would be very much appreciated,
Martin

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Sat May 15, 2021 3:04 pm

mglass wrote:
Sat May 15, 2021 8:19 am
Hi Mr Engman,

I want to ask your help regarding how to get working (as an Access Point on 2.5GHz) an AC1200 WiFi USB dongle on Raspberry Pi 3.

1200Mbps WiFi Adapter,Dual Band... https://www.amazon.co.uk/dp/B08FDMY4GB

There’s no help from the seller.

All I’ve been able to find is that the dongle has an RTL8812 chip. I don’t know which variant.

I’ve search high and low for a driver, but can’t find any that work - most fail to compile at all.

I see you as a guru in this subject. Can you help me?

Perhaps we could continue the chat in another posting, but I don’t know about that.

Your help would be very much appreciated,
Martin
Not a good idea to hijack a thread regarding a different issue. Would probably be better to start a new thread here viewforum.php?f=36

With the wifi connected to your Pi what is the output of command lsusb. This will show the USB id of the wifi adapter and should allow us to determine the required driver.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Sat May 15, 2021 3:14 pm

cwille97 wrote:
Wed May 12, 2021 7:12 pm

I just tried your wpa_supplicant.conf with the same results. I put it back on ethernet and ran the scan command with superuser privileges, and got the following results:

Code: Select all

ESSID:"Network-SSID"
I presume that is your access point SSID.

I use the same wpa_supplicant.conf on all my Pi, from a Pi1 to a Pi4 8Gb, where most have two wifi connections to the same network to check the wifi drivers i compile. Some use kernel stretch and others buster. Have no issues with any of them.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

mglass
Posts: 12
Joined: Wed Jan 11, 2017 9:05 am

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Sat May 15, 2021 6:43 pm

MrEngman wrote:
Sat May 15, 2021 3:04 pm
mglass wrote:
Sat May 15, 2021 8:19 am
Hi Mr Engman,

I want to ask your help regarding how to get working (as an Access Point on 2.5GHz) an AC1200 WiFi USB dongle on Raspberry Pi 3.

1200Mbps WiFi Adapter,Dual Band... https://www.amazon.co.uk/dp/B08FDMY4GB

There’s no help from the seller.

All I’ve been able to find is that the dongle has an RTL8812 chip. I don’t know which variant.

I’ve search high and low for a driver, but can’t find any that work - most fail to compile at all.

I see you as a guru in this subject. Can you help me?

Perhaps we could continue the chat in another posting, but I don’t know about that.

Your help would be very much appreciated,
Martin
Not a good idea to hijack a thread regarding a different issue. Would probably be better to start a new thread here viewforum.php?f=36

With the wifi connected to your Pi what is the output of command lsusb. This will show the USB id of the wifi adapter and should allow us to determine the required driver.


MrEngman
Thanks. I’ve done as instructed. Here’s the new post ... viewtopic.php?f=36&t=311903

cwille97
Posts: 6
Joined: Sun May 09, 2021 2:50 pm

Re: Pi 3B won't connect to WiFi, but wlan0 shows my SSID

Sun May 16, 2021 10:08 pm

MrEngman wrote:
Sat May 15, 2021 3:14 pm
cwille97 wrote:
Wed May 12, 2021 7:12 pm

I just tried your wpa_supplicant.conf with the same results. I put it back on ethernet and ran the scan command with superuser privileges, and got the following results:

Code: Select all

ESSID:"Network-SSID"
I presume that is your access point SSID.

I use the same wpa_supplicant.conf on all my Pi, from a Pi1 to a Pi4 8Gb, where most have two wifi connections to the same network to check the wifi drivers i compile. Some use kernel stretch and others buster. Have no issues with any of them.


MrEngman
Correct, that's a placeholder for my actual SSID. I have used this wpa_supplicant.conf format in the past as well, I just can't pinpoint what is different right now. I have even used this Pi before (possibly on my current WiFi, definitely on the old one). I'm really at a loss on what to do next here.

Return to “Troubleshooting”