TheTwister
Posts: 18
Joined: Fri Dec 29, 2017 6:39 pm

Wifi Time out

Fri Dec 29, 2017 6:50 pm

Hi there,

I have a Raspberry Pi 2 B. I have had it for sometime now. I runs pretty much 24/7. However I have noticed that the WiFi times every so often when i sent a ping to it.

I have done the following troubleshoots:
  • 1. I have tried a separate dongle
    2. adding SSID info manually sudo nano /etc/network/interfaces
    3. Connecting via Ethernet works fine, in fact having that connected the wifi part of it does not time out as they are both on different IP addresses
Does any one know any other troubleshoots i could do?

User avatar
DougieLawson
Posts: 40828
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Wifi Time out

Fri Dec 29, 2017 9:01 pm

What dongle are you using? What does an lsusb command show?

Have you tried running a script from crontab (or from /etc/cron.d/wifi)

Code: Select all

*/6 * * * * root  /root/WiFiCheck.sh 1> /dev/null 2>/dev/null
runs it every six minutes on all of my machines with a flaky WiFi interface.

Code: Select all

#!/bin/bash

ip="192.168.3.14/24"
wlanx="wlan0"

router="192.168.3.1"
google="8.8.8.8"
resolver="192.168.3.1"

/bin/ping -q -c1 $google > /dev/null

if [ $? -eq  0 ]
then
  : 

else
  echo "Network down, fixing..."
  /bin/kill -9 `pidof wpa_supplicant`
  rc=$?
  /sbin/ifconfig $wlanx $ip
  /sbin/ifconfig $wlanx up
  rc=$?
  /sbin/wpa_supplicant -Dnl80211 -i$wlanx -c/etc/wpa_supplicant/wpa_supplicant.conf &
  rc=$?
  /sbin/ip route add default via $router dev $wlanx
  rc=$?

fi
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

TheTwister
Posts: 18
Joined: Fri Dec 29, 2017 6:39 pm

Re: Wifi Time out

Fri Dec 29, 2017 9:08 pm

I am using a Edimax EW-7811Un N150 Dongle which shows it the lsusb command.

I am a complete novice in Raspberry Pi, how do i run that script?

User avatar
DougieLawson
Posts: 40828
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Wifi Time out

Fri Dec 29, 2017 11:51 pm

Try this:
sudo nano /etc/modprobe.d/8192cu.conf

Code: Select all

options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
That disables power management on the WiFi adapter so it should stop taking a timeout.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

TheTwister
Posts: 18
Joined: Fri Dec 29, 2017 6:39 pm

Re: Wifi Time out

Sat Dec 30, 2017 4:41 pm

Hmm just tried that left it for 2 hours so came back and still see some dropouts but they are long dropouts. The ping time goes crazy to like 300ms from 1ms

spunkyk98
Posts: 1
Joined: Sat Mar 12, 2016 3:11 pm

Re: Wifi Time out

Tue Jan 02, 2018 2:59 am

Has this been happening for a while now? Did you switch ISP's?

I had this issue with all my pi's(RPI 1, and two RPI3's) for more than a year. They were all working great when I first bought them. Never had an issue SSH'ing into them. Then all of sudden I had WIFI drop outs. I spent months trying all kinds of fixes I could find in this forum and from google searching, but to no avail. It turned out, the problem started occuring right after I switched ISP's about a year earlier. It didn't dawn on me it could be the new Spectrum Ubee router. I had the Spectrum tech flash the router into bridge mode and used my own WIFI router. That did it. I set the my own router to the same SSID and pwd that I had on the Spectrum router. From then on, never had an issue with the RPI's WIFI dropouts.

Return to “Troubleshooting”