Hot Spot

Turn Your Raspberry Pi Into a WiFi Hotspot with Edimax Nano USB EW-7811Un (RTL8188CUS chipset)

The first thing you need to do is make sure you have an existing wired connection to your rPi. After that, you need to install the following packages.

 sudo apt-get install bridge-utils hostapd

The whole crux of the issue is that it is the apt hosted copy of hostapd that is not compatible with the RTL8188CUS chipset. But, thanks to the Edimax team, I’ve got a replacement hostapd binary to resolve this issue. This tutorial will not work without it.

To download and replace the installed binary version of hostapd we just installed, issue the following commands:

 wget http://www.daveconroy.com/wp3/wp-content/uploads/2013/07/hostapd.zip
 wget http://www.boboc.net/wiki/uploads/Main/hostapd.zip
 wget http://www.adafruit.com/downloads/adafruit_hostapd.zip 
 unzip hostapd.zip 
 sudo mv /usr/sbin/hostapd /usr/sbin/hostapd.bak
 sudo mv hostapd /usr/sbin/hostapd.edimax 
 sudo ln -sf /usr/sbin/hostapd.edimax /usr/sbin/hostapd 
 sudo chown root.root /usr/sbin/hostapd 
 sudo chmod 755 /usr/sbin/hostapd

Bridge the Network Connections

Now that we have the proper hostapd installed, we need to create a bridge between our ethernet connection and our Edimax Wireless card. To do this, we need to edit our network interfaces:

 sudo nano /etc/network/interfaces

To avoid any conflicts, you need to delete or comment out(#) any lines conatining wlan0 and then add the following text to bridge the connections, assuming your ethernet and wireless adapters are named eth0 and wlan0( use ifconfig -a to check)

 auto br0
 iface br0 inet dhcp
 bridge_ports eth0 wlan0 

The resulting file should look like this:

 #loopback adapter
 auto lo
 iface lo inet loopback

 #wired adapter
 iface eth0 inet dhcp

 #bridge
 auto br0
 iface br0 inet dhcp
 bridge_ports eth0 wlan0

Configuring Hostapd

Now that our interfaces are setup, we need to configure hostapd. To do so, create the following file

 sudo nano /etc/hostapd/hostapd.conf

with the following contents:

 interface=wlan0
 driver=rtl871xdrv
 bridge=br0
 ssid=DaveConroyPi
 channel=1
 wmm_enabled=0
 wpa=1
 wpa_passphrase=ConroyPi
 wpa_key_mgmt=WPA-PSK
 wpa_pairwise=TKIP
 rsn_pairwise=CCMP
 auth_algs=1
 macaddr_acl=0 

Wrapping Up

We should be finished now, and afer a reboot

 sudo reboot

you can test your configuration using the following command

 sudo hostapd -dd /etc/hostapd/hostapd.conf

If it runs as expected, you can add it to startup by editing

 sudo nano /etc/default/hostapd

and uncommenting and updating the following line

 DAEMON_CONF="/etc/hostapd/hostapd.conf"

Thanks for reading!