sarathjayanthan
Posts: 14
Joined: Tue Jul 24, 2018 9:07 am

Raspberry Pi 3 - not connecting to WiFi network on start up

Wed Aug 22, 2018 11:42 am

Hello,

I am using Raspberry Pi 3 with Ubuntu Mate 16. I followed Raspberry Pi Documentation to set up the WiFI in it. But, currently, I am facing a problem that WiFi in RPi3 is not getting connected on start up (every time it is powered on). When I type 'ifconfig' in terminal, I cannot find any IP address assigned for 'wlan0'.

To connect it to WiFi again, I have to run the following commands :
sudo ifdown wlan0
sudo ifup wlan0


After running the above commands, wifi is again connected (when 'ifconfig' is run, I can find an IP address for 'wlan0').

Since I am trying to access RPi3 with a Remote Computer through SSH (via WiFi), this issue is bothersome. Could someone help me with this regard?

Thanks in advance.

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

Re: Raspberry Pi 3 - not connecting to WiFi network on start up

Wed Aug 22, 2018 12:03 pm

Might be a daft question but have you set all your localisation settings? WiFi country, etc? I only ever get WiFi issues when I've forgotten to set something.

In the short term, this might help:

Code: Select all

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

You might need to change the IP address to your router.

- Save that as checkwifi.sh
- sudo chmod +x checkwifi.sh
- Add "*/5 * * * * /usr/bin/sudo -H /usr/local/bin/checkwifi.sh >> /dev/null 2>&1" (without the quotes) to crontab

That'll check the connection every 5 minutes and do what you do manually if there's a problem.

Best
Andy

Return to “Troubleshooting”