If you work with your Raspberry Pi in a graphical user interface (GUI), problems with setting up Wi Fi module should arise: connecting the module to the USB-port Raspberry Pi, you just run WiFi icon from your desktop (in Raspbian Wheezy OS), then it automatically scan the available Wi Fi networks and connection chosen.
But we know, if you want a good deal on some system – work in text mode 😉
More interesting is the situation with Wi Fi setting on Raspberry Pi through the terminal. If you are working with your Raspberry Pi, say trough ssh in putty (windows), just connect through a terminal or even Linux LXTerminal of the Raspberry Pi, you will need to carry out the following steps to set up your computer to work on Wi-Fi network:
Run the command
sudo nano /etc/network/interfaces
The contents of the file should be something like this:
iface lo inet loopback
iface eth0 inet dhcp
iface wlan0 inet dhcp
"ssid" name of WiFi network that are connected and
"password" network password. Remember! Network name and password must be written in double quotes.
After making changes save file (CTRL O + Enter) and close it (CTRL X).
Restarting your Raspberry Pi, you will see that it is now automatically connects to your WiFi network.
That’s all 🙂