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/v1.1.tar.gz tar -zxvf v1.1.tar.gz
Now build hostapd:
cd RTL8188-hostapd-1.1/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.
29 Comments Leave a comment
Jens SegersPosted 1 Day ago
@Trevor, double check your udhcpd or dnsmasq configuration files. I don't think that problem is related to hostapd. This is a good guide: http://elinux.org/RPI-Wireless-Hotspot
TrevorPosted 3 Days ago
Same problem as Dan - Android device gets stuck on Obtaining IP address. I am trying to pickup from a RPi running Rachel server which shows a static IP address. I think the problem might be in my interfaces setting. I have iface eth0 inet dhcp and iface wlan0 inet static.
Working in Ghana at the moment so really need some online help!!
elceefPosted 6 Days ago
Can anyone confirm this works with RTL8188EUS chip (TP-Link TL-WN725N V2 USB)?
liqiangPosted 1 Week ago
so much thank to you! I have trouble in this for server days and i want to tell other's that it also useful for EP-N8508GS wireless netcard!
BarryPosted 2 Weeks ago
Just what I needed, Thanks.
fiferPosted 4 Weeks ago
@dan is the hostapd daemon process running after rebooting? (sudo service hostapd status) if it is not, try "sudo insserv hostapd" and restart.
RichardPosted 4 Weeks ago
Your instructions helped a lot.
I am using my raspi as an access point with AirPlay in my car. How do I stop my iPhone from thinking the ap has Internet? I.e. iPhone connected to ap but still access 3/4G?
DanPosted 1 Month ago
Hi,
I managed to set this up and got it working using the configuration steps you linked to at the bottom of your instructions, however, after a reboot I can't connect, I get stuck at the Obtaining IP Address step. Any Ideas? I ran all the steps required for this to run automatically on reboot.
Dan
Thomas Hussey Posted 1 Month ago
hi i have limited connectivity do have to install anything else?
Nick BPosted 1 Month ago
Hi Jens,
Sorry about my last comment.Did it IE9 and could not see what Iwas supposed to put in each box. Hopefully this one is better now I have done it in Chrome.....Anyway...
Many thanks for the guide. I was able to get my Pi running as a hotspot. It turns out that my sd card corrpted, so I am doing it again from scratch. Do you recommend following the RPI-Wireless-Hotspot guide first, and then following your guide,or is there a way to combine the 2? Also did you ever do a post about getting udhcpd working with this hostapd? I could never get DHCP address - it only worked when I had a static ip.
Thanks in advance..
Nick
NickBPosted 1 Month ago
Hi Jens,
Many thanks for the guide. I was able to get my Pi running as a hotspot. It turns out that my sd card corrpted, so I am doing it again from scratch. Do you recommend following the RPI-Wireless-Hotspot guide first, and then following your guide,or is there a way to combine the 2? Also did you ever do a post about getting udhcpd working with this hostapd? I could never get DHCP address - it only worked when I had a static ip.
Thanks in advance..
Nick
Mark_HPosted 1 Month ago
No, that is about connecting to an AP with an RTL8188. I want to use th RTL8188 as an AP.
x@y.comPosted 1 Month ago
@markh - don't know if this helps? http://forum.stmlabs.com/showthread.php?tid=732&pid=36819#pid36819
Mark_HPosted 1 Month ago
V1.1 is working perfectly (raspian latest + tp-link TL-WN725N) for me too, but it is not working for the latest raspbmc. Wlan0 is not started or dissappears suddenly, when I start it manually it doesn;t get an IP address which I assigned in /etc/network/interfaces.
I think that raspbmc does not use the standard ways to configure network interfaces, but I can't figure out how to solve it.
FiferPosted 1 Month ago
One other comment:
I've been having trouble with hostapd not starting on boot. I think it starts too soon and fails.
I think this is because the script needs to call insserv to update the boot sequence?
I fixed with a one-time "sudo insserv hostapd" after the make install
FiferPosted 1 Month ago
Brilliant - thanks very much !!!!
V1.1 is working perfectly (raspian latest + tp-link TL-WN725N)
(btw the "tar" and "cd" commands need updating to v1.1)
Jens SegersPosted 1 Month ago
@Subhash Karemore, I added some basic WPA configuration to the github repository, it is available in the v1.1 tag. But you should be able to just edit the hostapd.conf file.
Jens SegersPosted 1 Month ago
@Mark, I did not encounter a similar problem. The problem is more likely to be an issue with your dhcp service (I think I used dnsmasq).
MarkPosted 1 Month ago
Hi, this is brilliant and has got me much further than any other guide. Thank you.
My new hotspot shows perfect signal but when i try to connect my phone it appears to fail at "obtaining ip address" and shows as "avoided poor internet connection". Now i dont want it on internet i am just trying to use it as a local link between fones and pi. Have you overcome similar?
Subhash KaremorePosted 1 Month ago
First of all thanks for this post. Earlier I had also same problem. Now my mobile is able to detect to network which I created using above settings. However it doesn't show "connect" button on my mobile. Means I am not able to connect to network. It display status as a "Saved" not "Connected". Mobile doesn't show WIFI notification at the top as it is does not connected to WIFI properly. I cannot browse the internet also. I think problem is with hostapd.conf file. I think we will need to add more settings to hostapd.conf to add password security. So please provide the exact hostapd.conf file which should enable the password security, so that we should able to connect to network using password.
Another problem is that even I close to RPI, my mobile shows network signal as "not in range". It used to change from some signal to "Not in range" and from "Not in range" to some signal very frequently. Is it because of our configuration or device problem?
Guys, Please answer queries as soon as possible.
Jens SegersPosted 1 Month ago
@Light, you should ask the Raspberri Pi forums: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=46&t=25921&p=285160
LightPosted 2 Months ago
hey what could it be. i made everything like in your description but it's not working:
pi@raspberrypi ~ $ sudo lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 005: ID 04b4:6830 Cypress Semiconductor Corp. CY7C68300A EZ-USB AT2 USB 2.0 to ATA/ATAPI
pi@raspberrypi ~ $ sudo service hostapd status
[FAIL] hostapd is not running ... failed!
pi@raspberrypi ~ $ sudo service hostapd start
[....] Starting advanced IEEE 802.11 management: hostapdioctl(SIOCGIFINDEX): No such device
failed!
pi@raspberrypi ~ $
Jens SegersPosted 2 Months ago
@iztoogod, the 'make install' command will do this for you. You don't need to do that yourself.
iztoogodPosted 2 Months ago
i'm a really newby in linux may you please show an example to explain "add a startup script" please ...
Jens SegersPosted 3 Months ago
@Hatschi; this guide http://elinux.org/RPI-Wireless-Hotspot did exactly the same as I did. Only the iptables bit is a different.
RobPosted 3 Months ago
This is excellent and helped me a lot. Thank you very much!
Jens SegersPosted 3 Months ago
@Hatschi; I combined hostapd with udhcpd. I might make a blog post covering those steps. But it is not that complicated.
HatschiPosted 3 Months ago
Hey,
do you have a more complete description what steps to take to get edimax running as a hotspot ?
StevePosted 3 Months ago
Many thanks. Just what I was looking for. Worked a treat and without any problems. Mine was a generic RTL8188cus.