AndyQua
Posts: 7
Joined: Sat Feb 14, 2015 11:47 am

SSH WiFi connection drops

Tue Dec 01, 2015 10:09 pm

Just rebooted my PI 2 which has been working fine for ages and all of a sudden it stops incoming network connections after a period of idle activity (outgoing connections are fine). Also, any existing ssh connections are also dropped (Broken pipe).

There is nothing reported from dmesg when this happens (or in /var/log/messages).

When the PI stops accepting incoming connections, you also cannot ping it. However, from the PI I can ping out fine.

If I reset the wifi connection (sudo ifdown wlan0 ; sudo ifup wlan0) then all works again for a little while.

I'm currently using the Edimax wifi dongle.

Any ideas - this is driving me mad!

PiLinx
Posts: 15
Joined: Wed May 15, 2013 8:35 pm
Location: Portugal, Madeira

Re: SSH WiFi connection drops

Wed Dec 02, 2015 1:15 am

There seems to be a know problem. There is also another posts about this.
Check this for the solution: http://www.andreagrandi.it/2014/09/02/h ... -raspbian/
Basically, last part it creates a service that runs ping to your router to keep wifi up
I Have Pi1 Model B and Pi2 Model B
Experience with Linux Debian and Arch

AndyQua
Posts: 7
Joined: Sat Feb 14, 2015 11:47 am

Re: SSH WiFi connection drops

Wed Dec 02, 2015 7:54 am

Thanks - I'll give that a go this evening

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: SSH WiFi connection drops

Wed Dec 02, 2015 8:05 am

Basically the wifi adapter by default will enter 'sleep' mode after a period of inactivity. The better solution is to disable that feature.
viewtopic.php?f=91&t=127054

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

AndyQua
Posts: 7
Joined: Sat Feb 14, 2015 11:47 am

Re: SSH WiFi connection drops

Wed Dec 02, 2015 5:32 pm

I've already tried that but it made no difference (both that and the wireless-power off in the interfaces file)

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: SSH WiFi connection drops

Wed Dec 02, 2015 5:48 pm

Maybe you a different problem then as the method I suggested worked for me as recently as this week.
Poor wifi signal?
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

AndyQua
Posts: 7
Joined: Sat Feb 14, 2015 11:47 am

Re: SSH WiFi connection drops

Fri Dec 04, 2015 1:12 pm

Right I've added a script that pings router ever 10 seconds, disabled power management in interfaces and also in /etc/modprobe.d/8192cu.conf.

Still getting network disconnected after about 20-30 seconds of no activity.

Have also tried a different wifi adapter based on the rt2800usb driver still no joy at all.

Also, tried on Pi Zero and get exactly the same (clean Rasbian image) with both adapters!

Oddly, once the network stops responding (no ping, ssh stops responding), if I unplug the wifi dongle and plug it back in, after a few seconds it comes back on.

Any more ideas?

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: SSH WiFi connection drops

Fri Dec 04, 2015 1:17 pm

Can you post your /etc/modprobe.d/8192cu.conf file.
Also the output of lsusb.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

AndyQua
Posts: 7
Joined: Sat Feb 14, 2015 11:47 am

Re: SSH WiFi connection drops

Fri Dec 04, 2015 1:26 pm

pi@homepi ~ $ cat /etc/modprobe.d/8192cu.conf
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
pi@homepi ~ $ lsusb
Bus 001 Device 005: ID 1997:0409
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: SSH WiFi connection drops

Fri Dec 04, 2015 1:35 pm

I can't see anything wrong there. What about the wifi signal strength - how far from your router are you?
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

AndyQua
Posts: 7
Joined: Sat Feb 14, 2015 11:47 am

Re: SSH WiFi connection drops

Fri Dec 04, 2015 1:52 pm

Pretty close to the router - it initially works fine for about 20-30 seconds! Nice and fast and then just dies.

Beginning to suspect something else not the PI. Looking into router now (but thats not been touched for ages).

dgordon42
Posts: 790
Joined: Tue Aug 13, 2013 6:55 pm
Location: Dublin, Ireland

Re: SSH WiFi connection drops

Fri Dec 04, 2015 6:18 pm

The 'iwconfig' command will give you WiFi signal strength, noise, and quality information.

Dave.

Return to “Troubleshooting”