Page 1 of 1

wifi not working on new Pi 0 W [SOLVED]

Posted: Thu Mar 09, 2017 9:29 am
by teufen
The wifi link doesn't come up on my newly purchased Rapsberry Pi 0 W.

Situation:
  • new raspberry pi zero W
  • new SD card with noobs, raspbian installed
/etc/network/interfaces:

Code: Select all

auto lo
iface lo inet loopback

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
     wpa-ssid "<my ssid>"
     wpa-psk "<my pwd>"

Code: Select all

ip link show 
shows only lo interface

when trying

Code: Select all

sudo ifup wlan0
, output is:

Code: Select all

wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Failed to bring up wlan0.
When I insert the same SDcard in a Raspberry Pi 3 I have here, this works fine, and the pi connects to the network using Wifi without any problems.

Thank you in advance for any pointers to what I should/could do to fix this.

Re: wifi not working on new Pi 0 W

Posted: Thu Mar 09, 2017 9:45 am
by Ernst
https://www.raspberrypi.org/documentati ... ess-cli.md

should give the information you need.

Re: wifi not working on new Pi 0 W

Posted: Thu Mar 09, 2017 9:50 am
by PeterO
I should check that you have the very latest version of NOOBS as well.
PeterO

Re: wifi not working on new Pi 0 W

Posted: Thu Mar 09, 2017 9:57 am
by teufen
Thanks for your reaction!

Unfortunately, the first cmd on that page

Code: Select all

sudo iwlist wlan0 scan
gives the following output:

Code: Select all

wlan0      Interface doesn't support scanning

Re: wifi not working on new Pi 0 W

Posted: Thu Mar 09, 2017 9:58 am
by teufen
PeterO wrote:I should check that you have the very latest version of NOOBS as well.
PeterO
Yes, I updated the noobs using the (working) raspberry pi 3.

Re: wifi not working on new Pi 0 W

Posted: Thu Mar 09, 2017 10:00 am
by Ernst
teufen wrote:Thanks for your reaction!

Unfortunately, the first cmd on that page

Code: Select all

sudo iwlist wlan0 scan
gives the following output:

Code: Select all

wlan0      Interface doesn't support scanning
Just ignore that section and keep reading.

Re: wifi not working on new Pi 0 W

Posted: Thu Mar 09, 2017 10:16 am
by teufen
I read the article, and moved the wpa information from /etc/network/interfaces to /etc/wpa_supplicant/wpa_supplicant.conf and added a line to source that file in /etc/network/interfaces, which is now:

Code: Select all

auto lo
iface lo inet loopback

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
#     wpa-ssid "<my ssid>"
#     wpa-psk "<my pwd>"
      wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
/etc/wpa_supplicant/wpa_supplicant.conf:

Code: Select all

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

network={
      ssid="<my ssid>"
      scan_ssid=1
      psk="<my pwd>"
}
But it didn't do the trick.

Re: wifi not working on new Pi 0 W

Posted: Thu Mar 09, 2017 10:27 am
by Ernst
Maybe you should put a new image on your card and start all over again.
Getting the Pi 0 W to use wifi is very simple:
1) create a wpa_supplicant.conf file and put it in /boot. (/boot/wpa_supplicant.conf)
2) create an empty ssh file in /boot

I did this on a new image and this is my interfaces file:

Code: Select all

pi@raspi4:~ $ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
and this is the wpa_supplicant conf:

Code: Select all

pi@raspi4:~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
country=DE
network={
    ssid="XXXXXX"
    psk="XXXXXXXXXXXXXXXXX"
    key_mgmt=WPA-PSK
}

Re: wifi not working on new Pi 0 W

Posted: Thu Mar 09, 2017 10:31 am
by Ernst

Re: wifi not working on new Pi 0 W

Posted: Thu Mar 09, 2017 10:45 am
by teufen
Ernst wrote:Maybe you should put a new image on your card and start all over again.
OK, I'll try that.

Funny thing is still that Wifi with the same SDcard in a Rapsberry Pi 3 works fine.

Re: wifi not working on new Pi 0 W

Posted: Thu Mar 09, 2017 1:30 pm
by teufen
teufen wrote:
Ernst wrote:Maybe you should put a new image on your card and start all over again.
OK, I'll try that.
OK, that worked.

Thanks again for helping me out!