Jens Segers on Feb 15 2013

Realtek RTL8188 based access point on Raspberry Pi

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.


Comments

armnrd 4 days ago

@sirop, I am trying to set up an ap on jessie too. What configuration for hostapd did you use?


juvo 1 week ago

so far so good; only . . after "sudo service hostapd restart" the wlan is away ! ?


treximaru 3 months ago

it doesn't work on RTL8188SU . on jessie....


Laurence 4 months ago

@Andrew Barry What error do you get?


Enlooo 4 months ago

SO F** AWSOME, after trying hundrets of different tutorials with complicated commands and editing i found your guid ...and it works thanks a lot


kapitanbar 5 months ago

The old installation process with make/ sudo make install did the trick!!. Thank you very much!!!


Joel 5 months ago

how do i actually set up the hot spot?


sirop 6 months ago

Master branch works on jessie amd64 with rtl8188eu. Used isc-dhcp-server.


Andrew Barry 6 months ago

This does not work on RPi2 with Raspbian Jessie. anyone know of one that works? Sudo service hostapd restart gives me an error.


olivier 8 months ago

big big thank :)


qparrod 8 months ago

Real good page. Had same problem and this solution resolved it. Thanks a lot!


Rajeev 9 months ago

Thank you so much, i was looking for this for a month, finally its working.


armin 9 months ago

juhhhuuuuuuu, after days reading blogs abouter "how to configure a pi2 as router" (btw a lot of different ways) i found out , the mother of all problemswas the bl.... f... edimax driver.. now its solved thx to jens and the internet


Patric 11 months ago

Hi Jens, many many thanks for hostapd with RTL8188CUS support. But what I understand is that it´s based on quite old version on hostapd ? Do you think you can create one on hostapd 2.5? Cheers Patric


Sascha 11 months ago

Thanks a ton


Thnx! 11 months ago

3 days of attempts - and it works!!!!!


Alan 1 year ago

The only place I found useful information about getting a EW-7811Un working as an AP. Many Thanks.


protokra 1 year ago

THANK YOU! Finally I got my Access Point.


and its not working 1 year ago

apt get isent working and its a secret i geuss someone askt for it and it dosent get fixt or updated i think this site isent helping all other info is just from the main site i cant find any helpful info (atleast his version isent) i dont now wy every body is so cheerful its not working (github dosent see the ip of the pack.


DO5HHC 1 year ago

Thanks Jens! It works great on my RPi 1 (Kernel 4.1.10+) TL-WN725N v2 with RTL8188EUS / r8188eu! I almost gave up! Now I can use it to access my rtlsdr via rtl_tcp directly :-)


Felipe 1 year ago

Same, I need to uninstall this hostapd but apt-get doesn't find it.. @Magnus Any success ?


Felipe 1 year ago

Awesome! Many thanks!


Bereket 1 year ago

You're awesome, thanks for the driver!!


Conseils 1 year ago

EDIMAX Wifi Dongle, worked a treat. Thanks


luke 1 year ago

just started on GitHub so not sure how to pull request yet. Here is a script I put together to simplify getting, building, and installing this version of hostapd. I hope this helps someone.

https://github.com/theOtherLuke/rpi-access-point.git


luke 1 year ago

Thank you for this! I'm working on a router to connect my iPad and iPhone to a portable digital mixer setup for control and also to air-play soundcheck and intermission music (poor-man's airport express). I first tried several other solutions (adafruit, pi-point, etc) before stumbling on this. This is the second solution with a hostap modified for RTL8188(Edimax in my case) i found, and the first to work. I used isc-dhcp-server for my setup and all is working well, as is my bare bones apache server. Now to get shairport running. ATM I've had success to this stage both in Raspbian and DietPi.


namkingwin 1 year ago

Hi, I've followed your steps but the problem still issued: [....] Starting advanced IEEE 802.11 management: hostapdioctl[SIOCSIWMODE]: Invalid argument failed! My device is: Linksys WUSB54G (Ralink RT2070). Could you tell me how to fix that, please? Thank you!


Humphrey 1 year ago

For anyone having the problem of not being able to obtain and IP address when connecting with the Pi: with udhcp and with dnsmasq it appeared as if the DHCP server never got any DHCPrequest, no trace in the syslog of the Pi. And in the syslog of the client the DHCPrequest shows a timing out (no response from the DHCP server). So then I tried the third option: isc-dhcp-server, and BOOM it worked! So if you have the same problem, try that one, just google for a setup tutorial.

(raspberry pi 2 with 3.18.11-v7+ kernel, TL-WN725N v2 dongle with driver/firmware from: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=62371&sid=5029684639bac4fdc0ab70d32237ee85)


callsty 1 year ago

You are awesome!!!! THANK YOU so MUCH!


R A 1 year ago

Any one faced kernel panic /crash ISSUE , as soon connect client request/send any data. I am using RP 2 with latest RASPBIAN. Also i tried hostpd from - wget https://github.com/jenssegers/RTL8188-hostapd/archive/v2.0.tar.gz and also prebuilt same issue . pi@raspberrypi ~ $ uname -a Linux raspberrypi 4.0.9-v7+ #807 SMP PREEMPT Fri Jul 24 15:21:02 BST 2015 armv7l GNU/Linux pi@raspberrypi ~ $ lsusb Bus 001 Device 010: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] pi@raspberrypi ~ $ lshw WARNING: you should run this program as super-user. raspberrypi
description: Computer product: Raspberry Pi 2 Model B Rev 1.1 width: 32 bits -core description: Motherboard physical id: 0 capabilities: brcm_bcm2709 -cpu:0


-network:0 description: Wireless interface physical id: 1 bus info: usb@1:1.2 logical name: wlan0 serial: 74:da:38:41:39:19 capabilities: ethernet physical wireless configuration: broadcast=yes driver=rtl8192cu ip=10.10.10.10 multicast=yes wireless=unassociated -network:1 description: Ethernet interface physical id: 2 logical name: eth0 serial: b8:27:eb:8f:fa:2d size: 100Mbit/s capacity: 100Mbit/s capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=smsc95xx driverversion=22-Aug-2005 duplex=full firmware=smsc95xx USB 2.0 Ethernet ip=192.168.0.113 link=yes multicast=yes port=MII speed=100Mbit/s

Any help / direction appreciated Thx RA


Jos 1 year ago

Many thanks. Just what I was looking for. Worked a treat and without any problems.


hhr871 1 year ago

I very tired in this problem,thanks your tutorial.Now I meet another problem that my Mobile Phone can't scanning my Raspberry Pi‘AP. Could you help me? My Email Address is qw3036@qq.com.please do me a favor


hhr871 1 year ago

i am very tired in this,Thanks your tutorial to help me solve it. Now i meet another problem


Roos 1 year ago

Hi... Thanks for everything. but i have big problem that is 'ERROR 404:Not Found.' I think the path changed........ Help me....


Naism 1 year ago

Thanks, it was like a miracle!


Marco 1 year ago

dude you rock! I've been trying for ~1 year to get this to work and gave up. Then today I try it again with your hostapd and IT WORKZ

WOW THANK YOU VERY MUCH


Bruno Grassi Pietroski 1 year ago

Thank you, your tutorial is very helpful!


Tony 1 year ago

I have the same issue as Andrey - sudo hostapd_cli wps_config "unsecurednetwork" OPEN NONE "" doesn't work and hostapd quits. Haven't found a solution yet.


Izz Noland 1 year ago

@Robert Felker - no problem. I am glad it helped someone else as well.


Robert Felker 1 year ago

@Izz Noland Thanks Izz now it's up again on boot !


Izz Noland 1 year ago

fwiw, this is what I did to fix my issue which recently began (even after rebuild and remake) where hostapd would not start on boot: {code}sudo ln -s /etc/init.d/hostapd /etc/rc2.d/S02hostapd sudo update-rc.d hostapd enable{code}


Magnus 1 year ago

Hi! I removed the original apd, but later realised that I do not need the modified one. How do I remove the manually built version and replace it with the original, pre-installed one again?


Izz Noland 1 year ago

I had this working before I had an sdcard go bad. For some reason, hostapd doesn't start on boot, but will start fine when invoked manually. I'm using the master branch.


nsayer 1 year ago

The developer branch version from github fails the same way.


nsayer 1 year ago

This doesn't work anymore.

ioctl[SIOCSIWMODE]: Operation not permitted Could not set interface to mode(3)! Could not set interface to master mode! rtl871xdrv driver initialization failed.

I suspect the kernel (3.18.7+) includes an updated driver that screwed the pooch.


Hugh 1 year ago

Brilliant tutorial, but when I have the hotspot created, I can't connect as the device isn't getting an IP address. I'm trying to merge your tutorial with this tutorial: http://www.daveconroy.com/category/raspberry-pi-2/ because the hostapd doesn't work from his tutorial. Have you got any ideas on what's going wrong or how I can fix it?

Thanks very much!


Andrey 1 year ago

I'm having problem with hostapd_cli - in the issue of 'wps_config' configuring command to set new SSID parameters, hostapd immediately quits, and the command has no impact. For example: $ hostapd_cli wps_config "no security" OPEN NONE "" Does anybody have this issue?


pimail 1 year ago

great work. thx a lot. https://www.youtube.com/edit?o=U&video_id=3gV_0XRG958


HaoNC 1 year ago

Hi Jens Segers, I have a Realtek USB wifi tl-wn725. So, can you tell me the driver=? in the hostapd.conf, Thanks you!


jenssegers 1 year ago

@Manuel Just make sure you download the v2.0 tar :)


Manuel 1 year ago

I am an absolute noob when it comes to Linux. I have managed to follow the original instructions to install the hostapd version on my ArchLinux but I do get the same ioctl[rtl_ioctl_hostapd]: Invalid argument error others have mentioned. I understand the hostapd version of the development branch seems to fix that but how do I install this? Thanks


Shelby 1 year ago

Worked perfectly. Thank you! Some messages during the make about variable defined but not used, but everything works.


jenssegers 1 year ago

@Hove Great to know that it works! I'll do a proper release tag.


Hove 1 year ago

Just checked the 2.0Beta from the master and that works well too. Now I just need to persuade udhcpd to play ball!


Hove 1 year ago

Just to let you know you development hostapd works with the 31/1/2015 Raspian distribution where the standard and daveconroy.com versions did not. The IOCTL_RTL_HOSTAPD: Operation not supported no longer happens and I can connect to the network. Thanks.


jenssegers 1 year ago

@bogdanm great to hear that it is working, I merged it with master and tagged 2.0-beta :)


bogdanm 1 year ago

@jenssegers: thanks for the new version on the 'develop' branch! With this new version, I got rid of the "ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported" error and I was also able to hide my SSID (something that never worked with the previous version). It's looking good so far, I'll update if I have news.


jenssegers 1 year ago

Guys, I tried updating the hostapd version but did not test it. If the master branch version is not working, try the develop branch: https://github.com/jenssegers/RTL8188-hostapd/tree/develop


Nathan 1 year ago

Hey Jens, is het misschien mogelijk debugoutput door te mailen of te posten van hostapd (vooral output van wanneer er een verbinding tot stand komt)? Ik lig hier al dagen te kl*ten, en krijg het maar niet werkende. Output van een normaal werkende hostapd zou helpful zijn ;) Thanks!


Thomas 2 years ago

I can confirm that with the current Raspbian distribution, I get the ioctl[RTL_IOCTL_HOSTAPD] error, too. I then downloaded and compiled hostapd directly from edimax, like the previous commenter suggested. The warning is gone away now, but clients still cannot join the network. This is on the 8188CUS chip which is supposed to be working.


Andi 2 years ago

Try this if you having problem with hosted (not found or invalid argument etc.) http://www.raspberrypi.org/forums/viewtopic.php?t=25921

this finally worked for me. Its just about downloading the driver package vom Realtek find the custom hostapd in the archive make && make install and you are almost ready to go. One thing left to say. make install copies the files (hosted and hosted_cli) to /usr/local/bin. apt-get installs it originally to /usr/sbin/ so you have to copy the binary from /usr/local/bin. Thats all. Took me all day to find the one working solution.


Harry 2 years ago

I'm also getting the same error:

root@raspberrypi:~# service hostapd restart [ ok ] Stopping advanced IEEE 802.11 management: hostapd. [....] Starting advanced IEEE 802.11 management: hostapdioctl[RTL_IOCTL_HOSTAPD]: Invalid argument . ok

Anyone knows how to solve this?


2 years ago

Getting same error [ ok ] Stopping advanced IEEE 802.11 management: hostapd. [....] Starting advanced IEEE 802.11 management: hostapdioctl[RTL_IOCTL_HOSTAPD]: Invalid argument . ok

Any solution?


Nadir 2 years ago

getting invalid argument error. Can someone please help????

sudo service hostapd restart

Stopping advanced IEEE 802.11 management hostapd [ OK ] Starting advanced IEEE 802.11 management hostapd ioctl[SIOCSIWMODE]: Invalid argument


Sivakumar Reddy Sakam 2 years ago

getting invalid argument error. any clues?

sudo service hostapd restart

  • Stopping advanced IEEE 802.11 management hostapd [ OK ]
  • Starting advanced IEEE 802.11 management hostapd ioctl[SIOCSIWMODE]: Invalid argument

karkar 2 years ago

hello..

after hitting ” sudo service isc-dhcp-server start sudo service hostapd start”

i got this error.. ————————————- Configuration file: /etc/hostapd/hostapd.conf drv->ifindex=3 l2_sock_recv==l2_sock_xmit=0x0x49648 ioctl[SIOCSIWMODE]: Invalid argument Could not set interface to mode(3)! Could not set interface to master mode! rtl871xdrv driver initialization failed. ————————————————————————– but.. my cellphone and laptop can STILL detect the SSID of my Raspberry pi.. but not able to connect to internet..

when i googled then someone had the same issue.. https://groups.google.com/forum/#!topic/beagleboard/_bx0UlaFWjg

is it required to upgrade my wifi dongle??or any issues?? please solve my issue....


eliotbdr 2 years ago

sorry but for V2 it don't work


gennad 2 years ago

Can anyone confirm this works with RTL8188EUS chip (TP-Link TL-WN725N V2 USB)?

Confirm, works for me


Jens Segers 2 years ago

@Torsen; check out http://elinux.org/RPI-Wireless-Hotspot


Torsten 2 years ago

Hi Jens, I did your setup some months ago but I am now trying to do again. Unfortunately you deleted the link for further instruction to create the AP. Can you please add it again?


Joerg 2 years ago

Hello Jens, that looked very smart to me and I installed your version of hostapd. Nevertheless I receive the following message and clients are unable to connect. The AP is seen in the wifi list of other devices. The only change I made was setting the ssid and wpa_passphrase. any ideas how to fix i? best regards Joerg

pi@raspberrypi /RTL8188-hostapd-1.1/hostapd $ sudo service hostapd start [....] Starting advanced IEEE 802.11 management: hostapdioctl[RTL_IOCTL_HOSTAPD]: Operation not supported . ok


julian 2 years ago

hi jens, i have a prob. with the line: ioctl[rtl_ioctl_hostapd]: Invalid argument do u know how to fix this. because i dont get an ip on my clients.


Simon 2 years ago

Hey Jens. Many thanks for your work. I've the following problem on my raspberry running with the last distribution of raspbmc: pi@raspbmc:~$ cd RTL8188-hostapd-1.1/hostapd pi@raspbmc:~/RTL8188-hostapd-1.1/hostapd$ sudo make sudo: make: command not found I'm a Newbie, so what can i do to follow your steps? Many thanks!


Stevie P 2 years ago

Hello after downloading this on my rapberry pi and using sudo tar -zxvf v1.1.tar.gz I get RTL8188-hostapd-1.1/ RTL8188-hostapd-1.1/.gitignore RTL8188-hostapd-1.1/COPYING RTL8188-hostapd-1.1/README.md RTL8188-hostapd-1.1/hostapd/ RTL8188-hostapd-1.1/hostapd/.config RTL8188-hostapd-1.1/hostapd/.config_bsd RTL8188-hostapd-1.1/hostapd/Android.mk RTL8188-hostapd-1.1/hostapd/ChangeLog RTL8188-hostapd-1.1/hostapd/Makefile RTL8188-hostapd-1.1/hostapd/README RTL8188-hostapd-1.1/hostapd/README-WPS RTL8188-hostapd-1.1/hostapd/bsd_hostapd.conf RTL8188-hostapd-1.1/hostapd/config_file.c RTL8188-hostapd-1.1/hostapd/config_file.h RTL8188-hostapd-1.1/hostapd/ctrl_iface.c RTL8188-hostapd-1.1/hostapd/ctrl_iface.h RTL8188-hostapd-1.1/hostapd/defconfig RTL8188-hostapd-1.1/hostapd/dump_state.c RTL8188-hostapd-1.1/hostapd/dump_state.h RTL8188-hostapd-1.1/hostapd/eap_register.c RTL8188-hostapd-1.1/hostapd/eap_register.h RTL8188-hostapd-1.1/hostapd/eap_testing.txt RTL8188-hostapd-1.1/hostapd/hlr_auc_gw.c RTL8188-hostapd-1.1/hostapd/hlr_auc_gw.milenage_db RTL8188-hostapd-1.1/hostapd/hostapd.8 RTL8188-hostapd-1.1/hostapd/hostapd.accept RTL8188-hostapd-1.1/hostapd/hostapd.conf RTL8188-hostapd-1.1/hostapd/hostapd.deny RTL8188-hostapd-1.1/hostapd/hostapd.eap_user RTL8188-hostapd-1.1/hostapd/hostapd.radius_clients RTL8188-hostapd-1.1/hostapd/hostapd.sim_db RTL8188-hostapd-1.1/hostapd/hostapd.vlan RTL8188-hostapd-1.1/hostapd/hostapd.wpa_psk RTL8188-hostapd-1.1/hostapd/hostapd_cli.1 RTL8188-hostapd-1.1/hostapd/hostapd_cli.c RTL8188-hostapd-1.1/hostapd/logwatch/ RTL8188-hostapd-1.1/hostapd/logwatch/README RTL8188-hostapd-1.1/hostapd/logwatch/hostapd RTL8188-hostapd-1.1/hostapd/logwatch/hostapd.conf RTL8188-hostapd-1.1/hostapd/main.c RTL8188-hostapd-1.1/hostapd/nt_password_hash.c RTL8188-hostapd-1.1/hostapd/wired.conf RTL8188-hostapd-1.1/patches/ RTL8188-hostapd-1.1/patches/openssl-0.9.8-tls-extensions.patch RTL8188-hostapd-1.1/patches/openssl-0.9.8d-tls-extensions.patch RTL8188-hostapd-1.1/patches/openssl-0.9.8e-tls-extensions.patch RTL8188-hostapd-1.1/patches/openssl-0.9.8g-tls-extensions.patch RTL8188-hostapd-1.1/patches/openssl-0.9.8h-tls-extensions.patch RTL8188-hostapd-1.1/patches/openssl-0.9.8i-tls-extensions.patch RTL8188-hostapd-1.1/patches/openssl-0.9.9-session-ticket.patch RTL8188-hostapd-1.1/scripts/ RTL8188-hostapd-1.1/scripts/hostapd.conf RTL8188-hostapd-1.1/scripts/init RTL8188-hostapd-1.1/src/ RTL8188-hostapd-1.1/src/Makefile RTL8188-hostapd-1.1/src/ap/ RTL8188-hostapd-1.1/src/ap/Makefile RTL8188-hostapd-1.1/src/ap/accounting.c RTL8188-hostapd-1.1/src/ap/accounting.h RTL8188-hostapd-1.1/src/ap/ap_config.c RTL8188-hostapd-1.1/src/ap/ap_config.h RTL8188-hostapd-1.1/src/ap/ap_drv_ops.c RTL8188-hostapd-1.1/src/ap/ap_drv_ops.h RTL8188-hostapd-1.1/src/ap/ap_list.c RTL8188-hostapd-1.1/src/ap/ap_list.h RTL8188-hostapd-1.1/src/ap/ap_mlme.c RTL8188-hostapd-1.1/src/ap/ap_mlme.h RTL8188-hostapd-1.1/src/ap/authsrv.c RTL8188-hostapd-1.1/src/ap/authsrv.h RTL8188-hostapd-1.1/src/ap/beacon.c RTL8188-hostapd-1.1/src/ap/beacon.h RTL8188-hostapd-1.1/src/ap/ctrl_iface_ap.c RTL8188-hostapd-1.1/src/ap/ctrl_iface_ap.h RTL8188-hostapd-1.1/src/ap/drv_callbacks.c RTL8188-hostapd-1.1/src/ap/hostapd.c RTL8188-hostapd-1.1/src/ap/hostapd.h RTL8188-hostapd-1.1/src/ap/hw_features.c

gzip: stdin: unexpected end of file RTL8188-hostapd-1.1/src/ap/hw_features.h RTL8188-hostapd-1.1/src/ap/iapp.c RTL8188-hostapd-1.1/src/ap/iapp.h RTL8188-hostapd-1.1/src/ap/ieee802_11.c tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now

any help would be appreciated

thank you


Andreas 2 years ago

sorry failed to add the error message:

getting the hostapdioctl[RTL_IOCTL_HOSTAPD]: Operation not supported

Message

sudo service hostapd restart [ ok ] Stopping advanced IEEE 802.11 management: hostapd.

[....] Starting advanced IEEE 802.11 management: hostapdioctl[RTL_IOCTL_HOSTAPD]: Operation not supported. ok

Andreas


Andreas 2 years ago

similar problem as @deepsheet, @leucos, @xezpeleta

compiled and installed hostapd following your blog:

lsusb says Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter sudo iwconfig wlan0 mode master gives no error

sudo service hostapd restart [ ok ] Stopping advanced IEEE 802.11 management: hostapd. [....] Starting advanced IEEE 802.11 management: hostapdioctl[RTL_IOCTL_HOSTAPD]: Operation not supported . ok

Any ideas for resolving this issue


Geordon 2 years ago

I keep getting the following error when I Try to start hosted:

pi@onion-pi ~/RTL8188-hostapd-1.1/hostapd $ sudo service hostapd restart [ ok ] Stopping advanced IEEE 802.11 management: hostapd. [....] Starting advanced IEEE 802.11 management: hostapdioctl[RTL_IOCTL_HOSTAPD]: Invalid argument . ok

When I check to see if it's running, it is but I can't connect to it.

pi@onion-pi ~/RTL8188-hostapd-1.1/hostapd $ ps -ef|grep hostapd root 3169 1 0 19:28 ? 00:00:00 /usr/local/bin/hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf

The only changes that I made to the config file were to change the SSID and password. I'm having these issues on the latest Raspbian, and it's giving me a case of the flux. I really want to use my Pi to run a Tor relay and act as a WAP in my home. Any suggestions?


Siamak 2 years ago

Thanks dude


krunkosaurus 2 years ago

Just wanted to say thanks this helped me.


xezpeleta 3 years ago

Same problem as @deepsheet and @leucos

My 'lsusb' says I have a RTL8188SU. If I execute "iwconfig wlan0 mode master" there is no error, so I guess master mode is supported... but hostapd doesn't work :/

ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported

Thanks in advance!


Oopra 3 years ago

Thank you!!! great post. Solved my problem.


Chris A 3 years ago

ignore my last, I used the default settings from the conf file and n mode works perfecttly, thankyou!


Chris A 3 years ago

Jens, this is truly fantastic work, thank you for putting this so succinctly and clearly on the board.

I was wondering if the compiled driver supports N node as well as bg?

iwconfig shows :

IEEE 802.11bg Bit Rate:54Mbps

I am using the following hostapd.conf:

ignore_broadcast_ssid=0 driver=rtl871xdrv device_name=RTL8192CU manufacturer=Realtek

interface=wlan0 ssid=home hw_mode=g channel=2 wmm_enabled=1 country_code=SG ieee80211d=1 auth_algs=3 wpa=3 wpa_passphrase=home1234 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP macaddr_acl=0 ht_capab=[HT20][SHORT-GI-20]


leucos 3 years ago

@deepsheet : I suppose our chipsets (RTL8188SU) doesn't work with this. However I tried with RTL8188CUS and it works fine. Thanks Jens !


Jens Segers 3 years ago

@leucos, you could ask the forum: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=46&t=25921&p=285160


leucos 3 years ago

Same issue as @deepsheet with : ID 0bda:8171 Realtek Semiconductor Corp. RTL8188SU 802.11n WLAN Adapter

Any clue ?


deepsheet 3 years ago

pi@raspberrypi ~/RTL8188-hostapd-1.1/hostapd $ sudo service hostapd restart
[ ok ] Stopping advanced IEEE 802.11 management: hostapd.
[....] Starting advanced IEEE 802.11 management: hostapdioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
. ok

Any ideas how to fix this? Driver issues?

lsusb: Bus 001 Device 005: ID 0bda:8171 Realtek Semiconductor Corp. RTL8188SU 802.11n WLAN Adapter


Bank 3 years ago

Hey, I'd like to know more about your code. Where is the main function of this code


Jens Segers 3 years ago

@Steven, the sudo make install command wil move the startup and configuration file to the correct location for you. You don't need to do this yourself. You only have to check the /etc/hostapd/hostapd.conf file for configuration and start the service.


Steven 3 years ago

Hi. Awesome instructions, been having problems with hostapd and yours is the first info blog that has said you have to make the file! THANK YOU. I am a total Noob with all of this but need a R-Pi as an AP to carry out a project I am working on. I now need to figure out how to carry out your last step of moving the file to where it is meant to be.......


Jens Segers 3 years ago

@Zach, I remember mine being slow as wel, but I don't remember how slow :)


Zach 3 years ago

Have you found the Edimax EW-7811Un to be incredibly slow running in AP mode with hostapd? I'm getting somewhere around 1MB/s through it. If I use the hawking HWUG1, it's about 10-15x faster.


Mike 3 years ago

Great, many thanks. Helped me to use Realtek RTL8188CUS dongle in my Raspberry.


LEO 3 years ago

Thanks for posting this. Gives us hope.... I am trying to compile your code for Pidora. I'm not an expert, any advice on what can I research more to make the proper modifications to your install script?


Konstantin 3 years ago

+1


Scratz 3 years ago

Thank you very much ;)


Olli 3 years ago

Have you tried to apply your patch to hostapd version 2 too?


Mohammed 3 years ago

This works like a charm Jens. Thanks!


mezzobob 3 years ago

Hi Jens,

I got Edimax EW-7811Un in AP mode woking thanks! I tried too run airplay over the WiFi i created. iPhone AirPlay > AP WiFi on the pi > shairport on the pi as AirPlay receiver

The Music is stuttering on the pi :( via ethernet is works fine.


Tom 3 years ago

With the newest Rasbian image and all updates the hostapd fails to autostart. After a manual restart it works but it takes minutes for the AP to send.


Damian 3 years ago

I fucking love you!


King_ofthe_North 3 years ago

I followed your instructions religiously and the access point shows up on my wifi search bar, but once I submit the password it fails to connect and "connection time-out" appears. Has anyone encountered this problem? I'm trying to run the server to experiment with ka-lite (Khan Academy Lite)


Torsten 3 years ago

@Xandertron: check with ifconfig if wlan0 does have an IP address. If it doesn't have one try this: http://sirlagz.net/2013/02/10/how-to-use-the-raspberry-pi-as-a-wireless-access-pointrouter-part-3b/ also add 'auto wlan0' into /etc/network/interfaces so that wlan0 does come up automatically


Xandertron 3 years ago

Looks like any device that tries to connect gets a 169 ip address.


Xandertron 3 years ago

Hi. I follow your guide and the hotspot sets up fine. However i cannot get anything to connect to it. I've had a read of http://elinux.org/RPI-Wireless-Hotspot and ruled out the WPA causing the problem as i get the same problem with an unsecure connection. My DHCP is setup exactly as mentioned too yet still no joy. Can anyone shed any light on a confusing problem? Thank you.


silverk 3 years ago

works fine with EDIMAX and raspbian. Thank You!


Torsten 3 years ago

Hi Jens, I followed your guide an then the one you linked to in your last sentence. I have the problem that I can't run hostapd on boot. The error message is: pi@raspberrypi ~ $ sudo update-rc.d hostapd enable update-rc.d: using dependency based boot sequencing update-rc.d: error: no runlevel symlinks to modify, aborting! Do you have any ideas? Thanks for your help!


Jens Segers 3 years 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


Trevor 3 years 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!!


elceef 3 years ago

Can anyone confirm this works with RTL8188EUS chip (TP-Link TL-WN725N V2 USB)?


liqiang 3 years 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!


Barry 3 years ago

Just what I needed, Thanks.


fifer 3 years ago

@dan is the hostapd daemon process running after rebooting? (sudo service hostapd status) if it is not, try "sudo insserv hostapd" and restart.


Richard 3 years 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?


Dan 3 years 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 3 years ago

hi i have limited connectivity do have to install anything else?


Nick B 3 years 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


NickB 3 years 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_H 3 years ago

No, that is about connecting to an AP with an RTL8188. I want to use th RTL8188 as an AP.


[email protected] 3 years ago

@markh - don't know if this helps? http://forum.stmlabs.com/showthread.php?tid=732&pid=36819#pid36819


Mark_H 3 years 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.


Fifer 3 years 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


Fifer 3 years 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 Segers 3 years 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 Segers 3 years 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).


Mark 3 years 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 Karemore 3 years 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 Segers 3 years ago

@Light, you should ask the Raspberri Pi forums: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=46&t=25921&p=285160


Light 3 years 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 Segers 3 years ago

@iztoogod, the 'make install' command will do this for you. You don't need to do that yourself.


iztoogod 3 years ago

i'm a really newby in linux may you please show an example to explain "add a startup script" please ...


Jens Segers 3 years ago

@Hatschi; this guide http://elinux.org/RPI-Wireless-Hotspot did exactly the same as I did. Only the iptables bit is a different.


Rob 3 years ago

This is excellent and helped me a lot. Thank you very much!


Jens Segers 3 years ago

@Hatschi; I combined hostapd with udhcpd. I might make a blog post covering those steps. But it is not that complicated.


Hatschi 3 years ago

Hey, do you have a more complete description what steps to take to get edimax running as a hotspot ?


Steve 3 years ago

Many thanks. Just what I was looking for. Worked a treat and without any problems. Mine was a generic RTL8188cus.