It took me while to figure this out but it is very rewarding once you finally get it to work.
This configuration is for WPA2-PSK.
You can have a WiPI after these7 Easy Steps.
Open up the command line LX Terminal on the Raspbian GUI.
1. First things first make sure your Raspberry Pi recognizes the device in the USB hub.
You should see Bus / Device Edimax Technologies Co. Ltd EW- 7811Un
Check to see if you have the right kernals
Look for 8192cu
3. Set up your Network Interface
sudo nano /etc/network/interfaces
Mine is EXACTLY as follows.
auto lo iface lo inet loopback
auto eth0 iface eth0 inet dhcp
allow-hotplug wlan0 auto wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
hit ctrl-x, y to save, then enter
4. Set up WPA Supplicant
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1
pairwise= CCMP TKIP
group= CCMP TKIP
hit ctrl-x, hit y to save, then enter
5. Your network is now configured.
To see if it is working type
You should see wlan0 with your SSID AP and Bit Rate
6. Reboot the Rasp Pi
sudo shutdown -r now
should have your IP adresss and packets hot!
Let me know if this was helpful/ you have questions