Pages

Friday, November 29, 2013

Raspbian Wireless Wi-Fi

Are you wanting to connect to your Raspberry Pi over WiFi? The following are instructions for configuring WiFi on Raspbian (the other Debian based Raspberry Pi distributions should work in a similar manner).

Although the Raspberry Pi model B conveniently comes with an Ethernet
port (the model A does not), there are a number of applications where
having WiFi is super convenient. I have one of my Raspberry Pi out in
our garage, controlling and monitoring the garage door. Running a
network cable would have been a very ugly solution.

To connect via wireless one must add a WiFi USB dongle, which will consume one of your precious few available USB ports (maybe time to expand with a powered USB hub). There are other low level hardware options, but nothing quite as simple, and plug and play, as a WiFi USB dongle.

There are a number of compatible WiFi USB dongles on the market. Review the RPi USB Wi-Fi Adapters list for verified adapters. My personal favorite is the Edimax EW-7811Un 150 Mbps Wireless 11n Nano Size USB Adapter (pictured above), as it is popular, works fairly well, and is only $9 on Amazon (with Amazon Prime).

Your WPA key above can specified as either be the clear text passphrase, or the hex encoded version. If you would prefer to not list your clear text passphrase you can generate the encoded hex version with the wpa_passphrase tool or even online tools.

WPA passwords are managed on Linux with the wpa_supplicant tools. The wpa_passphrase tool is designed to generate a section that can be added to the /etc/wpa_supplicant/wpa_supplicant.conf configuration file. You can also add multiple SSIDs to wpa_supplicant.conf. If you have multiple SSID you may want to connect to (such as a mobile Raspberry Pi), don't add the wpa-ssid and wpa-psk lines to the interfaces file. Instead use the wpa_passphrase tool to add multiple sections to the wpa_supplicant.conf configuration file.

You can auto add the output of wpa_passphrase, to the wpa_supplicant.conf, with the following: