I had some trouble getting my Edimax EW-7811Un wireless adapter to work on my Raspberry Pi. This Realtek RTL8188CUS chipset based adapter works right out of the box when you use it to connect to wireless networks. But if I tried to set up an access point, I ran into some problems. Following a few blog posts on the web, I installed hostapd, but was always presented with the following error:
$ sudo hostapd /etc/hostapd/hostapd.conf Configuration file: /etc/hostapd/hostapd.conf nl80211: 'nl80211' generic netlink not found Failed to initialize driver 'nl80211' rmdir[ctrl_interface]: No such file or directory
Changing the driver parameter in the configuration file did not do anything but produce different error messages. I had almost given up hope with this adapter, until I read a post by not_the_pi_guy on the raspberry pi forums. He discovered that Realtek has their own version of hostapd on their website for this specific chipset. I moved the original Realtek source files to a github repository, and manipulated the Makefile to make installing a bit easier. I will guide you through the process.
Since we are building our own hostapd version, remove the original hostapd you might have installed:
sudo apt-get autoremove hostapd
On your Raspberry Pi, download and extract the source files from github:
wget https://github.com/jenssegers/RTL8188-hostapd/archive/v2.0.tar.gz tar -zxvf v2.0.tar.gz
Now build hostapd:
cd RTL8188-hostapd-2.0/hostapd sudo make
After a while, you should be given control back to the terminal.
sudo make install
This last step will move the created hostapd binary to
/usr/local/bin, add a startup script and create a configuration file in
/etc/hostapd/hostapd.conf. Edit this configuration file and start the hostapd service:
$ sudo service hostapd restart [ ok ] Stopping advanced IEEE 802.11 management: hostapd. [ ok ] Starting advanced IEEE 802.11 management: hostapd.
If you want to contribute to the Makefile or any of the scripts, send me a pull request on https://github.com/jenssegers/RTL8188-hostapd. You can follow this guide if you want further instructions on how to set up the actual hostspot for your Raspberry Pi.