david99
Posts: 7
Joined: Thu Feb 23, 2017 10:09 pm

R Pi 3 Wifi problems

Thu Feb 23, 2017 10:58 pm

Hi,

I know that there are many threads online about this, however, many are out of date, and I still have problems. I would greatly appreciate some help.

Background: I am an experienced user who knows Linux well. I have been working with Pis in particular for about 2 years. I have had these problems for the whole of my time working with Pis.

Problem: Wifi will startup and connect, however, it always disconnects (IP address shown by ifconfig disappears) after a period between 10 mins and 12 hours. There is never any problem with ethernet connections.

Setup: I have 2 Pis - a 2B (with Edimax USB adapter) and a Pi 3. They both have the same problem. Each has a dedicated power supply - 5V/1.1 Amp for the Pi 2 and 5V/2.1 Amp for the Pi 3. They are dedicated power supplies, not phone chargers.

I am using a Apple Airport Extreme wireless router using Channel 8 and 2.4 GHz network with WPA Personal encryption.

I am using Raspian Jessie Version 8, Kernel version 4.4. I run apt-get update and upgrade each week religiously.

I run both Pis as headless via SSH and never use them as desktop machines.

My /etc/network/interfaces file is:

Code: Select all

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
My /etc/wpa_supplicant/wpa_supplicant.conf file is:

Code: Select all

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

network={
    ssid="SSID"
    psk="password"
}
When I boot the Pi, both network interfaces will come up, if the ethernet is connected. The wifi will die at some point later.

When I boot the Pis with no ethernet connected, the results are unpredictable - sometimes wifi will come up (often with varying IP addresses across different reboots), but will always die at some point later. Sometimes the wifi will simply not come up at all.

What do I want to happen?
Ideally, I would like to bring the Pis up on wifi with no ethernet attached, and have that connection stay up the whole time, with a predictable IP address.
If that is not possible, I would like to bring up the Pis with ethernet attached, but still have the wifi connection stay up the whole time.

Is anyone able to suggest a resolution here? I am clearly doing something very wrong, but as you can see, my configuration files are very vanilla.

Thanks,

David.

Ernst
Posts: 1334
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: R Pi 3 Wifi problems

Fri Feb 24, 2017 7:45 am

It is very difficult to pinpoint the root cause of your problem as there are many places where it could be located. It will be necessary to take a deeper look into the log files to see if there is any information.
The first thing you should do is to change the channel on your router, preferred are 1,6 or 11 (http://www.metageek.com/training/resour ... -6-11.html), but this should not bring much change.
What I see from your description is that there is problem related to the DHCP service, I suspect that this service will be located in your access point (Apple Airport Extreme wireless router), but this may not be the root cause.

You have a number of RPis with different WiFi adapters, each of these systems connects to your WiFi access point and then broadcasts a request for DHCP service, DHCP reacts with an IP-address with a lease time, this IP-address must be "refreshed" at fixed intervals, if not the IP-address expires and the client must remove it from the interface. (very simplified). If there is a loss of Wifi connection/reconnect the clients should receive the same IP-address if the lease has not expired.

From what you have provided I see that the common factor is your access point, this is most likely the root cause, this could be WiFi quality, the channel, it could be WiFi congestion, it could be DHCP, ...

What I would do is:
- Get the documentation for the access point and review the DHCP configuration, if possible increase the lease time to 24 hours. Make sure that there are enough addresses in the DHCP pool to satisfy your needs.
- Use another system (Android, Windows, Mac?) to run a WiFi scanner to see how much congestion and find a better channel and/or AP location.

If this does help, the next step would be having a look at the log files of your access point and maybe one of the Raspberries.
The road to insanity is paved with static ip addresses

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: R Pi 3 Wifi problems

Fri Feb 24, 2017 7:57 am

Can you post the output of iwconfig and dmesg when you lose the wifi connection?
You will usually get the same IP address when the dhcp assigned address is renewed, if you want a "predictable" address, you should look into assigning a static IP address. Your AP should have a range of addresses available for that.

I see that someone else has posted a reply while I was typing this up, so I'll just add this: The on-board wifi isn't the best... but it does work. Usually.
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

Return to “Troubleshooting”