Page 1 of 1

Raspberry Pi Zero W WiFi issues

Posted: Wed May 10, 2017 7:42 am
by emmanuelt
Hi,
I recently bought a Pi Zero W and I noticed that the the WiFi connection is not stable.
After an unspecified amount of time the Pi Zero looses connection to the wifi network.
If I check the wlan0 interface with ifconfig, I can see the wlan0 interface but the IP address is lost.
I have to do
ifdown wlan0
and then
ifupo wlan0
to get the IP address again.

Some details:
1. I am using 2017-04-10-raspbian-jessie-lite image with all updates installed.
2. I have disabled power management on the wifi interface with

Code: Select all

iwconfig wlan0 power off
3. I am using WEP as a WiFi security protocol

Did anyone have similar issues with Pi Zero W ?

Thanks

Re: Raspberry Pi Zero W WiFi issues

Posted: Wed May 10, 2017 9:19 am
by 4LULZ
I've had similar issues with the Pi 3b but not the Zero W.

You can use a script to monitor the connection status and if it drops out the script can run the ifdown / ifup commands for you but this is a workaround at best. Here's what I used:

Code: Select all

if [ $? != 0 ] 
then
  echo "No network connection, restarting wlan0"
  /sbin/ifdown 'wlan0'
  sleep 5
  /sbin/ifup --force 'wlan0'
Fi
In the end I think it was a range issue with the Pi 3b because adding another access point closer to the pi sorted it out. Best of luck.

Re: Raspberry Pi Zero W WiFi issues

Posted: Wed May 10, 2017 10:08 am
by emmanuelt
Thank you for your reply.

I have already created this script.
The question is actually why this happens.

The "range" is not the case since the Pi Zero W is next to the AP.

Re: Raspberry Pi Zero W WiFi issues

Posted: Wed May 10, 2017 7:28 pm
by emmanuelt
I am logging the ifdown/ifup that the Pi Zero W is doing.
From the log file it is evident that, if the Pi is left idle the script has to reconnect the Pi every 10 minutes

Does anybody know why Pi Zero W looses connectivity every 10 minutes ?

May I remind that the power management of the WiFi interface is turned off, but turning it off had no effect.

Re: Raspberry Pi Zero W WiFi issues

Posted: Wed May 10, 2017 7:57 pm
by DirkS
You don't need to switch off power management; it's off by default.

I have Pi 3B and 0W running for days and I don't have any problems with connectivity. I can connect at all times.
Maybe the problem is with how your AP manages connections?

Re: Raspberry Pi Zero W WiFi issues

Posted: Thu May 11, 2017 1:18 am
by 4LULZ
0W running for days and I don't have any problems with connectivity. I can connect at all times
Same, I've had my 4 x 0W's connected via wifi for 2 weeks now, no dropouts / stability issues whatsoever.

Re: Raspberry Pi Zero W WiFi issues

Posted: Sun May 14, 2017 4:10 pm
by emmanuelt
Thank you DirkS and 4LULZ for your answers. Your answers made me search a little bit more since as you said, your Pi Zero W were working fine.

I changed my router's security mode from WEP to WPA2 and the problems stopped.

I also changed the configuration of raspberry Wifi from:
/etc/network/interfaces

iface wlan0 inet dhcp
wireless-essid MY_SSID
wireless-key s:MY_PASSWORD

to the original:
/etc/network/interfaces

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

and
/etc/wpa_supplicant/wpa_supplicant.conf
...
...
network={
ssid="MY_SSID"
psk="MY_PASS"
}

Now it does not disconnect anymore.
Maybe it was the WEP security mode, maybe my WEP configuration on /etc/network/interfaces for WEP was not correct.
I don't know. What I know is that now it works fine.