My RPi kernel is 3.2.27+, it is need to compile module rtl8188eu with RPi source code.
Procedure as below
# apt-get install build-essential
#
# cd /usr/src
# wget -O rpi-3.2.27.tar.gz https://github.com/raspberrypi/linux/tarball/rpi-3.2.27
# tar xzf ./rpi-3.2.27.tar.gz
# KVER=`uname -r`
# mv raspberrypi-linux-* linux-$KVER
# cd linux-$KVER/
# sed -i 's/EXTRAVERSION =.*/EXTRAVERSION = +/' Makefile
# zcat /proc/config.gz > .config
# wget https://github.com/raspberrypi/firmware/raw/master/extra/Module.symvers
# make oldconfig
# make modules_prepare
# ln -s /usr/src/linux-$KVER /usr/src/linux
# ln -s /usr/src/linux-$KVER /lib/modules/$KVER/source
# ln -s /usr/src/linux-$KVER /lib/modules/$KVER/build
Get rtl8188eu source code from http://gutspot.com/wp-content/uploads/2013/01/8188eu_USB_linux.zip
unzip the file and go to directory driver
# make && make install
In my case, it's all. The module rtl8188eu has been load into RPi, MW150US WIFI dongle can be recognized.
ifconfig -a
iwcofnig
iwlist wlan0 scan
If it does not work, try the following method,
# lsmod
# rmmod 8192cu
# insmod 8188eu.ko
# modprobe 8188eu
# modinfo 8188eu
for autoload in RPi
# echo "8188eu" >> /etc/modules
# echo "blacklist rtl8192cu" >> /etc/modprobe.d/blacklist.conf (not necessary)
sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
# try one of below options
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
OR
pre-up wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="YOUR-SSID"
scan_ssid=1
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="WPA-PASSWORD" # wpa_passphrase
}
For reference
ssid: your wifi name
scan_ssid: value of 1 means broadcast and value of 2 means hidden (suggest you enter value of 1)
psk: your wifi password
proto: your choice of RSN or WPA. RSN is WP2 and WPA is WPA1. (most config is RSN)
key_mgmt: your choice of WPA-PSK or WPA-EAP (pre-shared or enterprise respectively)
pairwise: your choice of CCMP or TKIP ( WPA2 or WPA1 respectively)
auth_alg: OPEN option is required for WPA and WPA2 (other option, SHARED & LEAP)
Then run
# /etc/init.d/networking restart
Or
# ifup wlan0
# dhclient wlan0
script for auto-start wifi connection(Optional)
/etc/init.d/wifi-connect
#!/bin/sh
#wifi-connect auto-start
case $1 in
start)
wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -Dwext -s
wpa_cli -B -p/var/lib/run/wpa_supplicant -s
;;
stop)
;;
restart)
;;
*)
echo 'Usage:wifi-connect start|stop|restart'
;;
esac
exit 0
# chmod +x /etc/init.d/wifi-connect
# update-rc.d wifi-connect defaults
# update-rc.d -f wifi-connect remove
Install hostapd
1. unzip wpa_supplicant_hostapd-0.8_rtw_20120803.zip
go to directory hostapd and compile make && make install.
** should not ** start hostapd by /etc/init.d/hostapd start
just run /usr/local/bin/hostapd p2p_hostapd.conf -B
then hostapd started with ssid DIRECT-RT
ifconfig wlan0 192.168.0.1 netmask 255.255.255.0 (the segment should be match with udhcp)
3. sudo apt-get udhcpd
run /etc/init.d/udhcp start
Open your mobile's wifi to search ssid "DIRECT-RT" and pair with it using pasword "12345678", it will obtain the IP adddress dynamically.
Reference:
http://omer.me/2012/04/setting-up-wireless-networks-under-debian-on-raspberry-pi/
http://tasksofohm.wordpress.com/hardware/connecting-raspberry-to-a-ew-7811un/
http://www.ctrl-alt-del.cc/2012/05/raspberry-pi-meets-edimax-ew-7811un-wireless-ada.html
http://gutspot.com/2013/01/30/%E7%94%A8raspberry-pi%E5%88%B6%E4%BD%9C%E6%97%A0%E7%BA%BF%E8%B7%AF%E7%94%B1%E8%BF%87%E7%A8%8B%E7%9A%84%E6%9C%AD%E8%AE%B02-%E7%BC%96%E8%AF%918188eu%E8%8A%AF%E7%89%87%E7%9A%84%E6%97%A0%E7%BA%BF%E7%BD%91/
http://blog.elevendroids.com/2012/12/building-tp-link-tl-wn725n-wifi-usb-adapter-driver-for-raspberry-pi/
http://jarhead.blog.163.com/blog/static/175217041201317102236535/
http://alansun.iteye.com/blog/1150893
hostapd
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=19120
http://elinux.org/RPI-Wireless-Hotspot
*** New Version for 3.12.22+ ***
Just install a script to install rtl8188eu.ko as below,
tar -zxvf 8188eu-201xyyzz.tar.gz <--set data code for driver version above
sudo install -p -m 644 8188eu.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless
sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8188eu.ko
sudo depmod -a
http://www.raspberrypi.org/forums/viewtopic.php?p=462982#p462982
http://www.fars-robotics.net/