Page 19 of 24

Re: WiFi Issues ? Start here !

Posted: Fri Mar 04, 2016 3:54 pm
by mattgemmell
Hi,

I was having wi-fi issues with a new Raspberry Pi 3 (with latest Raspbian, just downloaded yesterday). It'd be fine initially, but after a few minutes sitting idle, the Pi often wasn't reachable from other machines on the local network (for ping, ssh, vnc, etc). It seems that the wi-fi module has quite aggressive power-saving enabled.

I looked around on the web and found a series of steps that fixed the issue for me. It might be that some of these are redundant, but they worked here, and should only take a couple of minutes (just once). You're welcome to try them.

You'll need to be logged into the Pi on the command line to proceed, either directly or via ssh from another machine. (You can get into your Pi via ssh on your local network by doing ssh [email protected] and entering the usual password.)

Also, I use the nano editor in these steps. Feel free to substitute whatever you prefer.

Assumption: your wi-fi interface is wlan0. Check first by doing

Code: Select all

iwconfig
Have a look to see which interface is your wi-fi. If it's not wlan0, substitute the correct one throughout all the following steps.

As a temporary fix while you're following these steps, do this:

Code: Select all

sudo iwconfig wlan0 power off
Now we'll make it permanent. Three things to do.


Step 1

Do:

Code: Select all

sudo nano /etc/modprobe.d/8192cu.conf
Put this in the file:

Code: Select all

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 rtw_ips_mode=1
and save the file.


Step 2

Do:

Code: Select all

sudo nano /etc/rc.local
Put these lines just before (obviously) the exit 0 line at the end, and save the file.

Code: Select all

sleep 10
iwconfig wlan0 power off
Step 3

Do:

Code: Select all

sudo nano /etc/systemd/system/root-resume.service
Put the following contents in it:

Code: Select all

[Unit]
Description=Turn of wlan power management
After=suspend.target

[Service]
Type=simple
ExecStartPre= /bin/sleep 10
ExecStart= /sbin/iwconfig wlan0 power off

[Install]
WantedBy=suspend.target
Save the file. Then do:

Code: Select all

sudo systemctl enable root-resume
Much of this is via the info here, by the way.

Finally, reboot the Pi (sudo reboot). That's it.


Check that it worked

To check it worked, once you've rebooted, do:

Code: Select all

iwconfig
Make sure it says "Power Management:off" in the portion concerning your wi-fi interface.

Hope that helps.

-M

Re: WiFi Issues ? Start here !

Posted: Fri Mar 04, 2016 4:07 pm
by rurwin
aloodb wrote:sudo branch=next rpi-update
Just to reiterate what was said above, in case you missed the import:
BRANCH must be in upper-case letters.

Code: Select all

sudo BRANCH=next rpi-update
As we've said elsewhere, unless you need to have channel 12 & 13, don't do this; you're putting unproven firmware onto your Pi and it could have other issues.

Re: WiFi Issues ? Start here !

Posted: Fri Mar 04, 2016 5:09 pm
by aloodb
BRANCH must be in uppercase :-) that was the problem was in lowercase in all the appends I found. Now have a 4.4.4 kernel and working Wifi on channel 12 ...... many thanks

Re: WiFi Issues ? Start here !

Posted: Fri Mar 04, 2016 10:30 pm
by stubright
Hi,
I'm having issues with wifi on my shiny new pi3. I'm getting a lot of errors in dmesg, eg

Code: Select all

[ 5056.502602] brcmfmac: brcmf_sdio_hdparse: seq 74: sequence number error, expect 70
[ 5056.502705] brcmfmac: brcmf_sdio_hdparse: seq 70: sequence number error, expect 75
[ 5056.504321] brcmfmac: brcmf_sdio_hdparse: seq 79: sequence number error, expect 75
I have dozens and dozens of these, they occur when I'm trying to copy large files (>400MB approx) from my Pi Nas or from the internet to my Pi3. If I'm copying from my nas, the file will fail with a timeout. If it's from the internet, it works with errors in dmesg. It appears the faster the transfer the more chance of failure. The wifi shouldn't be going to sleep as I don't leave the file just to copy, I continue using the Pi (watching for errors, checking dmesg).
I'm running a fresh Raspbian, fully updated on a brand new 16GB Sandisk SD card, using a cpc official pi3 2.5A power supply. Ubuntu Mate has the same issue.
If I use a PiHut wifi dongle (while disabling the onboard wifi), I don't have any PiHut wifi related errors or timeouts.

Stu

Re: WiFi Issues ? Start here !

Posted: Fri Mar 04, 2016 11:35 pm
by rurwin
Switch off power management. No it doesn't make sense, but it will probably work even so.

It's easy enough to try, just:

Code: Select all

sudo iwconfig wlan0 power off
If it does then there's instructions for making it permanent a few posts above.

Re: WiFi Issues ? Start here !

Posted: Sat Mar 05, 2016 12:05 am
by stubright
rurwin wrote:Switch off power management. No it doesn't make sense, but it will probably work even so.
It's easy enough to try, just:

Code: Select all

sudo iwconfig wlan0 power off
If it does then there's instructions for making it permanent a few posts above.
Thanks Rurwin
That sort of worked a little bit. I still get several (six for one file, they come in groups of three) 'sequence number errors' but a 1.4GB file copied without timing out. Whether it is usable after copying is another matter.
Any other options would be greatly appreciated.
Stu

Re: WiFi Issues ? Start here !

Posted: Sat Mar 05, 2016 12:50 pm
by overskilling
Just the command

iwconfig wlan0 power off

was sufficient without the update on a new Pi3. This fixed the hanging (sleeping) and PING times improved dramatically.

Thanks for the help.

Re: WiFi Issues ? Start here !

Posted: Sat Mar 05, 2016 2:12 pm
by mkarliner
Yep, same here. Pi drops an ssh that doesn't have activity after a minute or
so. I'll try to work out how to disable power management and report back.

a few minutes later....
I've added iwconfig wlan0 power off to /etc/rc.local
that seems to have fixed it.

Mike
Joshimuz wrote:I've have similar issues with the Pi3 wifi as manawyrm.

But I also have a problem whereby if the wireless connection is not being used for ~1 minute, it drops completely and I can no longer connect/ping the Pi at all, yet it still shows on my router's connection list.

I found that opening a SSH connection and using the top command is a good way to keep it connected, but obviously this isn't an ideal solution. There might be a better way but I'm not very familiar with Linux.

Re: WiFi Issues ? Start here !

Posted: Sat Mar 05, 2016 2:29 pm
by DirkS
mkarliner wrote:Yep, same here. Pi drops an ssh that doesn't have activity after a minute or so
I'm a bit surprised. As a test I left an SSH session over wlan open all night and this morning it was still alive.
I did not make any changes to the configuration...

Re: WiFi Issues ? Start here !

Posted: Sun Mar 06, 2016 8:18 am
by kbordzan
rurwin wrote:I was using SSH over WiFi last night, having finally got channel 13 working.

Although now you mention it, I did have to reboot it an extra time before it worked. I put that down to the protocols getting in a mess.
One thing I might have done between failing and succeeding is to unplug the Ethernet cable.
Are you saying that problem can be used channel for WiFi, that SSH is not working?

Re: WiFi Issues ? Start here !

Posted: Sun Mar 06, 2016 11:43 am
by AndyQua
I have a slightly more challenging issue.

On boot, I can ping my PI 3 from my mac and ssh into it fine.

After about a minute, the mac can no longer ping the PI, or establish a new ssh session HOWEVER the original ssh session continues to work fine and the PI is working fine on the network for about 5 more minutes of no activity and then that dies and the PI needs a reboot.

If though I ping the mac's IP address from the PI, this takes a second or so to work but once that ping has returned, the mac can once again ping the PI and new ssh sessions can be established again. Then again, after another minute or so the cycle repeats.

Power Management on the PI's wifi is turned off (iwconfig shows Power Management:off).

I've tried both setting the PI's IP Address both from dhcp and a static ip but that makes no difference.

Note - both machines are connecting over WiFi.

Any thing else I should be doing or not doing?

Re: WiFi Issues ? Start here !

Posted: Sun Mar 06, 2016 12:55 pm
by Koldur
The only thing you can do now is wait until they fix the Wi-Fi driver. It is clear there are some issues, but that was to be expected if you ask me. I am sure in a month or so these issues will be ironed out.

Re: WiFi Issues ? Start here !

Posted: Sun Mar 06, 2016 4:42 pm
by johnthemayor
EDIT: Upgrading from firmware 4.1.18 to 4.1.19 fixed the issue. Now my wifi is up and running perfectly, with Raspbian and OpenELEC. It's running on channel 11 and it was on channel 11 as well when it was not working.

Using Raspbian with Raspberry Pi 3 wlan0 shows up in ifconfig:

Code: Select all

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:70:84:01
          inet addr:169.254.92.44  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::ba27:ebff:fe70:8401/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11 errors:0 dropped:11 overruns:0 frame:0
          TX packets:5800 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4548 (4.4 KiB)  TX bytes:1603408 (1.5 MiB)
However it refuses to connect to my wifi, yet other devices connect to it just fine, e.g. my Oneplus 2. How do I debug the wifi connection?

Re: WiFi Issues ? Start here !

Posted: Sun Mar 06, 2016 5:17 pm
by rurwin
The most likely reason is that your router has chosen channel 12 or 13. To check this log into your router or install the app "WiFi Analyser" on your Android phone.

The best and most foolproof solution at the moment is to change the channel your router is using.

Re: WiFi Issues ? Start here !

Posted: Mon Mar 07, 2016 1:32 pm
by max2play
Hi,

I am not successful in setting up a wi-fi connection on the Raspberry Pi 3 with the inbuild Wi-Fi module with WPS (Wi-Fi Protected Setup) on the latest Raspbian (Debian Jessie Lite). While normal connection with SSID and Passphrase with wpa_supplicant and wpa_cli work without problems, the connection with wpa_cli wps_pbc gives the following error:

Code: Select all

> wps_pbc
OK
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE-PBC 
<3>Trying to associate with xx:xx:xx:xx:xx:xx (SSID='Max2Play' freq=2412 MHz)
<3>Association request to the driver failed
<3>Authentication with xx:xx:xx:xx:xx:xx timed out.
<3>CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE-PBC 
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE-PBC 
<3>Trying to associate with xx:xx:xx:xx:xx:xx (SSID='Max2play' freq=2412 MHz)
<3>Association request to the driver failed
<3>Authentication with xx:xx:xx:xx:xx:xx timed out.
<3>CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1
With a USB-Wi-Fi-Dongle connected it works fine. I assume there might be some kind of problem with the driver for the BCM43438? Maybe it just doesn't support WPS? Am I missing something?

The (successful) output with a Wi-Fi dongle (not using the inbuild Wi-Fi of the RPi-3) is the following:

Code: Select all

> wps_pbc
OK
<3>CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE-PBC 
<3>Trying to associate with xx:xx:xx:xx:xx:xx (SSID='Max2Play' freq=2412 MHz)
<3>Association request to the driver failed
<3>Associated with xx:xx:xx:xx:xx:xx
<3>CTRL-EVENT-EAP-STARTED EAP authentication started
<3>CTRL-EVENT-EAP-STATUS status='started' parameter=''
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=1
<3>CTRL-EVENT-EAP-STATUS status='accept proposed method' parameter='WSC'
<3>CTRL-EVENT-EAP-METHOD EAP vendor 14122 method 1 (WSC) selected
<3>WPS-CRED-RECEIVED 
<3>WPS-SUCCESS 
This is what I am hoping to achieve with the Build-In Wi-Fi module of the RPi-3...

Re: WiFi Issues ? Start here !

Posted: Tue Mar 08, 2016 5:50 pm
by Appesteijn
RaspberryPi v3 here.

Did a clean install of Raspbian Jessie Lite.
Set the powermgmt of the wlan0 off and connected to my SSID.

Once I reboot without a LAN cable attached, WiFi is buggy. Can't connect through SSH over WiFi or get a 'broken pipe' after a few seconds.

If I insert the LAN cable, I can connect through SSH over wifi and the connecting is stable.

***Update: Disabling the powermgmt worked. Now my Pi3 connects to Wifi even when no LAN cable is attached

Re: WiFi Issues ? Start here !

Posted: Wed Mar 09, 2016 4:23 am
by pingpong2012
My pi 3 wifi is incredibly slow. During first updates it was running about 40kBps. Sometimes it jumps as high as 150-170kBps. Sometimes as low as around 10.

Re: WiFi Issues ? Start here !

Posted: Wed Mar 09, 2016 12:35 pm
by vollmeise
Hi,

I have some very strange phenomena using the Raspberry Pi 3's onboard wifi.

The Pi3 runs with a freshly installed Raspbian Jessie and is up to date (apt-get upgrade etc.). My access point is a 802.11g Netgear DG834GB router, working flawlessly with other raspi's or a notebook.
If the Pi3 is connected over wired Ethernet (eth0) or using an USB Wifi dongle (Edimax) from an other Pi, everything works as expected.
If I use the onboard wifi interface of the Pi3 I have observed three problems:

1. Slow speed and high latency - solved
That problem was solved with the iwconfig command as already described in this thread. I made this permanent in the

Code: Select all

/etc/network/interfaces
configuration file:

Code: Select all

allow-hotplug wlan0                                                                                                                                                         
iface wlan0 inet manual                                                                                                                                                     
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf                                                                                                                        
    # deaktiviere power save modus fuer Raspberry Pi 3 on board wifi                                                                                                        
    post-up iwconfig wlan0 power off                                                                                                                                        
2. Traceroute with UDP not working from other stations to the Pi3 (192.168.1.220)

Code: Select all

atom:~# traceroute -I 192.168.1.220                                                                                                                                         
traceroute to 192.168.1.220 (192.168.1.220), 30 hops max, 60 byte packets                                                                                                   
 1  raspberry.local (192.168.1.220)  8.431 ms  8.717 ms  9.044 ms                                                                                                           
atom:~# traceroute -T 192.168.1.220                                                                                                                                         
traceroute to 192.168.1.220 (192.168.1.220), 30 hops max, 60 byte packets                                                                                                   
 1  raspberry.local (192.168.1.220)  7.371 ms  7.769 ms  7.756 ms                                                                                                           
atom:~# traceroute -U 192.168.1.220                                                                                                                                         
traceroute to 192.168.1.220 (192.168.1.220), 30 hops max, 60 byte packets                                                                                                   
 1  * * *                                                                                                                                                                   
 2  * * *                                                                                                                                                                   
 3  * * *                                                                                                                                                                   
 4  * * *                                                                                                                                                                   
 5  * * *                                                                                                                                                                   
 6  * * *                                                                                                                                                                   
 7  * * * 
Traceroute from the Pi 3 to other stations works as expected.

3. SSH from or to the Pi3 hangs after succesful authentication :?
Using ssh -v shows clearly that the authentication was succesful, but I don't get a prompt. The tcp connection is established.
It doesn't look like a configuration in sshd since everything works perfectly using wired ethernet or an USB wifi dongle.

Everything else (shellinabox, Apache2 etc.) just works over the Pi3's onboard wifi.

Bye

Re: WiFi Issues ? Start here !

Posted: Wed Mar 09, 2016 4:46 pm
by vollmeise
An update to my previous post...

Connecting the Pi3 and onboard wifi to a different access point (AVM FritzBox 7390) shows none of the described problems with traceroute and ssh! :roll:
So it is the combination of the Pi 3's onboard wifi and the Netgear access point which is making the trouble.
While good to know, it doesn't solve the problem for me (ssh not working in my wlan).
Could this be fixed by a driver update on the Pi 3?

Bye

Re: WiFi Issues ? Start here !

Posted: Fri Mar 11, 2016 4:34 am
by harnessg
Got my Rpi3 a few days ago, and I'm having the same problem with it that I was with the Rpi2 as far as wi-fi goes. I'm running a Trendnet TEW-452BRP in access point mode (on channel 6). I also have an AT&T wireless access point from 2WIRE. I got the wi-fi dongle with the Rpi2 from MCM. With wheezy on the Rpi2, it connected to the Trendnet just fine (and also to the 2WIRE router as well). When I upgraded to jesse, it would no longer connect to either. I figured it was a driver issue, but didn't really persue it.

So then the 3 arrives. I figured that the wi-fi would work out of the box. Nope. I've updated, upgraded, sudoed till I'm blue in the face and it just won't connect to my wi-fi.

I've tried some of the suggestions here and when I saw that it might be the channel, that got my hopes up. But I confirmed that the Trendnet is on channel 6 and the 2WIRE is on channel 11.

Anyone have any ideas?

Re: WiFi Issues ? Start here !

Posted: Fri Mar 11, 2016 9:29 am
by pierau
vollmeise wrote:An update to my previous post...

Connecting the Pi3 and onboard wifi to a different access point (AVM FritzBox 7390) shows none of the described problems with traceroute and ssh! :roll:
So it is the combination of the Pi 3's onboard wifi and the Netgear access point which is making the trouble.
While good to know, it doesn't solve the problem for me (ssh not working in my wlan).
Could this be fixed by a driver update on the Pi 3?

Bye
The problem with SSH stopping after auth seems to be a routing problem which would also explain your traceroute troubles. Some questions to determine if this is the case: Do the different access points have different subnets? Like one is 192.168.10.0/24 and the other 192.168.12.0/24. Did you ever connect your eth0 to the network where SSH does not work? Does SSH over the Wifi IP work when eth0 is connected?

Re: WiFi Issues ? Start here !

Posted: Fri Mar 11, 2016 11:17 am
by vollmeise
Hello pierau

thank you for your reply.
The problem with SSH stopping after auth seems to be a routing problem which would also explain your traceroute troubles.
A routing problem (IP layer) should hit all higher protocol layers (ICMP, UDP, TCP) in the same way. But it is only udp traceroute and ssh which is not working. Both access points work as bridges in the same ip subnet (192.168.1.0/24), so there is no routing involved at all.

Re: WiFi Issues ? Start here !

Posted: Fri Mar 11, 2016 11:28 am
by prich
Hi,

I have had trouble with the WiFi on the Pi 3. Problem appeared to be possibly related to chip shutting down and not waking. My Pi would work well while ever it was used regularly but after a couple of hours idle it would no longer respond (difficult since it runs headless).

After turning off power management I no longer have the problem.

Peter

Re: WiFi Issues ? Start here !

Posted: Fri Mar 11, 2016 11:47 am
by chrisoh
vollmeise wrote:Hello pierau

thank you for your reply.
The problem with SSH stopping after auth seems to be a routing problem which would also explain your traceroute troubles.
A routing problem (IP layer) should hit all higher protocol layers (ICMP, UDP, TCP) in the same way. But it is only udp traceroute and ssh which is not working. Both access points work as bridges in the same ip subnet (192.168.1.0/24), so there is no routing involved at all.
I mentioned this in the other [RPi3] SSH not working via wifi thread, but I'll reiterate here to contribute to this thread; I'm seeing the same behaviour as you with regards to SSH and UDP over WiFi, also using a Netgear router funnily enough (DG834G), no bridging though. The problems do not exist whilst using a smartphone as a hotspot. I've got another wireless router I can test with, but I need to find the power cable first.

Re: WiFi Issues ? Start here !

Posted: Fri Mar 11, 2016 6:52 pm
by TorcelloPi
Raspberry Pi model B, all updates and upgrades to Raspbian made today.
StarTech USB2.0 802.11g/n (150WN1X1) wifi dongle.

I configured etc/network/interfaces
and etc/wpa_supplicant/wpa_supplicant.conf
files according to the YouTube Tutorial by 'Circuit Basics'
https://www.youtube.com/watch?v=lfHRLLRbErw

This resulted in a message "Interface Doesn't Support Scanning"
once I'd entered the line sudo iwlist wlan0 scan | grep ESSID.

After iwconfig, it said No Wireless Extensions

??? I'm lost :)