Useful commands when setting up wifi on a Raspberry Pi

By | September 22, 2016

Getting a wifi dongle working on a Raspberry Pi can either take 5 minutes or 5 hours depending on a lot of factors. If you have the right dongle and a fresh image, it is essentially plug and play. All the drivers will be there, the dongle will be from a recognised brand and all is fine.

Issues can occur if the image is a little old just as Debian Wheezy and how you configure your wpa_supplicant.conf and interfaces file. There are also slight variations that apply as well.

Here are a list of useful commands to help troubleshoot. Note, the wifi dongle should have some sort of flashing LED to indicate that it is at least working.

Run “ifconfig” to see if wlan0 has an IP address.

If not, run “iwlist wlan0 scan” to see if the pi wifi dongle can see any wifi network. (sudo iwlist wlan0 scan | grep ESSID)

If not, run “tail -f /var/log/messages”, pull out the dongle and put it back in to see if the dongle is recognised and if there are any error messages

Run “cat /etc/os-release” to understand what your image version is. There have been changes in how the wpa_supplicant file works between wheezy and jessie.

 
> iwconfig
> lsmod

Leave a Reply

Your email address will not be published.