Pharsea
Posts: 35
Joined: Sun Nov 11, 2018 5:15 pm

WiFi intermittant problem

Thu Dec 06, 2018 9:21 am

Generally speaking I have a good WiFi connection to my "R-Pi 2" running Raspbian

However, occasionally it simply collapses.

1. How can I diagnose the underlying problem?

2. How can I re-establish the connexion without rebooting the R-Pi?

oldjake
Posts: 88
Joined: Fri Aug 03, 2018 12:39 pm

Re: WiFi intermittant problem

Thu Dec 06, 2018 2:31 pm

I can't answer 1, I'm afraid. I had a similar problem and this is what I did for 2 though.

Create a script called checkwifi.sh in /usr/local/bin and put this in it:

Code: Select all

ping -c4 192.168.0.1 > /dev/null
 
if [ $? != 0 ] 
then
  sudo ifdown wlan0
  sudo ifup wlan0
fi
Next:

Code: Select all

sudo chmod +x checkwifi.sh
And add this to crontab:

Code: Select all

*/5 * * * * /usr/bin/sudo -H /usr/local/bin/checkwifi.sh >> /dev/null 2>&1
That'll at least get you back online with a 5 minute delay at most.

Pharsea
Posts: 35
Joined: Sun Nov 11, 2018 5:15 pm

Re: WiFi intermittant problem

Sun Jan 27, 2019 5:37 pm

Thanks!

Pharsea
Posts: 35
Joined: Sun Nov 11, 2018 5:15 pm

Re: WiFi intermittant problem

Sat Feb 16, 2019 7:19 pm

oldjake wrote:
Thu Dec 06, 2018 2:31 pm
I can't answer 1, I'm afraid. I had a similar problem and this is what I did for 2 though.

Create a script called checkwifi.sh in /usr/local/bin and put this in it:

Code: Select all

ping -c4 192.168.0.1 > /dev/null
 
if [ $? != 0 ] 
then
  sudo ifdown wlan0
  sudo ifup wlan0
fi
Next:

Code: Select all

sudo chmod +x checkwifi.sh
And add this to crontab:

Code: Select all

*/5 * * * * /usr/bin/sudo -H /usr/local/bin/checkwifi.sh >> /dev/null 2>&1
That'll at least get you back online with a 5 minute delay at most.
I have had the problem again. This time even a power-down reboot doesn't bring up the WiFi.
The Ethernet connexion is fine.

The following may help:

>> sudo ip link show wlan0

3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP>
mtu 1500 qdisc pfifo_fast state DOWN mode DORMANT
group default qlen 1000
link/ether fc:b4:e6:b8:07:fd brd ff:ff:ff:ff:ff:ff

Return to “Troubleshooting”