User avatar
emanuel.kent
Posts: 20
Joined: Fri Mar 13, 2020 10:33 pm
Location: Germany

Rpi zero w not connecting to Wifi Router

Fri Mar 13, 2020 11:00 pm

I spent the last days trying to understand what's happening with my brand new RPI zero w.

The problem is that it doesn't connect to my Router. Here the steps I have followed:

1) I have loaded Raspian Lite on my 64GB sd card
2) I have created the WPA Supplicant file and created the ssh file
3) Run the pi with the sd in it

If I use this image into a Rpi3A+, it works. After less than 30 seconds a new device named "raspberry" connects to my router and based on the IP I can ssh into it. But the pi zero with the same sd card (identical) doesn't connect

I thought it was a problem with my router so I have tried with two different routers, but for both, the situation is the same. RP3A+ always works while the zero doesn't.

Also, if I do some modification on config.txt (dtoverlay=dwc2) and Cmdline.txt (modules-load=dwc2,g_ether), I am able to ssh into the Pi via the USB cable. But still, it never connects to the Router

Even if the pi is brand new, shall I assume the wifi is somehow broken or do you suggest trying something else before looking for a new one?

Any suggestion is very welcome
Thanks, Emanuel

User avatar
emanuel.kent
Posts: 20
Joined: Fri Mar 13, 2020 10:33 pm
Location: Germany

Re: Rpi zero w not connecting to Wifi Router

Sat Mar 14, 2020 10:30 am

If I call this (while connected to the pi zero via USB):

sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
Successfully initialized wpa_supplicant
Could not set interface wlan0 flags (UP): Input/output error
nl80211: Could not set interface 'wlan0' UP
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: Failed to initialize driver interface

rfkill
ID TYPE DEVICE SOFT HARD
0 wlan phy0 unblocked unblocked
1 bluetooth hci0 unblocked unblocked

ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::6b89:5b27:66ab:3b85 prefixlen 64 scopeid 0x20<link>
ether 5e: ab:18:77:af:b2 txqueuelen 1000 (Ethernet)
RX packets 477 bytes 75910 (74.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 243 bytes 38328 (37.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

What' going on with my pi?

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

Re: Rpi zero w not connecting to Wifi Router

Sat Mar 14, 2020 10:37 am

Just in case you are not aware. The 3A+ supports 5 GHz Wi-Fi, the ZeroW does not.

User avatar
DougieLawson
Posts: 38863
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Rpi zero w not connecting to Wifi Router

Sat Mar 14, 2020 12:27 pm

Have you set the country code?
What do you get from

iwlist scan
Can your Raspberry see your access point?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

PhatFil
Posts: 1672
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Rpi zero w not connecting to Wifi Router

Sat Mar 14, 2020 1:22 pm

if using a windows computer to create the wpa_supplicant.conf file iirc the Notepad editor can use incompatible eol or eof chars that impair the pi reading it.
Try using an editor like notepad++ instead to write the file and it should be ok..

Code: Select all

 cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
        ssid="***********"
        psk="************"
}

is the file from a pi-0-w set up last week..

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

Re: Rpi zero w not connecting to Wifi Router

Sat Mar 14, 2020 2:45 pm

PhatFil wrote:
Sat Mar 14, 2020 1:22 pm
if using a windows computer to create the wpa_supplicant.conf file iirc the Notepad editor can use incompatible eol or eof chars that impair the pi reading it.
Try using an editor like notepad++ instead to write the file and it should be ok..

Code: Select all

 cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
        ssid="***********"
        psk="************"
}

is the file from a pi-0-w set up last week..
Why would that give the reported symptoms of the same card in a 3A+ giving a working Wi-Fi connection to the same router?

PhatFil
Posts: 1672
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Rpi zero w not connecting to Wifi Router

Sat Mar 14, 2020 6:14 pm

It wouldnt, i overlooked the 3A success in the OP . :oops:

User avatar
emanuel.kent
Posts: 20
Joined: Fri Mar 13, 2020 10:33 pm
Location: Germany

Re: Rpi zero w not connecting to Wifi Router

Sun Mar 15, 2020 1:13 pm

DougieLawson wrote:
Sat Mar 14, 2020 12:27 pm
Have you set the country code?
What do you get from

iwlist scan
Can your Raspberry see your access point?

Hi, I tested immediately but I guess publishing of my post is delayed because I'm a new user. Anyway:

iwlist scan
usb0 Interface doesn't support scanning.

wlan0 Failed to read scan data : Network is down

lo Interface doesn't support scanning.


Regarding the WPA_Supplication file, I'm pretty sure it is correct since it works with the 3A+. As reference:

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

network={
ssid="MyWifi"
psk="MyPass"
key_mgmt=WPA-PSK
id_str="home"
}

What is wrong with my PI zero? :?: :?:

User avatar
emanuel.kent
Posts: 20
Joined: Fri Mar 13, 2020 10:33 pm
Location: Germany

Re: Rpi zero w not connecting to Wifi Router

Mon Mar 16, 2020 8:02 pm

Any idea? Please advise, I have scraped the whole web, don't know what else I should check. :? :? :?

User avatar
DougieLawson
Posts: 38863
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Rpi zero w not connecting to Wifi Router

Mon Mar 16, 2020 8:32 pm

Get a fresh SDCard and write a copy of plain Raspbian 2020-02-13 on it.

You can use the new RPF Imager util for that.

If WiFi doesn't work with that you'll have to assume your hardware is broken.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
emanuel.kent
Posts: 20
Joined: Fri Mar 13, 2020 10:33 pm
Location: Germany

Re: Rpi zero w not connecting to Wifi Router

Sat Mar 28, 2020 2:16 pm

I tried everything but no chances to make it work! Basically, by installing Rasbian lite, setting up the wpa_supplicant and creating the ssh file should at least allow the raspberry to connect to your wifi, but it was not the case.
A new Pi Zero just arrived and it worked immediately :D :D :D
So it was the Wifi broken on the previous one

cyphers
Posts: 1
Joined: Sat Mar 28, 2020 2:49 pm

Re: Rpi zero w not connecting to Wifi Router

Sat Mar 28, 2020 6:07 pm

I had this same exact problem with a pi zero w recently. No matter what I tried I could not get it to connect to my wifi, using raspbian buster-lite. I was convinced that it was a hardware problem, so I ordered a second pi zero w. After I placed my order I decided to try dietpi and I was able to get wifi working under dietpi.

So now my second pi zero w has arrived and I have the exact same problem with it. I even tried using the sd card from my 3B+ that connects to the wifi fine but the pi zero w still does not connect. So I take the card with dietpi out of my first pi zero and put it in the second pi zero and it connects with no problem.

So, does anyone here have any idea what the difference between dietpi and raspbian buster-lite might be?

Return to “Beginners”