Page 1 of 1

SSH WiFi connection drops

Posted: Tue Dec 01, 2015 10:09 pm
by AndyQua
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!

Re: SSH WiFi connection drops

Posted: Wed Dec 02, 2015 1:15 am
by PiLinx
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

Re: SSH WiFi connection drops

Posted: Wed Dec 02, 2015 7:54 am
by AndyQua
Thanks - I'll give that a go this evening

Re: SSH WiFi connection drops

Posted: Wed Dec 02, 2015 8:05 am
by texy
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

Re: SSH WiFi connection drops

Posted: Wed Dec 02, 2015 5:32 pm
by AndyQua
I've already tried that but it made no difference (both that and the wireless-power off in the interfaces file)

Re: SSH WiFi connection drops

Posted: Wed Dec 02, 2015 5:48 pm
by texy
Maybe you a different problem then as the method I suggested worked for me as recently as this week.
Poor wifi signal?

Re: SSH WiFi connection drops

Posted: Fri Dec 04, 2015 1:12 pm
by AndyQua
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?

Re: SSH WiFi connection drops

Posted: Fri Dec 04, 2015 1:17 pm
by texy
Can you post your /etc/modprobe.d/8192cu.conf file.
Also the output of lsusb.
Texy

Re: SSH WiFi connection drops

Posted: Fri Dec 04, 2015 1:26 pm
by AndyQua
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

Re: SSH WiFi connection drops

Posted: Fri Dec 04, 2015 1:35 pm
by texy
I can't see anything wrong there. What about the wifi signal strength - how far from your router are you?
Texy

Re: SSH WiFi connection drops

Posted: Fri Dec 04, 2015 1:52 pm
by AndyQua
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).

Re: SSH WiFi connection drops

Posted: Fri Dec 04, 2015 6:18 pm
by dgordon42
The 'iwconfig' command will give you WiFi signal strength, noise, and quality information.

Dave.