Sometimes there are too many wifi routers around you so that their channels conflicts with yours. In this case, you may need to manually choose a channel for your router, to minimize confliction. In this case, you need to scan and see the channels being used around you.
Solution for Linux:
In console, use the following command:
sudo iwlist wlan0 scanning | grep -iA3 Channel